summaryrefslogtreecommitdiffstats
path: root/bsps/i386/pc386/start/bsp_fatal_halt.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/i386/pc386/start/bsp_fatal_halt.c')
-rw-r--r--bsps/i386/pc386/start/bsp_fatal_halt.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/bsps/i386/pc386/start/bsp_fatal_halt.c b/bsps/i386/pc386/start/bsp_fatal_halt.c
new file mode 100644
index 0000000000..07bbd793e0
--- /dev/null
+++ b/bsps/i386/pc386/start/bsp_fatal_halt.c
@@ -0,0 +1,24 @@
+/**
+ * COPYRIGHT (c) 2016.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <bsp.h>
+
+void _CPU_Fatal_halt(uint32_t source, uint32_t error)
+{
+ __asm__ volatile (
+ "cli\n\t"
+ "movl %0,%%eax\n\t"
+ "hlt\n\t"
+ : "=r" ((error))
+ : "0" ((error))
+ );
+ #ifdef __GNUC__
+ __builtin_unreachable();
+ #endif
+}