Author: tkreuzer
Date: Thu Mar 18 17:30:54 2010
New Revision: 46264
URL:
http://svn.reactos.org/svn/reactos?rev=46264&view=rev
Log:
[NTOS]
Fix compilation with MSVC. Dedicated to Stefan.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/ke.h
trunk/reactos/ntoskrnl/include/internal/ke.h
trunk/reactos/ntoskrnl/include/internal/trap_x.h
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Thu Mar 18 17:30:54
2010
@@ -397,9 +397,9 @@
IN PKTRAP_FRAME TrapFrame
);
+DECLSPEC_NORETURN
VOID
FASTCALL
-DECLSPEC_NORETURN
KiEoiHelper(
IN PKTRAP_FRAME TrapFrame
);
@@ -416,9 +416,9 @@
IN PKTRAP_FRAME TrapFrame
);
-VOID
-NTAPI
DECLSPEC_NORETURN
+VOID
+NTAPI
KiDispatchExceptionFromTrapFrame(
IN NTSTATUS Code,
IN ULONG_PTR Address,
@@ -620,6 +620,7 @@
* later to function like this as well.
*
*/
+#ifdef __GNUC__
__asm__ __volatile__
(
"subl %1, %%esp\n"
@@ -635,7 +636,23 @@
"r"(Handler)
: "%esp", "%esi", "%edi"
);
-
+#elif defined(_MSC_VER)
+ __asm
+ {
+ mov ecx, StackBytes
+ mov edx, Arguments
+ sub esp, ecx
+ mov edi, esp
+ mov esi, edx
+ shr ecx, 2
+ rep movsd
+ call Handler
+ mov Result, eax
+ }
+#else
+#error Unknown Compiler
+#endif
+
return Result;
}
@@ -702,6 +719,7 @@
* on its merry way.
*
*/
+#ifdef __GNUC__
__asm__ __volatile__
(
"movl %%ebp, %1\n"
@@ -714,7 +732,20 @@
:
: "%esp", "%ecx", "%edx", "memory"
);
-
+#elif defined(_MSC_VER)
+ NTSTATUS NTAPI PsConvertToGuiThread(VOID);
+ __asm
+ {
+ mov StackFrame, ebp
+ sub StackFrame, esp
+ call PsConvertToGuiThread
+ add StackFrame, esp
+ mov ebp, StackFrame
+ mov Result, eax
+ }
+#else
+#error Unknown Compiler
+#endif
return Result;
}
@@ -726,7 +757,8 @@
KiSwitchToBootStack(IN ULONG_PTR InitialStack)
{
/* We have to switch to a new stack before continuing kernel initialization */
- __asm__ __volatile__
+#ifdef __GNUC__
+ __asm__
(
"movl %0, %%esp\n"
"subl %1, %%esp\n"
@@ -738,6 +770,19 @@
"i"(CR0_EM | CR0_TS | CR0_MP)
: "%esp"
);
+#elif defined(_MSC_VER)
+ VOID NTAPI KiSystemStartupBootStack(VOID);
+ __asm
+ {
+ mov ecx, InitialStack
+ mov esp, ecx
+ sub esp, (NPX_FRAME_LENGTH + KTRAP_FRAME_ALIGN + KTRAP_FRAME_LENGTH)
+ push (CR0_EM | CR0_TS | CR0_MP)
+ jmp KiSystemStartupBootStack
+ }
+#else
+#error Unknown Compiler
+#endif
}
//
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] Thu Mar 18 17:30:54 2010
@@ -1092,9 +1092,9 @@
VOID
);
-VOID
-FASTCALL
DECLSPEC_NORETURN
+VOID
+FASTCALL
KiSystemFatalException(
IN ULONG ExceptionCode,
IN PKTRAP_FRAME TrapFrame
Modified: trunk/reactos/ntoskrnl/include/internal/trap_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] Thu Mar 18 17:30:54
2010
@@ -192,17 +192,17 @@
//
// Generic Exit Routine
//
-VOID FASTCALL DECLSPEC_NORETURN KiSystemCallReturn(IN PKTRAP_FRAME TrapFrame);
-VOID FASTCALL DECLSPEC_NORETURN KiSystemCallSysExitReturn(IN PKTRAP_FRAME TrapFrame);
-VOID FASTCALL DECLSPEC_NORETURN KiSystemCallTrapReturn(IN PKTRAP_FRAME TrapFrame);
-VOID FASTCALL DECLSPEC_NORETURN KiEditedTrapReturn(IN PKTRAP_FRAME TrapFrame);
-VOID FASTCALL DECLSPEC_NORETURN KiTrapReturn(IN PKTRAP_FRAME TrapFrame);
-VOID FASTCALL DECLSPEC_NORETURN KiTrapReturnNoSegments(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiSystemCallReturn(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiSystemCallSysExitReturn(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiSystemCallTrapReturn(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiEditedTrapReturn(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiTrapReturn(IN PKTRAP_FRAME TrapFrame);
+DECLSPEC_NORETURN VOID FASTCALL KiTrapReturnNoSegments(IN PKTRAP_FRAME TrapFrame);
typedef
VOID
(FASTCALL
-*PFAST_SYSTEM_CALL_EXIT)(IN PKTRAP_FRAME TrapFrame) DECLSPEC_NORETURN;
+*PFAST_SYSTEM_CALL_EXIT)(IN PKTRAP_FRAME TrapFrame);
extern PFAST_SYSTEM_CALL_EXIT KiFastCallExitHandler;