Author: tkreuzer
Date: Fri Sep 16 18:39:55 2011
New Revision: 53724
URL:
http://svn.reactos.org/svn/reactos?rev=53724&view=rev
Log:
[NTOSKRNL/AMD64]
- Implement KiApcInterrupt, KiDpcInterrupt and KiIpiInterrupt stubs
- Improve and cleanup stubs.c
Modified:
trunk/reactos/ntoskrnl/ke/amd64/stubs.c
trunk/reactos/ntoskrnl/ke/amd64/trap.S
Modified: trunk/reactos/ntoskrnl/ke/amd64/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/stubs.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/amd64/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/amd64/stubs.c [iso-8859-1] Fri Sep 16 18:39:55 2011
@@ -11,6 +11,14 @@
#define NDEBUG
#include <debug.h>
+
+VOID
+NTAPI
+KiDispatchInterrupt(VOID)
+{
+ UNIMPLEMENTED;
+ __debugbreak();
+}
VOID
FASTCALL
@@ -28,6 +36,7 @@
IN NTSTATUS Status)
{
UNIMPLEMENTED;
+ __debugbreak();
}
VOID
@@ -36,6 +45,7 @@
KiServiceExit2(IN PKTRAP_FRAME TrapFrame)
{
UNIMPLEMENTED;
+ __debugbreak();
}
BOOLEAN
@@ -43,6 +53,7 @@
KeConnectInterrupt(IN PKINTERRUPT Interrupt)
{
UNIMPLEMENTED;
+ __debugbreak();
return FALSE;
}
@@ -62,6 +73,7 @@
IN PVOID SynchronizeContext)
{
UNIMPLEMENTED;
+ __debugbreak();
return FALSE;
}
@@ -74,6 +86,7 @@
OUT PULONG ResultLength)
{
UNIMPLEMENTED;
+ __debugbreak();
return STATUS_UNSUCCESSFUL;
}
@@ -94,6 +107,7 @@
IN PVOID SystemArgument2)
{
UNIMPLEMENTED;
+ __debugbreak();
}
VOID
@@ -102,6 +116,7 @@
IN PKPROCESS OldProcess)
{
UNIMPLEMENTED;
+ __debugbreak();
}
VOID
@@ -110,6 +125,7 @@
IN ULONG Instruction)
{
UNIMPLEMENTED;
+ __debugbreak();
}
NTSYSAPI
@@ -119,6 +135,7 @@
( IN PVOID Result OPTIONAL, IN ULONG ResultLength, IN NTSTATUS Status )
{
UNIMPLEMENTED;
+ __debugbreak();
return STATUS_UNSUCCESSFUL;
}
@@ -137,6 +154,7 @@
IN PVOID ControlData)
{
UNIMPLEMENTED;
+ __debugbreak();
return STATUS_UNSUCCESSFUL;
}
@@ -147,6 +165,7 @@
IN PULONG OutputLength)
{
UNIMPLEMENTED;
+ __debugbreak();
return STATUS_UNSUCCESSFUL;
}
@@ -160,29 +179,6 @@
ULONG ProcessCount;
-
-#ifdef _MSC_VER
-void
-__GSHandlerCheck()
-{
-}
-
-int __security_cookie;
-
-void
-__security_check_cookie()
-{
-}
-
BOOLEAN CcPfEnablePrefetcher;
-unsigned long __readfsdword(const unsigned long Offset)
-{
- return 0;
-}
-void main()
-{
-}
-
-#endif
Modified: trunk/reactos/ntoskrnl/ke/amd64/trap.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/trap.S?r…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Fri Sep 16 18:39:55 2011
@@ -19,6 +19,8 @@
EXTERN KiNpxNotAvailableFaultHandler:PROC
EXTERN KiGeneralProtectionFaultHandler:PROC
EXTERN KiXmmExceptionHandler:PROC
+EXTERN KiDeliverApc:PROC
+EXTERN KiDispatchInterrupt:PROC
/* GLOBALS *******************************************************************/
@@ -524,9 +526,76 @@
ExitTrap TF_SAVE_ALL
.ENDP KiDebugServiceTrap
-TRAP_ENTRY KiApcInterrupt, (TF_HAS_ERROR_CODE OR TF_SAVE_ALL)
-TRAP_ENTRY KiDpcInterrupt, (TF_HAS_ERROR_CODE OR TF_SAVE_ALL)
-TRAP_ENTRY KiIpiInterrupt, (TF_HAS_ERROR_CODE OR TF_SAVE_ALL)
+
+PUBLIC KiApcInterrupt
+.PROC KiApcInterrupt
+ /* No error code */
+ EnterTrap (TF_VOLATILES or TF_IRQL)
+
+ /* Raise to APC_LEVEL */
+ mov rax, APC_LEVEL
+ mov cr8, rax
+
+ /* End the interrupt */
+ mov dword ptr [APIC_EOI], 0
+
+ /* Enable interrupts */
+ sti
+
+ /* Call the worker routine */
+ mov cl, [rbp + KTRAP_FRAME_SegCs] // ProcessorMode
+ and cl, 1
+ mov rdx, 0 // ExceptionFrame
+ mov r8, rdx // TrapFrame
+ call KiDeliverApc
+
+ /* Disable interrupts */
+ cli
+
+ /* Return */
+ ExitTrap (TF_VOLATILES or TF_IRQL)
+.ENDP KiApcInterrupt
+
+
+PUBLIC KiDpcInterrupt
+.PROC KiDpcInterrupt
+ /* No error code */
+ EnterTrap (TF_VOLATILES or TF_IRQL)
+
+ /* Raise to DISPATCH_LEVEL */
+ mov rax, DISPATCH_LEVEL
+ mov cr8, rax
+
+ /* End the interrupt */
+ mov dword ptr [APIC_EOI], 0
+
+ /* Call the worker routine */
+ sti
+ call KiDispatchInterrupt
+ cli
+
+ /* Return */
+ ExitTrap (TF_VOLATILES or TF_IRQL)
+.ENDP KiDpcInterrupt
+
+
+PUBLIC KiIpiInterrupt
+.PROC KiIpiInterrupt
+ /* No error code */
+ EnterTrap (TF_VOLATILES or TF_IRQL)
+
+ /* Raise to IPI_LEVEL */
+ mov rax, IPI_LEVEL
+ mov cr8, rax
+
+ /* End the interrupt */
+ mov dword ptr [APIC_EOI], 0
+
+ int 3
+
+ /* Return */
+ ExitTrap (TF_VOLATILES or TF_IRQL)
+.ENDP KiIpiInterrupt
PUBLIC KiUnexpectedInterrupt