Author: sir_richard
Date: Tue Jan 19 09:41:03 2010
New Revision: 45145
URL:
http://svn.reactos.org/svn/reactos?rev=45145&view=rev
Log:
[NTOS]: We don't actually need wrappers for NtContinue/NtRaiseException. These are now
fully portable C code, so move them appropriately.
Modified:
trunk/reactos/ntoskrnl/include/internal/ke.h
trunk/reactos/ntoskrnl/ke/except.c
trunk/reactos/ntoskrnl/ke/i386/trap.s
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Tue Jan 19 09:41:03 2010
@@ -952,6 +952,12 @@
VOID
FASTCALL
+KiServiceExit(
+ IN PKTRAP_FRAME TrapFrame
+);
+
+VOID
+FASTCALL
KiServiceExit2(
IN PKTRAP_FRAME TrapFrame
);
Modified: trunk/reactos/ntoskrnl/ke/except.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/except.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/except.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/except.c [iso-8859-1] Tue Jan 19 09:41:03 2010
@@ -1,9 +1,10 @@
/*
* PROJECT: ReactOS Kernel
- * LICENSE: GPL - See COPYING in the top level directory
+ * LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: ntoskrnl/ke/except.c
* PURPOSE: Platform independent exception handling
- * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ * PROGRAMMERS: ReactOS Portable Systems Group
+ * Alex Ionescu (alex.ionescu(a)reactos.org)
*/
/* INCLUDES ******************************************************************/
@@ -164,4 +165,79 @@
return STATUS_SUCCESS;
}
+/* SYSTEM CALLS ***************************************************************/
+
+NTSTATUS
+NTAPI
+NtRaiseException(IN PEXCEPTION_RECORD ExceptionRecord,
+ IN PCONTEXT Context,
+ IN BOOLEAN FirstChance)
+{
+ NTSTATUS Status;
+ PKTHREAD Thread;
+ PKTRAP_FRAME TrapFrame;
+
+ /* Get trap frame and link previous one*/
+ Thread = KeGetCurrentThread();
+ TrapFrame = Thread->TrapFrame;
+ Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
+
+ /* Set exception list */
+ KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList;
+
+ /* Raise the exception */
+ Status = KiRaiseException(ExceptionRecord,
+ Context,
+ NULL,
+ TrapFrame,
+ FirstChance);
+ if (NT_SUCCESS(Status))
+ {
+ /* It was handled, so exit restoring all state */
+ KiServiceExit2(TrapFrame);
+ }
+ else
+ {
+ /* Exit with error */
+ KiServiceExit(TrapFrame, Status);
+ }
+
+ /* We don't actually make it here */
+ return Status;
+}
+
+NTSTATUS
+NTAPI
+NtContinue(IN PCONTEXT Context,
+ IN BOOLEAN TestAlert)
+{
+ PKTHREAD Thread;
+ NTSTATUS Status;
+ PKTRAP_FRAME TrapFrame;
+
+ /* Get trap frame and link previous one*/
+ Thread = KeGetCurrentThread();
+ TrapFrame = Thread->TrapFrame;
+ Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
+
+ /* Continue from this point on */
+ Status = KiContinue(Context, NULL, TrapFrame);
+ if (NT_SUCCESS(Status))
+ {
+ /* Check if alert was requested */
+ if (TestAlert) KeTestAlertThread(Thread->PreviousMode);
+
+ /* Exit to new trap frame */
+ KiServiceExit2(TrapFrame);
+ }
+ else
+ {
+ /* Exit with an error */
+ KiServiceExit(TrapFrame, Status);
+ }
+
+ /* We don't actually make it here */
+ return Status;
+}
+
/* EOF */
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Tue Jan 19 09:41:03 2010
@@ -393,23 +393,6 @@
GENERATE_TRAP_HANDLER KiRaiseAssertion, 1
GENERATE_TRAP_HANDLER KiDebugService, 1
-.func NtRaiseException@12
-_NtRaiseException@12:
- /* Call C code */
- mov ecx, [esp+4]
- mov edx, [esp+8]
- or edx, [esp+12]
- jmp @NtRaiseExceptionHandler@8
-.endfunc
-
-.func NtContinue@8
-_NtContinue@8:
- /* Call C code */
- mov ecx, [esp+4]
- mov edx, [esp+8]
- jmp @NtContinueHandler@8
-.endfunc
-
/* HARDWARE TRAP HANDLERS ****************************************************/
GENERATE_TRAP_HANDLER KiTrap00
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Tue Jan 19 09:41:03 2010
@@ -1691,77 +1691,6 @@
KiDebugHandler(TrapFrame, TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx);
}
-VOID
-FASTCALL
-NtRaiseExceptionHandler(IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT Context)
-{
- BOOLEAN FirstChance;
- NTSTATUS Status;
- PKTHREAD Thread;
- PKTRAP_FRAME TrapFrame;
-
- /* Fixup parameters */
- FirstChance = (ULONG_PTR)Context & 1;
- Context = (PVOID)((ULONG_PTR)Context & ~1);
-
- /* Get trap frame and link previous one*/
- Thread = KeGetCurrentThread();
- TrapFrame = Thread->TrapFrame;
- Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
-
- /* Set exception list */
- KeGetPcr()->Tib.ExceptionList = TrapFrame->ExceptionList;
-
- /* Raise the exception */
- Status = KiRaiseException(ExceptionRecord,
- Context,
- NULL,
- TrapFrame,
- FirstChance);
- if (NT_SUCCESS(Status))
- {
- /* It was handled, so exit restoring all state */
- KiServiceExit2(TrapFrame);
- }
- else
- {
- /* Exit with error */
- KiServiceExit(TrapFrame, Status);
- }
-}
-
-VOID
-FASTCALL
-NtContinueHandler(IN PCONTEXT Context,
- IN BOOLEAN TestAlert)
-{
- PKTHREAD Thread;
- NTSTATUS Status;
- PKTRAP_FRAME TrapFrame;
-
- /* Get trap frame and link previous one*/
- Thread = KeGetCurrentThread();
- TrapFrame = Thread->TrapFrame;
- Thread->TrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
-
- /* Continue from this point on */
- Status = KiContinue(Context, NULL, TrapFrame);
- if (NT_SUCCESS(Status))
- {
- /* Check if alert was requested */
- if (TestAlert) KeTestAlertThread(Thread->PreviousMode);
-
- /* Exit to new trap frame */
- KiServiceExit2(TrapFrame);
- }
- else
- {
- /* Exit with an error */
- KiServiceExit(TrapFrame, Status);
- }
-}
-
/* HARDWARE INTERRUPTS ********************************************************/
/*