--- c/src/lib/libbsp/i386/pc386/Makefile.am | 1 + c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c | 20 ++++++++++++++++++++ cpukit/score/cpu/i386/rtems/score/cpu.h | 11 ++--------- 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 c/src/lib/libbsp/i386/pc386/startup/bsp_fatal_halt.c
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am index 75a56c9..1d52cf4 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 0000000..c9830f6 --- /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)) + ); +} diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index 2a1b95b..3513650 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -529,15 +529,8 @@ uint32_t _CPU_ISR_Get_level( void ); * + disable interrupts and halt the CPU */ -#define _CPU_Fatal_halt( _source, _error ) \ - { \ - uint32_t _error_lvalue = ( _error ); \ - __asm__ volatile ( "cli ; \ - movl %0,%%eax ; \ - hlt" \ - : "=r" ((_error_lvalue)) : "0" ((_error_lvalue)) \ - ); \ - } +extern void _CPU_Fatal_halt(uint32_t source, uint32_t error) + RTEMS_NO_RETURN; #endif /* ASM */ -- 1.9.1 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel