Stop using ATTRIB_NORETURN in hal and kernel, replace with the UNREACHABLE macro...
authorStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 13 Sep 2015 20:37:28 +0000 (20:37 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 13 Sep 2015 20:37:28 +0000 (20:37 +0000)
svn path=/trunk/; revision=69220

reactos/hal/halx86/include/halp.h
reactos/hal/halx86/up/pic.c
reactos/ntoskrnl/include/internal/i386/trap_x.h
reactos/ntoskrnl/ke/i386/traphdlr.c

index 6f619a3..3f41f78 100644 (file)
@@ -48,7 +48,6 @@ VOID
 
 typedef
 VOID
-ATTRIB_NORETURN
 (FASTCALL *PHAL_SW_INTERRUPT_HANDLER_2ND_ENTRY)(
     IN PKTRAP_FRAME TrapFrame
 );
index ba5e7d0..93a811e 100644 (file)
@@ -776,6 +776,7 @@ HalpEndSoftwareInterrupt(IN KIRQL OldIrql,
         {
             /* No need to loop checking for hardware interrupts */
             SWInterruptHandlerTable2[PendingIrql](TrapFrame);
+            UNREACHABLE;
         }
     }
 }
@@ -1241,6 +1242,7 @@ HalEndSystemInterrupt(IN KIRQL OldIrql,
             {
                 /* Now handle pending software interrupt */
                 SWInterruptHandlerTable2[PendingIrql](TrapFrame);
+                UNREACHABLE;
             }
         }
     }
@@ -1249,8 +1251,8 @@ HalEndSystemInterrupt(IN KIRQL OldIrql,
 /* SOFTWARE INTERRUPT TRAPS ***************************************************/
 
 FORCEINLINE
-VOID
 DECLSPEC_NORETURN
+VOID
 _HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
 {
     KIRQL CurrentIrql;
@@ -1278,8 +1280,8 @@ _HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
     KiEoiHelper(TrapFrame);
 }
 
-VOID
 DECLSPEC_NORETURN
+VOID
 FASTCALL
 HalpApcInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
 {
@@ -1287,8 +1289,8 @@ HalpApcInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
     _HalpApcInterruptHandler(TrapFrame);
 }
 
-VOID
 DECLSPEC_NORETURN
+VOID
 FASTCALL
 HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
 {
@@ -1327,8 +1329,8 @@ _HalpDispatchInterruptHandler(VOID)
     return CurrentIrql;
 }
 
-VOID
 DECLSPEC_NORETURN
+VOID
 FASTCALL
 HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
 {
index 444696f..08acc3f 100644 (file)
@@ -8,10 +8,13 @@
 
 #pragma once
 
-#define UNREACHABLE __assume(0)
-
-#if _MSC_VER
-#define __builtin_expect(a,b) (a)
+#if defined(_MSC_VER)
+#define UNREACHABLE   __assume(0)
+#define               __builtin_expect(a,b) (a)
+#elif defined(__GNUC__)
+#define UNREACHABLE   __builtin_unreachable()
+#else
+#error
 #endif
 
 //
@@ -235,7 +238,6 @@ DECLSPEC_NORETURN VOID FASTCALL KiTrapReturnNoSegments(IN PKTRAP_FRAME TrapFrame
 DECLSPEC_NORETURN VOID FASTCALL KiTrapReturnNoSegmentsRet8(IN PKTRAP_FRAME TrapFrame);
 
 typedef
-ATTRIB_NORETURN
 VOID
 (FASTCALL *PFAST_SYSTEM_CALL_EXIT)(
     IN PKTRAP_FRAME TrapFrame
index b1f7cf3..7fb392e 100644 (file)
@@ -173,6 +173,7 @@ KiServiceExit(IN PKTRAP_FRAME TrapFrame,
         {
             /* We can use the sysexit handler */
             KiFastCallExitHandler(TrapFrame);
+            UNREACHABLE;
         }
     }