[ros-diffs] [dgorbachev] 45232: - Use __builtin_trap for old GCC, too. - KiEoiHelper, KiDispatchExceptionFromTrapFrame: mark noreturn. - Return DECLSPEC_NORETURNs.

dgorbachev at svn.reactos.org dgorbachev at svn.reactos.org
Sun Jan 24 16:18:51 CET 2010


Author: dgorbachev
Date: Sun Jan 24 16:18:50 2010
New Revision: 45232

URL: http://svn.reactos.org/svn/reactos?rev=45232&view=rev
Log:
- Use __builtin_trap for old GCC, too.
- KiEoiHelper, KiDispatchExceptionFromTrapFrame: mark noreturn.
- Return DECLSPEC_NORETURNs.

Modified:
    trunk/reactos/ntoskrnl/include/internal/i386/ke.h
    trunk/reactos/ntoskrnl/include/internal/ke.h
    trunk/reactos/ntoskrnl/include/internal/trap_x.h
    trunk/reactos/ntoskrnl/ke/i386/exp.c
    trunk/reactos/ntoskrnl/ke/i386/traphdlr.c

Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/i386/ke.h?rev=45232&r1=45231&r2=45232&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h [iso-8859-1] Sun Jan 24 16:18:50 2010
@@ -397,6 +397,7 @@
 
 VOID
 FASTCALL
+DECLSPEC_NORETURN
 KiEoiHelper(
     IN PKTRAP_FRAME TrapFrame
 );
@@ -415,6 +416,7 @@
 
 VOID
 NTAPI
+DECLSPEC_NORETURN
 KiDispatchExceptionFromTrapFrame(
     IN NTSTATUS Code,
     IN ULONG_PTR Address,
@@ -548,7 +550,7 @@
 //
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDispatchException0Args(IN NTSTATUS Code,
                          IN ULONG_PTR Address,
                          IN PKTRAP_FRAME TrapFrame)
@@ -562,7 +564,7 @@
 //
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDispatchException1Args(IN NTSTATUS Code,
                          IN ULONG_PTR Address,
                          IN ULONG P1,
@@ -577,7 +579,7 @@
 //
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDispatchException2Args(IN NTSTATUS Code,
                          IN ULONG_PTR Address,
                          IN ULONG P1,

Modified: trunk/reactos/ntoskrnl/include/internal/ke.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/ke.h?rev=45232&r1=45231&r2=45232&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/ke.h [iso-8859-1] Sun Jan 24 16:18:50 2010
@@ -1114,7 +1114,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 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/trap_x.h?rev=45232&r1=45231&r2=45232&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/trap_x.h [iso-8859-1] Sun Jan 24 16:18:50 2010
@@ -9,12 +9,14 @@
 #define _TRAP_X_
 
 //
-// Unreachable code hint for GCC 4.5.x, 4.4.x, and MSVC
-//
+// Unreachable code hint for GCC 4.5.x, older GCC versions, and MSVC
+//
+#ifdef __GNUC__
 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
 #define UNREACHABLE __builtin_unreachable()
-#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 404
+#else
 #define UNREACHABLE __builtin_trap()
+#endif
 #elif _MSC_VER
 #define UNREACHABLE __assume(0)
 #else
@@ -188,7 +190,7 @@
 //
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemCallReturn(IN PKTRAP_FRAME TrapFrame)
 {
     /* Restore nonvolatiles, EAX, and do a "jump" back to the kernel caller */
@@ -219,7 +221,7 @@
 
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemCallTrapReturn(IN PKTRAP_FRAME TrapFrame)
 {
     /* Regular interrupt exit, but we only restore EAX as a volatile */
@@ -248,7 +250,7 @@
 
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemCallSysExitReturn(IN PKTRAP_FRAME TrapFrame)
 {
     /* Restore nonvolatiles, EAX, and do a SYSEXIT back to the user caller */
@@ -281,7 +283,7 @@
 
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrapReturn(IN PKTRAP_FRAME TrapFrame)
 {
     /* Regular interrupt exit */
@@ -314,7 +316,7 @@
 
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiEditedTrapReturn(IN PKTRAP_FRAME TrapFrame)
 {
     /* Regular interrupt exit */
@@ -351,7 +353,7 @@
 //
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiExitTrap(IN PKTRAP_FRAME TrapFrame,
            IN UCHAR Skip)
 {

Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev=45232&r1=45231&r2=45232&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] Sun Jan 24 16:18:50 2010
@@ -1107,7 +1107,7 @@
 
 VOID
 NTAPI
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDispatchExceptionFromTrapFrame(IN NTSTATUS Code,
                                  IN ULONG_PTR Address,
                                  IN ULONG ParameterCount,
@@ -1146,7 +1146,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemFatalException(IN ULONG ExceptionCode,
                        IN PKTRAP_FRAME TrapFrame)
 {

Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.c?rev=45232&r1=45231&r2=45232&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sun Jan 24 16:18:50 2010
@@ -58,7 +58,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiEoiHelper(IN PKTRAP_FRAME TrapFrame)
 {
     /* Disable interrupts until we return */
@@ -73,7 +73,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiServiceExit(IN PKTRAP_FRAME TrapFrame,
               IN NTSTATUS Status)
 {
@@ -92,7 +92,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiServiceExit2(IN PKTRAP_FRAME TrapFrame)
 {
     /* Disable interrupts until we return */
@@ -109,7 +109,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDebugHandler(IN PKTRAP_FRAME TrapFrame,
                IN ULONG Parameter1,
                IN ULONG Parameter2,
@@ -133,7 +133,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiNpxHandler(IN PKTRAP_FRAME TrapFrame,
              IN PKTHREAD Thread,
              IN PFX_SAVE_AREA SaveArea)
@@ -290,7 +290,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap00Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -310,7 +310,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap01Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -330,7 +330,7 @@
 }
 
 VOID
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap02(VOID)
 {
     PKTSS Tss, NmiTss;
@@ -477,7 +477,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap03Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -489,7 +489,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap04Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -509,7 +509,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap05Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -532,7 +532,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap06Handler(IN PKTRAP_FRAME TrapFrame)
 {
     PUCHAR Instruction;
@@ -578,7 +578,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap07Handler(IN PKTRAP_FRAME TrapFrame)
 {
     PKTHREAD Thread, NpxThread;
@@ -688,7 +688,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap08Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* FIXME: Not handled */
@@ -697,7 +697,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap09Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -710,7 +710,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0AHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -725,7 +725,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0BHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -738,7 +738,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0CHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -751,7 +751,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame,
                 IN ULONG EFlags)
 {
@@ -1036,7 +1036,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
 {
     PKTHREAD Thread;
@@ -1159,7 +1159,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap0FHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -1172,7 +1172,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap10Handler(IN PKTRAP_FRAME TrapFrame)
 {
     PKTHREAD Thread;
@@ -1200,7 +1200,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap11Handler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -1213,7 +1213,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiTrap13Handler(IN PKTRAP_FRAME TrapFrame)
 {
     PKTHREAD Thread;
@@ -1316,7 +1316,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiRaiseAssertionHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -1333,7 +1333,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiDebugServiceHandler(IN PKTRAP_FRAME TrapFrame)
 {
     /* Save trap frame */
@@ -1348,7 +1348,7 @@
 
 VOID
 FASTCALL
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemCall(IN ULONG SystemCallNumber,
              IN PVOID Arguments)
 {
@@ -1439,7 +1439,7 @@
 
 VOID
 FORCEINLINE
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemCallHandler(IN PKTRAP_FRAME TrapFrame,
                     IN ULONG ServiceNumber,
                     IN PVOID Arguments,
@@ -1481,7 +1481,7 @@
 
 VOID
 __attribute__((regparm(3)))
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiFastCallEntryHandler(IN ULONG ServiceNumber,
                        IN PVOID Arguments,
                        IN PKTRAP_FRAME TrapFrame)
@@ -1515,7 +1515,7 @@
 
 VOID
 __attribute__((regparm(3)))
-//DECLSPEC_NORETURN
+DECLSPEC_NORETURN
 KiSystemServiceHandler(IN ULONG ServiceNumber,
                        IN PVOID Arguments,
                        IN PKTRAP_FRAME TrapFrame)




More information about the Ros-diffs mailing list