[NTOSKRNL/AMD64]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 16 Sep 2011 09:46:08 +0000 (09:46 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Fri, 16 Sep 2011 09:46:08 +0000 (09:46 +0000)
- Fix KiGeneralProtectionFault
- Don't bugcheck in KiUnexpectedInterrupt
- Remove debugprint in KiEndInterrupt, and instead assert, its called from the clock interrupt, since thats the only instance we handle right now

svn path=/trunk/; revision=53720

reactos/ntoskrnl/include/internal/amd64/ke.h
reactos/ntoskrnl/ke/amd64/krnlinit.c
reactos/ntoskrnl/ke/amd64/trap.S

index 4425f4b..8e473e9 100644 (file)
@@ -238,7 +238,8 @@ FORCEINLINE
 KiEndInterrupt(IN KIRQL Irql,
                IN PKTRAP_FRAME TrapFrame)
 {
-    DbgPrint("KiEndInterrupt is unimplemented\n");
+    /* Make sure this is from the clock handler */
+    ASSERT(TrapFrame->ErrorCode == 0xc10c4);
 }
 
 BOOLEAN
index 7946871..4d7ae9c 100644 (file)
@@ -80,6 +80,9 @@ KiSystemStartupBootStack(VOID)
     /* Initialize PRCB pool lookaside pointers */
     ExInitPoolLookasidePointers();
 
+    /* Lower to APC_LEVEL */
+    KeLowerIrql(APC_LEVEL);
+
     /* Check if this is the boot cpu */
     if (Prcb->Number == 0)
     {
@@ -153,9 +156,6 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
     /* Set the current MP Master KPRCB to the Boot PRCB */
     Prcb->MultiThreadSetMaster = Prcb;
 
-    /* Lower to APC_LEVEL */
-    KeLowerIrql(APC_LEVEL);
-
     /* Initialize Bugcheck Callback data */
     InitializeListHead(&KeBugcheckCallbackListHead);
     InitializeListHead(&KeBugcheckReasonCallbackListHead);
index 4c41a87..f690615 100644 (file)
@@ -637,12 +637,13 @@ PUBLIC KiGeneralProtectionFault
     /* We have an error code */
     ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
 
-    TRAPINFO KiGeneralProtectionFault
-    mov rdx, [rbp + KTRAP_FRAME_Rip]
-    lea rcx, MsgGeneralProtFault[rip]
-    call qword ptr FrLdrDbgPrint[rip]
+    //TRAPINFO KiGeneralProtectionFault
+    //mov rdx, [rbp + KTRAP_FRAME_Rip]
+    //lea rcx, MsgGeneralProtFault[rip]
+    //call qword ptr FrLdrDbgPrint[rip]
 
     /* Call the C handler */
+    mov rcx, rbp
     call KiGeneralProtectionFaultHandler
 
     /* Check for success */
@@ -890,9 +891,9 @@ PUBLIC KiIpiInterrupt
 PUBLIC KiUnexpectedInterrupt
 .PROC KiUnexpectedInterrupt
     /* The error code is the vector */
-    cli
     ENTER_TRAP_FRAME (TRAPFLAG_HAS_ERRORCODE OR TRAPFLAG_ALL)
 
+#if 0
     /* Set bugcheck parameters */
     mov ecx, TRAP_CAUSE_UNKNOWN
     mov rdx, [rbp + KTRAP_FRAME_ErrorCode] // the vector
@@ -901,8 +902,10 @@ PUBLIC KiUnexpectedInterrupt
     sub rsp, 8
     mov [rbp + KTRAP_FRAME_P5 + 8], rbp // trap frame
     call KeBugCheckWithTf
-
     jmp $
+#endif
+    LEAVE_TRAP_FRAME;
+    iretq
 .ENDP KiUnexpectedInterrupt
 
 #ifdef _MSC_VER