Author: ion Date: Mon Mar 19 08:56:27 2007 New Revision: 26138
URL: http://svn.reactos.org/svn/reactos?rev=26138&view=rev Log: - Change the way DR_TRAP_FIXUP and V86_TRAP_FIXUP work so that they can be combined into TRAP_FIXUPS, which will also handle ABIOS Fixups later. - Modified the way TRAP_FIXUPS and XXX_PROLOGS work, so that the fixup code doesn't depend on numerical values anymore, but instead on unique labels for each function (kitd thus becomes kitd_a and kitd_t, for entry and exit). - Now we can put the TRAP_FIXUPS for the Interrupt Template as part of the code, and at the end. - Enable Dr Save/Restore in lots of places where it was previously disable. - Implement Dr Save/Restore in V86 traps.
Modified: trunk/reactos/hal/halx86/generic/irq.S trunk/reactos/hal/halx86/generic/systimer.S trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S trunk/reactos/ntoskrnl/ke/i386/irqobj.c trunk/reactos/ntoskrnl/ke/i386/trap.s
Modified: trunk/reactos/hal/halx86/generic/irq.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?re... ============================================================================== --- trunk/reactos/hal/halx86/generic/irq.S (original) +++ trunk/reactos/hal/halx86/generic/irq.S Mon Mar 19 08:56:27 2007 @@ -104,6 +104,9 @@ .long _HalpApcInterrupt2ndEntry /* APC_LEVEL */ .long _HalpDispatchInterrupt2ndEntry /* DISPATCH_LEVEL */
+_UnhandledMsg: + .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n" + /* FUNCTIONS *****************************************************************/
.globl _HalpInitPICs@0 @@ -630,8 +633,7 @@
.globl _HalpApcInterrupt .func HalpApcInterrupt -Dr_hapc: DR_TRAP_FIXUP -V86_hapc: V86_TRAP_FIXUP +TRAP_FIXUPS hapc_a, hapc_t, DoFixupV86, DoFixupAbios _HalpApcInterrupt:
/* Create fake interrupt stack */ @@ -641,7 +643,7 @@ push eax
/* Enter interrupt */ - INT_PROLOG hapc, DoPushFakeErrorCode + INT_PROLOG hapc_a, hapc_t, DoPushFakeErrorCode .endfunc
.globl _HalpApcInterrupt2ndEntry @@ -679,8 +681,7 @@
.globl _HalpDispatchInterrupt .func HalpDispatchInterrupt -Dr_hdpc: DR_TRAP_FIXUP -V86_hdpc: V86_TRAP_FIXUP +TRAP_FIXUPS hdpc_a, hdpc_t, DoFixupV86, DoFixupAbios _HalpDispatchInterrupt:
/* Create fake interrupt stack */ @@ -690,7 +691,7 @@ push eax
/* Enter interrupt */ - INT_PROLOG hdpc, DoPushFakeErrorCode + INT_PROLOG hdpc_a, hdpc_t, DoPushFakeErrorCode .endfunc
.globl _HalpDispatchInterrupt2ndEntry
Modified: trunk/reactos/hal/halx86/generic/systimer.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systimer... ============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S (original) +++ trunk/reactos/hal/halx86/generic/systimer.S Mon Mar 19 08:56:27 2007 @@ -17,6 +17,9 @@ _HalpLastPerfCounterHigh: .long 0 _HalpPerfCounterLow: .long 0 _HalpPerfCounterHigh: .long 0 + +_UnhandledMsg: + .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n"
/* FUNCTIONS *****************************************************************/
@@ -213,12 +216,11 @@
.globl _HalpClockInterrupt@0 .func HalpClockInterrupt@0 -V86_hci: V86_TRAP_FIXUP -Dr_hci: DR_TRAP_FIXUP +TRAP_FIXUPS hci_a, hci_t, DoFixupV86, DoFixupAbios _HalpClockInterrupt@0:
/* Enter trap */ - INT_PROLOG hci, DoPushFakeErrorCode + INT_PROLOG hci_a, hci_t, DoPushFakeErrorCode
/* Push vector and make stack for IRQL */ push 0x30
Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/i... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S Mon Mar 19 08:56:27 2007 @@ -17,12 +17,16 @@ #define DoRestoreSegments 1 #define DoRestoreVolatiles 1 #define DoPushFakeErrorCode 1 +#define DoFixupV86 1 +#define DoFixupAbios 1 #define NotFromSystemCall 0 #define DoNotRestorePreviousMode 0 #define DoNotRestoreEverything 0 #define DoNotRestoreSegments 0 #define DoNotRestoreVolatiles 0 #define DoNotPushFakeErrorCode 0 +#define DoNotFixupV86 0 +#define DoNotFixupAbios 0
// Arguments for idt #define INT_32_DPL0 0x8E00 @@ -210,15 +214,90 @@ .endm
// -// @name V86_TRAP_FIXUP -// -// This macro sets up the debug header in the trap frame. +// @name TRAP_FIXUPS +// +// This macro contains out-of-line code for various Trap Frame Fixups, such as: +// +// - DR Fixup: Loads and restores DR registers. +// - V86 Fixup: Loads and restores V86 segments. +// - ABIOS Fixup: Loads and restores the ABIOS state and stack. // // @param None. // // @remark ebp = PKTRAP_FRAME // -.macro V86_TRAP_FIXUP +.macro TRAP_FIXUPS Label, EndLabel, V86Fix, AbiosFix +Dr_&Label: + + /* Check if this was V86 mode */ + test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK + jnz 2f + + /* Check if it was user mode */ + test byte ptr [ebp+KTRAP_FRAME_CS], MODE_MASK + jz Dr_&EndLabel + +2: + /* Get DR0, 1, 2 */ + mov ebx, dr0 + mov ecx, dr1 + mov edi, dr2 + + /* Save them */ + mov [ebp+KTRAP_FRAME_DR0], ebx + mov [ebp+KTRAP_FRAME_DR1], ecx + mov [ebp+KTRAP_FRAME_DR2], edi + + /* Get DR3, 6, 7 */ + mov ebx, dr3 + mov ecx, dr6 + mov edi, dr7 + + /* Save them */ + mov [ebp+KTRAP_FRAME_DR3], ebx + mov [ebp+KTRAP_FRAME_DR6], ecx + mov [ebp+KTRAP_FRAME_DR7], edi + + /* Clear DR7 */ + xor ebx, ebx + mov dr7, ebx + + /* Get the PRCB */ + mov edi, PCR[KPCR_PRCB] + + /* Get DR0, 1 */ + mov ebx, [edi+KPRCB_DR0] + mov ecx, [edi+KPRCB_DR1] + + /* Set them */ + mov dr0, ebx + mov dr1, ecx + + /* Get DR2, 3 */ + mov ebx, [edi+KPRCB_DR2] + mov ecx, [edi+KPRCB_DR3] + + /* Set them */ + mov dr2, ebx + mov dr3, ecx + + /* Get DR6, 7 */ + mov ebx, [edi+KPRCB_DR6] + mov ecx, [edi+KPRCB_DR7] + + /* Set them */ + mov dr6, ebx + mov dr7, ecx + jmp Dr_&EndLabel + +.if \AbiosFix +Abios_&Label: + UNHANDLED_PATH +.endif + +.if \V86Fix +V86_&Label: + /* Get V86 segment registers */ mov eax, [ebp+KTRAP_FRAME_V86_FS] mov ebx, [ebp+KTRAP_FRAME_V86_GS] @@ -232,79 +311,8 @@ mov [ebp+KTRAP_FRAME_DS], dx
/* Go back to mainline code */ - jmp 1f -.endm - -// -// @name DR_TRAP_FIXUP -// -// This macro sets up the debug header in the trap frame. -// -// @param None. -// -// @remark ebp = PKTRAP_FRAME -// -.macro DR_TRAP_FIXUP - /* Check if this was V86 mode */ - test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK - jnz 2f - - /* Check if it was user mode */ - test byte ptr [ebp+KTRAP_FRAME_CS], MODE_MASK - jz 3f - -2: - /* Get DR0, 1, 2 */ - mov ebx, dr0 - mov ecx, dr1 - mov edi, dr2 - - /* Save them */ - mov [ebp+KTRAP_FRAME_DR0], ebx - mov [ebp+KTRAP_FRAME_DR1], ecx - mov [ebp+KTRAP_FRAME_DR2], edi - - /* Get DR3, 6, 7 */ - mov ebx, dr3 - mov ecx, dr6 - mov edi, dr7 - - /* Save them */ - mov [ebp+KTRAP_FRAME_DR3], ebx - mov [ebp+KTRAP_FRAME_DR6], ecx - mov [ebp+KTRAP_FRAME_DR7], edi - - /* Clear DR7 */ - xor ebx, ebx - mov dr7, ebx - - /* Get the PRCB */ - mov edi, PCR[KPCR_PRCB] - - /* Get DR0, 1 */ - mov ebx, [edi+KPRCB_DR0] - mov ecx, [edi+KPRCB_DR1] - - /* Set them */ - mov dr0, ebx - mov dr1, ecx - - /* Get DR2, 3 */ - mov ebx, [edi+KPRCB_DR2] - mov ecx, [edi+KPRCB_DR3] - - /* Set them */ - mov dr2, ebx - mov dr3, ecx - - /* Get DR6, 7 */ - mov ebx, [edi+KPRCB_DR6] - mov ecx, [edi+KPRCB_DR7] - - /* Set them */ - mov dr6, ebx - mov dr7, ecx - jmp 3f + jmp V86_&EndLabel +.endif .endm
// @@ -423,7 +431,7 @@ // /* Handle trap */ // <Your Trap Code Here> // -.macro TRAP_PROLOG Label +.macro TRAP_PROLOG Label EndLabel /* Just to be safe, clear out the HIWORD, since it's reserved */ mov word ptr [esp+2], 0
@@ -474,7 +482,7 @@ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK jnz V86_&Label
-1: +V86_&EndLabel: /* Get current thread */ mov ecx, PCR[KPCR_CURRENT_THREAD] cld @@ -487,7 +495,7 @@ jnz Dr_&Label
/* Set the Trap Frame Debug Header */ -3: +Dr_&EndLabel: SET_TF_DEBUG_HEADER .endm
@@ -503,7 +511,7 @@ // // @remark For software interrupts, make sure that a fake INT stack is created. // -.macro INT_PROLOG Label FakeErrorCode +.macro INT_PROLOG Label EndLabel FakeErrorCode
.if \FakeErrorCode /* Save fake error code */ @@ -533,7 +541,7 @@ jnz V86_&Label
/* Check if this was kernel mode */ -1: +V86_&EndLabel: cmp word ptr [esp+KTRAP_FRAME_CS], KGDT_R0_CODE jz 1f
@@ -597,7 +605,7 @@ jnz Dr_&Label
/* Set the trap frame debug header */ -3: +Dr_&EndLabel: SET_TF_DEBUG_HEADER .endm
@@ -616,7 +624,7 @@ // // @remark None. // -.macro SYSCALL_PROLOG Label +.macro SYSCALL_PROLOG Label EndLabel /* Create a trap frame */ push 0 push ebp @@ -671,7 +679,7 @@ jnz Dr_&Label
/* Set the trap frame debug header */ -3: +Dr_&EndLabel: SET_TF_DEBUG_HEADER
/* Enable interrupts */ @@ -690,7 +698,7 @@ // // @remark None. // -.macro FASTCALL_PROLOG Label +.macro FASTCALL_PROLOG Label EndLabel /* Set FS to PCR */ mov ecx, KGDT_R0_PCR mov fs, cx @@ -769,7 +777,7 @@ jnz Dr_&Label
/* Set the trap frame debug header */ -3: +Dr_&EndLabel: SET_TF_DEBUG_HEADER
/* Enable interrupts */ @@ -791,7 +799,7 @@ // // @remark None. // -.macro V86_TRAP_PROLOG Label +.macro V86_TRAP_PROLOG Label EndLabel
/* Skip everything to the error code */ sub esp, KTRAP_FRAME_ERROR_CODE @@ -838,7 +846,9 @@ mov eax, dr7 test eax, ~DR7_RESERVED_MASK mov [esp+KTRAP_FRAME_DR7], eax - // jnz Dr_&Label + jnz Dr_&Label + +Dr_&EndLabel: .endm
// @@ -869,9 +879,10 @@
/* Check if DR registers should be restored */ test dword ptr [ebp+KTRAP_FRAME_DR7], ~DR7_RESERVED_MASK - //jnz V86DebugRestore + jnz V86DebugRestore
/* Finish popping the rest of the frame, and return to P-mode */ +V86DebugContinue: add esp, 12 pop edi pop esi @@ -879,6 +890,33 @@ pop ebp add esp, 4 iretd + +V86DebugRestore: + + /* Get DR0, 1 */ + xor ebx, ebx + mov esi, [ebp+KTRAP_FRAME_DR0] + mov edi, [ebp+KTRAP_FRAME_DR1] + + /* Clear DR 7 */ + mov dr7, ebx + + /* Get DR2 and load DR0-2 */ + mov ebx, [ebp+KTRAP_FRAME_DR2] + mov dr0, esi + mov dr1, edi + mov dr2, ebx + + /* Get DR3-7 */ + mov esi, [ebp+KTRAP_FRAME_DR0] + mov edi, [ebp+KTRAP_FRAME_DR1] + mov ebx, [ebp+KTRAP_FRAME_DR7] + + /* Load them */ + mov dr3, esi + mov dr6, edi + mov dr7, ebx + jmp V86DebugContinue
PendingUserApc:
@@ -1006,7 +1044,7 @@
/* Check for debug registers */ test dword ptr [esp+KTRAP_FRAME_DR7], ~DR7_RESERVED_MASK - //jnz 2f + jnz 2f
/* Check for V86 */ 4:
Modified: trunk/reactos/ntoskrnl/ke/i386/irqobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irqobj.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irqobj.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irqobj.c Mon Mar 19 08:56:27 2007 @@ -19,6 +19,7 @@
ULONG KiISRTimeout = 55; USHORT KiISROverflow = 30000; +extern ULONG KiChainedDispatch2ndLvl;
/* PRIVATE FUNCTIONS *********************************************************/
@@ -188,11 +189,7 @@ }
/* Sanity check */ - DPRINT1("Template Size: %lx. Code Size: %lx\n", - (ULONG_PTR)&KiInterruptTemplateDispatch - - (ULONG_PTR)KiInterruptTemplate, - KINTERRUPT_DISPATCH_CODES * 4); - ASSERT((ULONG_PTR)&KiInterruptTemplateDispatch - + ASSERT((ULONG_PTR)&KiChainedDispatch2ndLvl - (ULONG_PTR)KiInterruptTemplate <= (KINTERRUPT_DISPATCH_CODES * 4));
/* Jump to the last 4 bytes */
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?rev... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Mon Mar 19 08:56:27 2007 @@ -136,22 +136,22 @@ UNHANDLED_PATH
.func KiSystemService -Dr_kss: DR_TRAP_FIXUP +TRAP_FIXUPS kss_a, kss_t, DoNotFixupV86, DoNotFixupAbios _KiSystemService:
/* Enter the shared system call prolog */ - SYSCALL_PROLOG kss + SYSCALL_PROLOG kss_a, kss_t
/* Jump to the actual handler */ jmp SharedCode .endfunc
.func KiFastCallEntry -Dr_FastCallDrSave: DR_TRAP_FIXUP +TRAP_FIXUPS FastCallDrSave, FastCallDrReturn, DoNotFixupV86, DoNotFixupAbios _KiFastCallEntry:
/* Enter the fast system call prolog */ - FASTCALL_PROLOG FastCallDrSave + FASTCALL_PROLOG FastCallDrSave, FastCallDrReturn
SharedCode:
@@ -461,15 +461,14 @@ UNHANDLED_PATH
.func KiDebugService -Dr_kids: DR_TRAP_FIXUP -V86_kids: V86_TRAP_FIXUP +TRAP_FIXUPS kids_a, kids_t, DoFixupV86, DoFixupAbios _KiDebugService:
/* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kids + TRAP_PROLOG kids_a, kids_t
/* Increase EIP so we skip the INT3 */ inc dword ptr [ebp+KTRAP_FRAME_EIP] @@ -672,14 +671,13 @@ .endfunc
.func KiTrap0 -Dr_kit0: DR_TRAP_FIXUP -V86_kit0: V86_TRAP_FIXUP +TRAP_FIXUPS kit0_a, kit0_t, DoFixupV86, DoNotFixupAbios _KiTrap0: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit0 + TRAP_PROLOG kit0_a, kit0_t
/* Check for V86 */ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK @@ -714,14 +712,13 @@ .endfunc
.func KiTrap1 -Dr_kit1: DR_TRAP_FIXUP -V86_kit1: V86_TRAP_FIXUP +TRAP_FIXUPS kit1_a, kit1_t, DoFixupV86, DoNotFixupAbios _KiTrap1: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit1 + TRAP_PROLOG kit1_a, kit1_t
/* Check for V86 */ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK @@ -767,14 +764,13 @@ .endfunc
.func KiTrap3 -Dr_kit3: DR_TRAP_FIXUP -V86_kit3: V86_TRAP_FIXUP +TRAP_FIXUPS kit3_a, kit3_t, DoFixupV86, DoNotFixupAbios _KiTrap3: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit3 + TRAP_PROLOG kit3_a, kit3_t
/* Set status code */ mov eax, 0 //STATUS_SUCCESS @@ -822,14 +818,13 @@ .endfunc
.func KiTrap4 -Dr_kit4: DR_TRAP_FIXUP -V86_kit4: V86_TRAP_FIXUP +TRAP_FIXUPS kit4_a, kit4_t, DoFixupV86, DoNotFixupAbios _KiTrap4: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit4 + TRAP_PROLOG kit4_a, kit4_t
/* Check for V86 */ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK @@ -864,14 +859,13 @@ .endfunc
.func KiTrap5 -Dr_kit5: DR_TRAP_FIXUP -V86_kit5: V86_TRAP_FIXUP +TRAP_FIXUPS kit5_a, kit5_t, DoFixupV86, DoNotFixupAbios _KiTrap5: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit5 + TRAP_PROLOG kit5_a, kit5_t
/* Check for V86 */ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK @@ -910,8 +904,7 @@ .endfunc
.func KiTrap6 -Dr_kit6: DR_TRAP_FIXUP -V86_kit6: V86_TRAP_FIXUP +TRAP_FIXUPS kit6_a, kit6_t, DoFixupV86, DoNotFixupAbios _KiTrap6:
/* It this a V86 GPF? */ @@ -919,7 +912,7 @@ jz NotV86UD
/* Enter V86 Trap */ - V86_TRAP_PROLOG kit6 + V86_TRAP_PROLOG kit6_a, kit6_v
/* Not yet supported (Invalid OPCODE from V86) */ UNHANDLED_PATH @@ -929,7 +922,7 @@ push 0
/* Enter trap */ - TRAP_PROLOG kit6 + TRAP_PROLOG kit6_a, kit6_t
/* Check if this happened in kernel mode */ test byte ptr [ebp+KTRAP_FRAME_CS], MODE_MASK @@ -1025,14 +1018,13 @@ .endfunc
.func KiTrap7 -Dr_kit7: DR_TRAP_FIXUP -V86_kit7: V86_TRAP_FIXUP +TRAP_FIXUPS kit7_a, kit7_t, DoFixupV86, DoNotFixupAbios _KiTrap7: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit7 + TRAP_PROLOG kit7_a, kit7_t
/* Get the current thread and stack */ StartTrapHandle: @@ -1345,14 +1337,13 @@ .endfunc
.func KiTrap9 -Dr_kit9: DR_TRAP_FIXUP -V86_kit9: V86_TRAP_FIXUP +TRAP_FIXUPS kit9_a, kit9_t, DoFixupV86, DoNotFixupAbios _KiTrap9: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit9 + TRAP_PROLOG kit9_a, kit9_t
/* Enable interrupts and bugcheck */ sti @@ -1361,11 +1352,10 @@ .endfunc
.func KiTrap10 -Dr_kit10: DR_TRAP_FIXUP -V86_kit10: V86_TRAP_FIXUP +TRAP_FIXUPS kita_a, kita_t, DoFixupV86, DoNotFixupAbios _KiTrap10: /* Enter trap */ - TRAP_PROLOG kit10 + TRAP_PROLOG kita_a, kita_t
/* Check for V86 */ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK @@ -1392,11 +1382,10 @@ .endfunc
.func KiTrap11 -Dr_kit11: DR_TRAP_FIXUP -V86_kit11: V86_TRAP_FIXUP +TRAP_FIXUPS kitb_a, kitb_t, DoFixupV86, DoNotFixupAbios _KiTrap11: /* Enter trap */ - TRAP_PROLOG kit11 + TRAP_PROLOG kitb_a, kitb_t
/* FIXME: ROS Doesn't handle segment faults yet */ mov eax, 11 @@ -1404,11 +1393,10 @@ .endfunc
.func KiTrap12 -Dr_kit12: DR_TRAP_FIXUP -V86_kit12: V86_TRAP_FIXUP +TRAP_FIXUPS kitc_a, kitc_t, DoFixupV86, DoNotFixupAbios _KiTrap12: /* Enter trap */ - TRAP_PROLOG kit12 + TRAP_PROLOG kitc_a, kitc_t
/* FIXME: ROS Doesn't handle stack faults yet */ mov eax, 12 @@ -1439,8 +1427,7 @@ .endfunc
.func KiTrap13 -Dr_kitd: DR_TRAP_FIXUP -V86_kitd: V86_TRAP_FIXUP +TRAP_FIXUPS kitd_a, kitd_t, DoFixupV86, DoNotFixupAbios _KiTrap13:
/* It this a V86 GPF? */ @@ -1448,7 +1435,7 @@ jz NotV86
/* Enter V86 Trap */ - V86_TRAP_PROLOG kitd + V86_TRAP_PROLOG kitd_a, kitd_v
/* Make sure that this is a V86 process */ mov ecx, PCR[KPCR_CURRENT_THREAD] @@ -1504,7 +1491,7 @@
NotV86: /* Enter trap */ - TRAP_PROLOG kitd + TRAP_PROLOG kitd_a, kitd_t
/* Check if this was from kernel-mode */ test dword ptr [ebp+KTRAP_FRAME_CS], MODE_MASK @@ -1822,12 +1809,11 @@ .endfunc
.func KiTrap14 -Dr_kit14: DR_TRAP_FIXUP -V86_kit14: V86_TRAP_FIXUP +TRAP_FIXUPS kite_a, kite_t, DoFixupV86, DoNotFixupAbios _KiTrap14:
/* Enter trap */ - TRAP_PROLOG kit14 + TRAP_PROLOG kite_a, kite_t
/* Check if we have a VDM alert */ cmp dword ptr PCR[KPCR_VDM_ALERT], 0 @@ -1986,14 +1972,13 @@ .endfunc
.func KiTrap0F -Dr_kit15: DR_TRAP_FIXUP -V86_kit15: V86_TRAP_FIXUP +TRAP_FIXUPS kitf_a, kitf_t, DoFixupV86, DoNotFixupAbios _KiTrap0F: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit15 + TRAP_PROLOG kitf_a, kitf_t sti
/* Raise a fatal exception */ @@ -2002,14 +1987,13 @@ .endfunc
.func KiTrap16 -Dr_kit16: DR_TRAP_FIXUP -V86_kit16: V86_TRAP_FIXUP +TRAP_FIXUPS kit10_a, kit10_t, DoFixupV86, DoNotFixupAbios _KiTrap16: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit16 + TRAP_PROLOG kit10_a, kit10_t
/* Check if this is the NPX Thread */ mov eax, PCR[KPCR_CURRENT_THREAD] @@ -2029,14 +2013,13 @@ .endfunc
.func KiTrap17 -Dr_kit17: DR_TRAP_FIXUP -V86_kit17: V86_TRAP_FIXUP +TRAP_FIXUPS kit11_a, kit11_t, DoFixupV86, DoNotFixupAbios _KiTrap17: /* Push error code */ push 0
/* Enter trap */ - TRAP_PROLOG kit17 + TRAP_PROLOG kit11_a, kit11_t
/* FIXME: ROS Doesn't handle alignment faults yet */ mov eax, 17 @@ -2110,12 +2093,11 @@ jmp _KiUnexpectedInterruptTail
.func KiUnexpectedInterruptTail -V86_kui: V86_TRAP_FIXUP -Dr_kui: DR_TRAP_FIXUP +TRAP_FIXUPS kui_a, kui_t, DoFixupV86, DoFixupAbios _KiUnexpectedInterruptTail:
/* Enter interrupt trap */ - INT_PROLOG kui, DoNotPushFakeErrorCode + INT_PROLOG kui_a, kui_t, DoNotPushFakeErrorCode
/* Increase interrupt count */ inc dword ptr PCR[KPCR_PRCB_INTERRUPT_COUNT] @@ -2257,13 +2239,10 @@ .endfunc
.func KiInterruptTemplate -V86_kit: V86_TRAP_FIXUP -Dr_kit: DR_TRAP_FIXUP _KiInterruptTemplate:
/* Enter interrupt trap */ - INT_PROLOG kit, DoPushFakeErrorCode -.endfunc + INT_PROLOG kit_a, kit_t, DoPushFakeErrorCode
_KiInterruptTemplate2ndDispatch: /* Dummy code, will be replaced by the address of the KINTERRUPT */ @@ -2275,6 +2254,9 @@
_KiInterruptTemplateDispatch: /* Marks the end of the template so that the jump above can be edited */ + +TRAP_FIXUPS kit_a, kit_t, DoFixupV86, DoFixupAbios +.endfunc
.func KiChainedDispatch2ndLvl@0 _KiChainedDispatch2ndLvl@0: