Author: sginsberg
Date: Sun Sep 13 20:37:28 2015
New Revision: 69220
URL:
http://svn.reactos.org/svn/reactos?rev=69220&view=rev
Log:
Stop using ATTRIB_NORETURN in hal and kernel, replace with the UNREACHABLE macro that both
compilers can understand. Also fix up the UNREACHABLE def a bit.
Modified:
trunk/reactos/hal/halx86/include/halp.h
trunk/reactos/hal/halx86/up/pic.c
trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
Modified: trunk/reactos/hal/halx86/include/halp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Sun Sep 13 20:37:28 2015
@@ -48,7 +48,6 @@
typedef
VOID
-ATTRIB_NORETURN
(FASTCALL *PHAL_SW_INTERRUPT_HANDLER_2ND_ENTRY)(
IN PKTRAP_FRAME TrapFrame
);
Modified: trunk/reactos/hal/halx86/up/pic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/pic.c?rev=69…
==============================================================================
--- trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/up/pic.c [iso-8859-1] Sun Sep 13 20:37:28 2015
@@ -776,6 +776,7 @@
{
/* No need to loop checking for hardware interrupts */
SWInterruptHandlerTable2[PendingIrql](TrapFrame);
+ UNREACHABLE;
}
}
}
@@ -1241,6 +1242,7 @@
{
/* Now handle pending software interrupt */
SWInterruptHandlerTable2[PendingIrql](TrapFrame);
+ UNREACHABLE;
}
}
}
@@ -1249,8 +1251,8 @@
/* SOFTWARE INTERRUPT TRAPS ***************************************************/
FORCEINLINE
+DECLSPEC_NORETURN
VOID
-DECLSPEC_NORETURN
_HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
{
KIRQL CurrentIrql;
@@ -1278,8 +1280,8 @@
KiEoiHelper(TrapFrame);
}
+DECLSPEC_NORETURN
VOID
-DECLSPEC_NORETURN
FASTCALL
HalpApcInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
{
@@ -1287,8 +1289,8 @@
_HalpApcInterruptHandler(TrapFrame);
}
+DECLSPEC_NORETURN
VOID
-DECLSPEC_NORETURN
FASTCALL
HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
{
@@ -1327,8 +1329,8 @@
return CurrentIrql;
}
+DECLSPEC_NORETURN
VOID
-DECLSPEC_NORETURN
FASTCALL
HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME TrapFrame)
{
Modified: trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/trap_x.h [iso-8859-1] Sun Sep 13 20:37:28
2015
@@ -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 KiTrapReturnNoSegmentsRet8(IN PKTRAP_FRAME TrapFrame);
typedef
-ATTRIB_NORETURN
VOID
(FASTCALL *PFAST_SYSTEM_CALL_EXIT)(
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.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sun Sep 13 20:37:28 2015
@@ -173,6 +173,7 @@
{
/* We can use the sysexit handler */
KiFastCallExitHandler(TrapFrame);
+ UNREACHABLE;
}
}