Index: cpukit/score/cpu/aarch64/cpu.c
===================================================================
--- cpukit/score/cpu/aarch64/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/aarch64/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -39,6 +39,5 @@
 #endif
 
-#include <rtems/score/assert.h>
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/tls.h>
@@ -196,2 +195,15 @@
   /* Do nothing */
 }
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+  __asm__ volatile ("mov x0, %0\n"
+                : "=r" (error)
+                : "0" (error)
+                : "x0" );
+  while (1);
+}
Index: cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/aarch64/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/aarch64/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -295,17 +295,4 @@
     *(*(_destination)) = _CPU_Null_fp_context; \
   } while (0)
-
-#define _CPU_Fatal_halt( _source, _err )    \
-   do {                                     \
-     uint64_t _level;                       \
-     uint32_t _error = _err;                \
-     _CPU_ISR_Disable( _level );            \
-     (void) _level;                         \
-     __asm__ volatile ("mov x0, %0\n"       \
-                   : "=r" (_error)          \
-                   : "0" (_error)           \
-                   : "x0" );                \
-     while (1);                             \
-   } while (0);
 
 /**
Index: cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -59,4 +59,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/arm/cpu.c
===================================================================
--- cpukit/score/cpu/arm/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/arm/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -27,6 +27,5 @@
 #endif
 
-#include <rtems/score/assert.h>
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/tls.h>
@@ -172,2 +171,19 @@
 
 #endif /* ARM_MULTILIB_ARCH_V4 */
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  __asm__ volatile ("mov r0, %0\n"
+                : "=r" (error)
+                : "0" (error)
+                : "r0" );
+
+  while ( true ) {
+    /* Do nothing */
+  }
+}
Index: cpukit/score/cpu/arm/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/arm/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/arm/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -434,17 +434,4 @@
     *(*(_destination)) = _CPU_Null_fp_context; \
   } while (0)
-
-#define _CPU_Fatal_halt( _source, _err )    \
-   do {                                     \
-     uint32_t _level;                       \
-     uint32_t _error = _err;                \
-     _CPU_ISR_Disable( _level );            \
-     (void) _level;                         \
-     __asm__ volatile ("mov r0, %0\n"       \
-                   : "=r" (_error)          \
-                   : "0" (_error)           \
-                   : "r0" );                \
-     while (1);                             \
-   } while (0);
 
 /**
Index: cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -113,4 +113,6 @@
 #endif /* ARM_MULTILIB_ARCH_V4 */
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/bfin/cpu.c
===================================================================
--- cpukit/score/cpu/bfin/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/bfin/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -19,4 +19,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/bfin.h>
@@ -73,4 +74,12 @@
   __asm__ __volatile__ ("syscfg = %0" : : "d" (0x00000004));
 }
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  __asm__ volatile ( "cli R1; R1 = %0; _halt: idle; jump _halt;"
+                     : : "r" (error) );
+}
+
+/* end of Fatal Error manager macros */
 
 
Index: cpukit/score/cpu/bfin/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/bfin/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/bfin/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -461,27 +461,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/**
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- *
- * Port Specific Information:
- *
- * XXX document implementation including references if appropriate
- */
-#define _CPU_Fatal_halt( _source, _error ) \
-  { \
-    __asm__ volatile ( "cli R1; \
-                    R1 = %0; \
-                    _halt: \
-                    idle; \
-                    jump _halt;"\
-                    : : "r" (_error) ); \
-  }
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/i386/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/i386/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/i386/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -480,16 +480,5 @@
 /* end of Context handler macros */
 
-/*
- *  Fatal Error manager macros
- *
- *  These macros perform the following functions:
- *    + disable interrupts and halt the CPU
- */
-
-RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
-
 #endif /* ASM */
-
-/* end of Fatal Error manager macros */
 
 #define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
Index: cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -38,4 +38,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/lm32/cpu.c
===================================================================
--- cpukit/score/cpu/lm32/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/lm32/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -21,4 +21,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 
@@ -44,4 +45,16 @@
 
   /* FP context initialization support goes here */
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  while ( true ) {
+    /* Do nothing */
+  }
 }
 
Index: cpukit/score/cpu/lm32/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/lm32/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/lm32/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -591,21 +591,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/**
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- *
- * Port Specific Information:
- *
- * XXX document implementation including references if appropriate
- */
-#define _CPU_Fatal_halt( _source, _error ) \
-  { \
-  }
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/lm32/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/lm32/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/lm32/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -35,4 +35,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/m68k/cpu.c
===================================================================
--- cpukit/score/cpu/m68k/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/m68k/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -18,4 +18,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/percpu.h>
@@ -87,4 +88,27 @@
 
   m68k_install_interrupt_stack();
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+#if ( defined(__mcoldfire__) )
+  __asm__ volatile( "move.w %%sr,%%d0\n\t"
+      	  "or.l %2,%%d0\n\t"
+      	  "move.w %%d0,%%sr\n\t"
+      	  "move.l %1,%%d0\n\t"
+      	  "move.l #0xDEADBEEF,%%d1\n\t"
+                "halt"
+      	  : "=g" (error)
+      	  : "0" (error), "d"(0x0700)
+      	  : "d0", "d1" );
+ 
+#else
+  __asm__ volatile( "movl  %0,%%d0; "
+                "orw   #0x0700,%%sr; "
+                "stop  #0x2700" : "=d" ((error)) : "0" ((error)) );
+  
+#endif
+
+/* end of Fatal Error manager macros */
 }
 
Index: cpukit/score/cpu/m68k/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/m68k/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/m68k/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -401,33 +401,4 @@
 
 void *_CPU_Thread_Idle_body( uintptr_t ignored );
-
-/*
- *  Fatal Error manager macros
- *
- *  These macros perform the following functions:
- *    + disable interrupts and halt the CPU
- */
-
-#if ( defined(__mcoldfire__) )
-#define _CPU_Fatal_halt( _source, _error ) \
-  { __asm__ volatile( "move.w %%sr,%%d0\n\t" \
-		  "or.l %2,%%d0\n\t" \
-		  "move.w %%d0,%%sr\n\t" \
-		  "move.l %1,%%d0\n\t" \
-		  "move.l #0xDEADBEEF,%%d1\n\t" \
-                  "halt" \
-		  : "=g" (_error) \
-		  : "0" (_error), "d"(0x0700) \
-		  : "d0", "d1" ); \
-  }
-#else
-#define _CPU_Fatal_halt( _source, _error ) \
-  { __asm__ volatile( "movl  %0,%%d0; " \
-                  "orw   #0x0700,%%sr; " \
-                  "stop  #0x2700" : "=d" ((_error)) : "0" ((_error)) ); \
-  }
-#endif
-
-/* end of Fatal Error manager macros */
 
 #define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
Index: cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/mips/cpu.c
===================================================================
--- cpukit/score/cpu/mips/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/mips/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -51,4 +51,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 
@@ -92,4 +93,16 @@
   						   inexact exceptions */
 #endif
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  while ( true ) {
+    /* Do nothing */
+  }
 }
 
Index: cpukit/score/cpu/mips/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/mips/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/mips/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -711,21 +711,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/*
- *  This routine copies _error into a known place -- typically a stack
- *  location or a register, optionally disables interrupts, and
- *  halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _source, _error ) \
-  do { \
-    unsigned int _level; \
-    _CPU_ISR_Disable(_level); \
-    (void)_level; \
-    loop: goto loop; \
-  } while (0)
-
-
 extern void mips_break( int error );
 
Index: cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/moxie/cpu.c
===================================================================
--- cpukit/score/cpu/moxie/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/moxie/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -18,5 +18,7 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
+#include <rtems/bspIo.h>
 
 /*  _CPU_Initialize
@@ -36,4 +38,16 @@
 
   /* FP context initialization support goes here */
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  while ( true ) {
+    /* Do nothing */
+  }
 }
 
Index: cpukit/score/cpu/moxie/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/moxie/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/moxie/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -392,21 +392,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/*
- *  This routine copies _error into a known place -- typically a stack
- *  location or a register, optionally disables interrupts, and
- *  halts/stops the CPU.
- *
- *  MOXIE Specific Information:
- *
- *  XXX
- */
-#define _CPU_Fatal_halt( _source, _error ) \
-        printk("Fatal Error %d.%lu Halted\n",_source,_error); \
-        for(;;)
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/nios2/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/nios2/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/nios2/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -291,6 +291,4 @@
   _CPU_Context_restore( (_the_context) );
 
-RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t _source, uint32_t _error );
-
 /**
  * @brief CPU initialization.
Index: cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/nios2/nios2-fatal-halt.c
===================================================================
--- cpukit/score/cpu/nios2/nios2-fatal-halt.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/nios2/nios2-fatal-halt.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -12,8 +12,8 @@
  */
 
-#include <rtems/score/cpu.h>
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/nios2-utility.h>
 
-void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
+void _CPU_Fatal_halt( uint32_t _source, CPU_Uint32ptr _error )
 {
   /* write 0 to status register (disable interrupts) */
Index: cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -825,21 +825,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/**
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- *
- * Port Specific Information:
- *
- * XXX document implementation including references if appropriate
- */
-#define _CPU_Fatal_halt( _source, _error ) \
-  { \
-  }
-
-/* end of Fatal Error manager macros */
-
 /* Bitfield handler macros */
 
Index: cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -85,4 +85,17 @@
 
 /**
+ * This routine copies _error into a known place -- typically a stack
+ * location or a register, optionally disables interrupts, and
+ * halts/stops the CPU.
+ *
+ * Port Specific Information:
+ *
+ * XXX document implementation including references if appropriate
+ */
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
+/* end of Fatal Error manager macros */
+
+/**
  * @addtogroup RTEMSScoreCPUExampleContext
  *
Index: cpukit/score/cpu/or1k/cpu.c
===================================================================
--- cpukit/score/cpu/or1k/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/or1k/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -12,6 +12,6 @@
  */
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
-#include <rtems/score/cpu.h>
 
 /* bsp_start_vector_table_begin is the start address of the vector table
@@ -28,4 +28,20 @@
   /* Do nothing */
 }
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  _OR1KSIM_CPU_Halt();
+
+  while ( true ) {
+    /* Do nothing */
+  }
+}
+
+/* end of Fatal Error manager macros */
 
 /**
Index: cpukit/score/cpu/or1k/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/or1k/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/or1k/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -391,21 +391,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/*
- *  This routine copies _error into a known place -- typically a stack
- *  location or a register, optionally disables interrupts, and
- *  halts/stops the CPU.
- *
- */
-
-#include <inttypes.h>
-
-#define _CPU_Fatal_halt(_source, _error ) \
-        _OR1KSIM_CPU_Halt(); \
-        for(;;)
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/powerpc/cpu.c
===================================================================
--- cpukit/score/cpu/powerpc/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/powerpc/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -326,2 +326,16 @@
   CPU_Exception_frame
 );
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ppc_interrupt_disable();
+  __asm__ volatile (
+    "mr 3, %0\n"
+    "mr 4, %1\n"
+    "1:\n"
+    "b 1b\n"
+    : \
+    : "r" (source), "r" (error)
+    : "memory"
+  );
+}
Index: cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/powerpc/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/powerpc/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -614,18 +614,4 @@
 #endif /* ASM */
 
-#define _CPU_Fatal_halt( _source, _error ) \
-  do { \
-    ppc_interrupt_disable(); \
-    __asm__ volatile ( \
-      "mr 3, %0\n" \
-      "mr 4, %1\n" \
-      "1:\n" \
-      "b 1b\n" \
-      : \
-      : "r" (_source), "r" (_error) \
-      : "memory" \
-    ); \
-  } while ( 0 )
-
 /*
  *  Should be large enough to run all RTEMS tests.  This ensures
Index: cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -249,4 +249,6 @@
 #endif /* RTEMS_SMP */
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/riscv/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/riscv/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/riscv/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -211,6 +211,4 @@
 #define _CPU_Context_Restart_self( _the_context ) \
    _CPU_Context_restore( (_the_context) )
-
-RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
 
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
Index: cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -409,4 +409,6 @@
 #endif /* RTEMS_SMP */
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/sh/cpu.c
===================================================================
--- cpukit/score/cpu/sh/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sh/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -31,7 +31,7 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/sh_io.h>
-#include <rtems/score/cpu.h>
 #include <rtems/score/sh.h>
 
@@ -75,4 +75,11 @@
   /* enable interrupts */
   _CPU_ISR_Set_level( level ) ;
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  __asm__ volatile("mov.l %0,r0"::"m" (error));
+  __asm__ volatile("mov #1, r4");
+  __asm__ volatile("trapa #34");
 }
 
Index: cpukit/score/cpu/sh/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/sh/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sh/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -491,30 +491,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/*
- * FIXME: Trap32 ???
- *
- *  This routine copies _error into a known place -- typically a stack
- *  location or a register, optionally disables interrupts, and
- *  invokes a Trap32 Instruction which returns to the breakpoint
- *  routine of cmon.
- */
-
-#ifdef BSP_FATAL_HALT
-  /* we manage the fatal error in the board support package */
-  void bsp_fatal_halt( uint32_t   _error);
-#define _CPU_Fatal_halt( _source, _error ) bsp_fatal_halt( _error)
-#else
-#define _CPU_Fatal_halt( _source, _error)\
-{ \
-  __asm__ volatile("mov.l %0,r0"::"m" (_error)); \
-  __asm__ volatile("mov #1, r4"); \
-  __asm__ volatile("trapa #34"); \
-}
-#endif
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/sparc/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/sparc/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sparc/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -884,15 +884,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/**
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- */
-RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
 
Index: cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -200,4 +200,6 @@
 #define _CPU_Get_thread_executing() ( _SPARC_Per_CPU_current->executing )
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 void _CPU_Context_volatile_clobber( uintptr_t pattern );
 
Index: cpukit/score/cpu/sparc64/cpu.c
===================================================================
--- cpukit/score/cpu/sparc64/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sparc64/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -17,4 +17,5 @@
  */
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/tls.h>
@@ -62,4 +63,13 @@
    */
   _CPU_ISR_Dispatch_disable = 0;
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  uint32_t   level;
+
+  level = sparc_disable_interrupts();
+  __asm__ volatile ( "mov  %0, %%g1 " : "=r" (level) : "0" (level) );
+  while (1); /* loop forever */
 }
 
Index: cpukit/score/cpu/sparc64/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/sparc64/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sparc64/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -770,23 +770,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/*
- *  This routine copies _error into a known place -- typically a stack
- *  location or a register, optionally disables interrupts, and
- *  halts/stops the CPU.
- */
-
-#define _CPU_Fatal_halt( _source, _error ) \
-  do { \
-    uint32_t   level; \
-    \
-    level = sparc_disable_interrupts(); \
-    __asm__ volatile ( "mov  %0, %%g1 " : "=r" (level) : "0" (level) ); \
-    while (1); /* loop forever */ \
-  } while (0)
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
 
Index: cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/v850/cpu.c
===================================================================
--- cpukit/score/cpu/v850/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/v850/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -18,4 +18,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/isr.h>
 
@@ -29,4 +30,11 @@
 void _CPU_Initialize(void)
 {
+}
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  __asm__ __volatile__ ( "di" );
+  __asm__ __volatile__ ( "mov %0, r10; " : "=r" ((error)) );
+  __asm__ __volatile__ ( "halt" );
 }
 
Index: cpukit/score/cpu/v850/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/v850/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/v850/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -462,24 +462,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-/**
- * This routine copies _error into a known place -- typically a stack
- * location or a register, optionally disables interrupts, and
- * halts/stops the CPU.
- *
- * Port Specific Information:
- *
- * Move the error code into r10, disable interrupts and halt.
- */
-#define _CPU_Fatal_halt( _source, _error ) \
-  do { \
-    __asm__ __volatile__ ( "di" ); \
-    __asm__ __volatile__ ( "mov %0, r10; " : "=r" ((_error)) ); \
-    __asm__ __volatile__ ( "halt" ); \
-  } while (0)
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
 
Index: cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -36,4 +36,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
Index: cpukit/score/cpu/x86_64/cpu.c
===================================================================
--- cpukit/score/cpu/x86_64/cpu.c	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/x86_64/cpu.c	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -38,4 +38,5 @@
 #endif
 
+#include <rtems/score/cpuimpl.h>
 #include <rtems/score/idt.h>
 #include <rtems/score/isr.h>
@@ -49,2 +50,14 @@
 {
 }
+
+void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
+{
+  ISR_Level level;
+
+  _CPU_ISR_Disable( level );
+  (void) level;
+
+  while ( true ) {
+    /* Do nothing */
+  }
+}
Index: cpukit/score/cpu/x86_64/include/rtems/score/cpu.h
===================================================================
--- cpukit/score/cpu/x86_64/include/rtems/score/cpu.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/x86_64/include/rtems/score/cpu.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -233,12 +233,4 @@
 /* end of Context handler macros */
 
-/* Fatal Error manager macros */
-
-#define _CPU_Fatal_halt( _source, _error ) \
-  { \
-  }
-
-/* end of Fatal Error manager macros */
-
 #define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
 
Index: cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h
===================================================================
--- cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h	(revision 4adaed7328e39eac4fe1879cba61919e74965cc8)
+++ cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h	(revision 8b65b57472d5086f2c035a09fdb07a40285beb4a)
@@ -39,4 +39,6 @@
 #endif
 
+RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
+
 RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
 {
