summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2016-01-08 16:28:45 -0500
committerGedare Bloom <gedare@rtems.org>2016-03-03 16:36:30 -0500
commit505dc617c82718f54e954890f279d10bab963305 (patch)
tree47766fad70a894cd8afe68b5bac996ecf9785525 /c/src/lib/libbsp/i386
parenti386: remove redundant CPP defines (diff)
downloadrtems-505dc617c82718f54e954890f279d10bab963305.tar.bz2
i386: relocate fatal halt to bsp layer
Diffstat (limited to 'c/src/lib/libbsp/i386')
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.am1
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index 75a56c9e95..1d52cf411d 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -147,6 +147,7 @@ libbsp_a_SOURCES += ../../i386/shared/pci/pcibios.c \
include_HEADERS += ../../i386/shared/comm/uart.h
# startup
libbsp_a_SOURCES += ../../shared/bsppredriverhook.c
+libbsp_a_SOURCES += startup/bsp_fatal_halt.c
libbsp_a_SOURCES += startup/bspgetworkarea.c
libbsp_a_SOURCES += startup/bspidle.S
libbsp_a_SOURCES += startup/bspstart.c
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c b/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
new file mode 100644
index 0000000000..c9830f6bac
--- /dev/null
+++ b/c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
@@ -0,0 +1,20 @@
+/**
+ * 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)
+{
+ uint32_t _error_lvalue = ( _error );
+ __asm__ volatile (
+ "cli ; movl %0,%%eax ; hlt"
+ : "=r" ((_error_lvalue))
+ : "0" ((_error_lvalue))
+ );
+}