- Handle failure after PsConvertToGuiThread and return STATUS_INVALID_SYSTEM_SERVICE and/or FALSE and/or -1 on failure.
- Made MCE/XMMI interrupts unexpected on-boot.
- Removed KiTrapUnknown and used KiTrap0F (15) instead, which is the generic unexpected handler.
svn path=/trunk/; revision=20942
- Merge syscall.S and trap.S into trap.S, and nicely document the software interrupt table that we service, as well as special cases.
svn path=/trunk/; revision=20936
* Use these new definitions instead of constants in syscall.S
* Document the macros using doxygen-compatible format, and convert SET_TF_DEBUG_HEADER to as macro instead of CPP macro.
* Use SET_TF_DEBUG_HEADER in system call handlers instead of duplicating the code.
svn path=/trunk/; revision=20930
- Added more DBG checks for trap exits:
* Detect if exiting with incorrect IF state.
* Detect if exiting with broken stack.
* Detect if exiting with a broken trap frame (note: Disabled in Kei386EoiHelper beause this raises the assertion. The trap frame is valid, it's just that some old code is using DbgArgMark for other purposes. Will fix.)
* Detect if exiting with invalid FS.
* Detect if exiting with invalid Exception List.
* Detect if exiting with incorrect exception list and/or incorrect previmous mode on the stack (to detect macro/calling type mismatch).
The trap exit code is now complete and shareable across all 3 trap exit types, except for one broken assertion left to fix.
svn path=/trunk/; revision=20923
* Increase per-systemcall call count in the KiServiceTable if it was specified, for performance counters.
* Add sanity checks to system call handler to detect:
- User-mode system calls at > PASSIVE
- User-mode system call return at > PASSIVE
- Return to user-mode with Kernel APCs disabled.
* These features are on DBG only.
svn path=/trunk/; revision=20922
- Replaced most of the trap prolog code by the KiDebugService entry trap code from syscall.S. Eventually, after remaining bugs are fixed, the code will be shared across all traps and not duplicated anymore. (For documnetation's sake, changing the prolog has the following effects: DR registers are not saved anymore (they will be later), DS/ES are set to RPL3 DATA, not RPL0 DATA, GS is not touched (it shoudl be 0, not RPL0_DATA). PreviousMode is not touched at all, the Debug Trap Frame header is properly setup).
svn path=/trunk/; revision=20918
* We did not update the KPCR's stacklimit/initialstack with the new thread's stacklimit/initialstack.
* We always assumed V86 frame bias in KeInitializeThreadContext.
* We did not properly update ESP0 during context switch, to make space for the NPX frame and V86 bias.
* We did not update fs:18h to point to the new TEB.
* We did not clear out GS when switching processes, nor update the TSS's cr3.
* If a new LDT was being updated, we over-wrote EBP (which was supposed to point to the TSS) by the GDT pointer.
* We used a push/pop esp0 hack which hid the fact we never updated esp0.
svn path=/trunk/; revision=20911