A free Windows-compatible Operating System - mirrored from GitHub
Go to file
ReactOS Portable Systems Group ba415f6e7b Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm@reactos.org>):
[NTOS]: The kernel normally does not save FPU state during Ring 0 transitions since the FPU should not be used. The one exception is when a kernel debugger is attached. Unfortunately, the latter check in ReactOS results in even "print on the serial line" to count as "debugger attached", and thus FPU state was almost always saved, slowing down traps significantly.
    [NTOS]: The kernel also does not typically save DRx (debug) registers unless they were in use. During an exception dispatch, they are zeroed out, and later during trap exit, if any debug register is set, DR7 is updated to enable that hardware breakpoint. Unfortunately, the code to clear the debug registers had a bug: DR2 was never cleared. Because DR2 ended up being a random stack value during trap frame generation, this caused a bogus address to be added to DR2, and DR7 would then enable the 2nd hardware breakpoint. This caused the kernel to always save DRx state, which is slow, and worse, could cause random hardware breakpoints to fire.
    [NTOS]: Start implementing trap handling in C. ASM trap handlers will now only be 5 lines of assembly including a function call to a C handler. All C handling code uses maximum two arguments and is all FASTCALL for efficiency.
    [NTOS]: Implement C versions of TRAP_PROLOG and TRAP_EPILOG. Implement C version of Ki386EoiHelper. Implement C version of CommonDispatchException (and helper) and KiFatalSystemException. Implement C version of CHECK_FOR_APC_DELIVER. Implement trap debugging checks as a separate entity instead of always doing them.
    [NTOS]: Add missing intrinsics for DS/ES/GS segment query.

The kernel is now ready for some trap handling to be done in C. Due to the FPU/Debug fixes and relaxation of paranoid debug checks, the C code will likely be faster than the original assembly.

svn path=/trunk/; revision=45000
2010-01-08 15:04:19 +00:00
irc Give Techbot the ability to check for and ghost existing bots, then rename itself 2008-08-10 13:06:58 +00:00
reactos Trap Handlers in C Patch 1 of X (Patch by Sir_Richard <ros.arm@reactos.org>): 2010-01-08 15:04:19 +00:00
rosapps Arch, why are you removing </module> tags ? 2010-01-01 01:41:39 +00:00
rostests [crypt32_winetest] 2010-01-03 11:59:59 +00:00
wallpaper Rename the wallpaper to conform with ISO 9660:1988 and make cdmake happy... 2009-02-03 13:26:30 +00:00