Changeset 8b65b574 in rtems


Ignore:
Timestamp:
Jul 28, 2021, 12:41:32 PM (4 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2802896
Parents:
f799b452
git-author:
Sebastian Huber <sebastian.huber@…> (07/28/21 12:41:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/28/21 19:04:20)
Message:

score: Canonicalize _CPU_Fatal_halt()

Move _CPU_Fatal_halt() declaration to <rtems/score/cpuimpl.h> and make sure it
is a proper declaration of a function which does not return. Fix the type of
the error code. If necessary, add the implementation to cpu.c. Implementing
_CPU_Fatal_halt() as a function makes it possible to wrap this function for
example to fully test _Terminate().

Files:
56 edited

Legend:

Unmodified
Added
Removed
  • bsps/i386/pc386/start/bsp_fatal_halt.c

    rf799b452 r8b65b574  
    88 */
    99
    10 #include <bsp.h>
     10#include <rtems/score/cpuimpl.h>
    1111
    12 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
     12void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
    1313{
    1414  __asm__ volatile (
     
    1919         : "0" ((error))
    2020  );
    21   #ifdef __GNUC__
    22     __builtin_unreachable();
    23   #endif
     21  RTEMS_UNREACHABLE();
    2422}
  • bsps/riscv/griscv/start/bsp_fatal_halt.c

    rf799b452 r8b65b574  
    2828
    2929#include <bsp.h>
     30#include <rtems/score/cpuimpl.h>
    3031
    31 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
     32void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
    3233{
    3334    /* ecall is currently used to halt the griscv cpu */
  • bsps/riscv/riscv/start/bsp_fatal_halt.c

    rf799b452 r8b65b574  
    2929#include <bsp/riscv.h>
    3030#include <bsp/fdt.h>
     31#include <rtems/score/cpuimpl.h>
    3132
    3233#include <libfdt.h>
    3334
    34 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
     35void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
    3536{
    3637  const char *fdt;
  • bsps/sparc/leon3/start/bsp_fatal_halt.c

    rf799b452 r8b65b574  
    1414#include <bsp.h>
    1515#include <leon.h>
     16#include <rtems/score/cpuimpl.h>
    1617
     18void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     19{
    1720#ifdef BSP_POWER_DOWN_AT_FATAL_HALT
    18 
    19 /* Power down LEON CPU on fatal error exit */
    20 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    21 {
     21  /* Power down LEON CPU on fatal error exit */
    2222  sparc_disable_interrupts();
    2323  leon3_power_down_loop();
     24#else
     25  /*
     26   * Return to debugger, simulator, hypervisor or similar by exiting
     27   * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
     28   */
     29  sparc_syscall_exit(source, error);
     30#endif
    2431}
    25 
    26 #else
    27 
    28 /* return to debugger, simulator, hypervisor or similar by exiting
    29  * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
    30  */
    31 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    32 {
    33   sparc_syscall_exit(source, error);
    34 }
    35 
    36 #endif
  • bsps/sparc/shared/start/bsp_fatal_halt.c

    rf799b452 r8b65b574  
    1313
    1414#include <bsp.h>
     15#include <rtems/score/cpuimpl.h>
    1516
     17void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     18{
    1619#ifdef BSP_POWER_DOWN_AT_FATAL_HALT
    17 
    18 /* Spin CPU on fatal error exit */
    19 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    20 {
     20  /* Spin CPU on fatal error exit */
    2121  uint32_t level = sparc_disable_interrupts();
    2222
     
    2424
    2525  while (1) ; /* loop forever */
     26#else
     27  /*
     28   * Return to debugger, simulator, hypervisor or similar by exiting
     29   * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
     30   */
     31  sparc_syscall_exit(source, error);
     32#endif
    2633}
    27 
    28 #else
    29 
    30 /* return to debugger, simulator, hypervisor or similar by exiting
    31  * with an error code. g1=1, g2=FATAL_SOURCE, G3=error-code.
    32  */
    33 void _CPU_Fatal_halt(uint32_t source, uint32_t error)
    34 {
    35   sparc_syscall_exit(source, error);
    36 }
    37 
    38 #endif
  • cpukit/score/cpu/aarch64/cpu.c

    rf799b452 r8b65b574  
    3939#endif
    4040
    41 #include <rtems/score/assert.h>
    42 #include <rtems/score/cpu.h>
     41#include <rtems/score/cpuimpl.h>
    4342#include <rtems/score/thread.h>
    4443#include <rtems/score/tls.h>
     
    196195  /* Do nothing */
    197196}
     197
     198void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     199{
     200  ISR_Level level;
     201
     202  _CPU_ISR_Disable( level );
     203  (void) level;
     204  __asm__ volatile ("mov x0, %0\n"
     205                : "=r" (error)
     206                : "0" (error)
     207                : "x0" );
     208  while (1);
     209}
  • cpukit/score/cpu/aarch64/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    295295    *(*(_destination)) = _CPU_Null_fp_context; \
    296296  } while (0)
    297 
    298 #define _CPU_Fatal_halt( _source, _err )    \
    299    do {                                     \
    300      uint64_t _level;                       \
    301      uint32_t _error = _err;                \
    302      _CPU_ISR_Disable( _level );            \
    303      (void) _level;                         \
    304      __asm__ volatile ("mov x0, %0\n"       \
    305                    : "=r" (_error)          \
    306                    : "0" (_error)           \
    307                    : "x0" );                \
    308      while (1);                             \
    309    } while (0);
    310297
    311298/**
  • cpukit/score/cpu/aarch64/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    5959#endif
    6060
     61RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     62
    6163void _CPU_Context_volatile_clobber( uintptr_t pattern );
    6264
  • cpukit/score/cpu/arm/cpu.c

    rf799b452 r8b65b574  
    2727#endif
    2828
    29 #include <rtems/score/assert.h>
    30 #include <rtems/score/cpu.h>
     29#include <rtems/score/cpuimpl.h>
    3130#include <rtems/score/thread.h>
    3231#include <rtems/score/tls.h>
     
    172171
    173172#endif /* ARM_MULTILIB_ARCH_V4 */
     173
     174void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     175{
     176  ISR_Level level;
     177
     178  _CPU_ISR_Disable( level );
     179  (void) level;
     180
     181  __asm__ volatile ("mov r0, %0\n"
     182                : "=r" (error)
     183                : "0" (error)
     184                : "r0" );
     185
     186  while ( true ) {
     187    /* Do nothing */
     188  }
     189}
  • cpukit/score/cpu/arm/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    434434    *(*(_destination)) = _CPU_Null_fp_context; \
    435435  } while (0)
    436 
    437 #define _CPU_Fatal_halt( _source, _err )    \
    438    do {                                     \
    439      uint32_t _level;                       \
    440      uint32_t _error = _err;                \
    441      _CPU_ISR_Disable( _level );            \
    442      (void) _level;                         \
    443      __asm__ volatile ("mov r0, %0\n"       \
    444                    : "=r" (_error)          \
    445                    : "0" (_error)           \
    446                    : "r0" );                \
    447      while (1);                             \
    448    } while (0);
    449436
    450437/**
  • cpukit/score/cpu/arm/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    113113#endif /* ARM_MULTILIB_ARCH_V4 */
    114114
     115RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     116
    115117void _CPU_Context_volatile_clobber( uintptr_t pattern );
    116118
  • cpukit/score/cpu/bfin/cpu.c

    rf799b452 r8b65b574  
    1919#endif
    2020
     21#include <rtems/score/cpuimpl.h>
    2122#include <rtems/score/isr.h>
    2223#include <rtems/score/bfin.h>
     
    7374  __asm__ __volatile__ ("syscfg = %0" : : "d" (0x00000004));
    7475}
     76
     77void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     78{
     79  __asm__ volatile ( "cli R1; R1 = %0; _halt: idle; jump _halt;"
     80                     : : "r" (error) );
     81}
     82
     83/* end of Fatal Error manager macros */
    7584
    7685
  • cpukit/score/cpu/bfin/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    461461/* end of Context handler macros */
    462462
    463 /* Fatal Error manager macros */
    464 
    465 /**
    466  * This routine copies _error into a known place -- typically a stack
    467  * location or a register, optionally disables interrupts, and
    468  * halts/stops the CPU.
    469  *
    470  * Port Specific Information:
    471  *
    472  * XXX document implementation including references if appropriate
    473  */
    474 #define _CPU_Fatal_halt( _source, _error ) \
    475   { \
    476     __asm__ volatile ( "cli R1; \
    477                     R1 = %0; \
    478                     _halt: \
    479                     idle; \
    480                     jump _halt;"\
    481                     : : "r" (_error) ); \
    482   }
    483 
    484 /* end of Fatal Error manager macros */
    485 
    486463#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    487464
  • cpukit/score/cpu/bfin/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/i386/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    480480/* end of Context handler macros */
    481481
    482 /*
    483  *  Fatal Error manager macros
    484  *
    485  *  These macros perform the following functions:
    486  *    + disable interrupts and halt the CPU
    487  */
    488 
    489 RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    490 
    491482#endif /* ASM */
    492 
    493 /* end of Fatal Error manager macros */
    494483
    495484#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
  • cpukit/score/cpu/i386/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3838#endif
    3939
     40RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     41
    4042RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    4143{
  • cpukit/score/cpu/lm32/cpu.c

    rf799b452 r8b65b574  
    2121#endif
    2222
     23#include <rtems/score/cpuimpl.h>
    2324#include <rtems/score/isr.h>
    2425
     
    4445
    4546  /* FP context initialization support goes here */
     47}
     48
     49void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     50{
     51  ISR_Level level;
     52
     53  _CPU_ISR_Disable( level );
     54  (void) level;
     55
     56  while ( true ) {
     57    /* Do nothing */
     58  }
    4659}
    4760
  • cpukit/score/cpu/lm32/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    591591/* end of Context handler macros */
    592592
    593 /* Fatal Error manager macros */
    594 
    595 /**
    596  * This routine copies _error into a known place -- typically a stack
    597  * location or a register, optionally disables interrupts, and
    598  * halts/stops the CPU.
    599  *
    600  * Port Specific Information:
    601  *
    602  * XXX document implementation including references if appropriate
    603  */
    604 #define _CPU_Fatal_halt( _source, _error ) \
    605   { \
    606   }
    607 
    608 /* end of Fatal Error manager macros */
    609 
    610593#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    611594
  • cpukit/score/cpu/lm32/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3535#endif
    3636
     37RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     38
    3739RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3840{
  • cpukit/score/cpu/m68k/cpu.c

    rf799b452 r8b65b574  
    1818#endif
    1919
     20#include <rtems/score/cpuimpl.h>
    2021#include <rtems/score/isr.h>
    2122#include <rtems/score/percpu.h>
     
    8788
    8889  m68k_install_interrupt_stack();
     90}
     91
     92void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     93{
     94#if ( defined(__mcoldfire__) )
     95  __asm__ volatile( "move.w %%sr,%%d0\n\t"
     96          "or.l %2,%%d0\n\t"
     97          "move.w %%d0,%%sr\n\t"
     98          "move.l %1,%%d0\n\t"
     99          "move.l #0xDEADBEEF,%%d1\n\t"
     100                "halt"
     101          : "=g" (error)
     102          : "0" (error), "d"(0x0700)
     103          : "d0", "d1" );
     104 
     105#else
     106  __asm__ volatile( "movl  %0,%%d0; "
     107                "orw   #0x0700,%%sr; "
     108                "stop  #0x2700" : "=d" ((error)) : "0" ((error)) );
     109 
     110#endif
     111
     112/* end of Fatal Error manager macros */
    89113}
    90114
  • cpukit/score/cpu/m68k/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    401401
    402402void *_CPU_Thread_Idle_body( uintptr_t ignored );
    403 
    404 /*
    405  *  Fatal Error manager macros
    406  *
    407  *  These macros perform the following functions:
    408  *    + disable interrupts and halt the CPU
    409  */
    410 
    411 #if ( defined(__mcoldfire__) )
    412 #define _CPU_Fatal_halt( _source, _error ) \
    413   { __asm__ volatile( "move.w %%sr,%%d0\n\t" \
    414                   "or.l %2,%%d0\n\t" \
    415                   "move.w %%d0,%%sr\n\t" \
    416                   "move.l %1,%%d0\n\t" \
    417                   "move.l #0xDEADBEEF,%%d1\n\t" \
    418                   "halt" \
    419                   : "=g" (_error) \
    420                   : "0" (_error), "d"(0x0700) \
    421                   : "d0", "d1" ); \
    422   }
    423 #else
    424 #define _CPU_Fatal_halt( _source, _error ) \
    425   { __asm__ volatile( "movl  %0,%%d0; " \
    426                   "orw   #0x0700,%%sr; " \
    427                   "stop  #0x2700" : "=d" ((_error)) : "0" ((_error)) ); \
    428   }
    429 #endif
    430 
    431 /* end of Fatal Error manager macros */
    432403
    433404#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
  • cpukit/score/cpu/m68k/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/mips/cpu.c

    rf799b452 r8b65b574  
    5151#endif
    5252
     53#include <rtems/score/cpuimpl.h>
    5354#include <rtems/score/isr.h>
    5455
     
    9293                                                   inexact exceptions */
    9394#endif
     95}
     96
     97void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     98{
     99  ISR_Level level;
     100
     101  _CPU_ISR_Disable( level );
     102  (void) level;
     103
     104  while ( true ) {
     105    /* Do nothing */
     106  }
    94107}
    95108
  • cpukit/score/cpu/mips/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    711711/* end of Context handler macros */
    712712
    713 /* Fatal Error manager macros */
    714 
    715 /*
    716  *  This routine copies _error into a known place -- typically a stack
    717  *  location or a register, optionally disables interrupts, and
    718  *  halts/stops the CPU.
    719  */
    720 
    721 #define _CPU_Fatal_halt( _source, _error ) \
    722   do { \
    723     unsigned int _level; \
    724     _CPU_ISR_Disable(_level); \
    725     (void)_level; \
    726     loop: goto loop; \
    727   } while (0)
    728 
    729 
    730713extern void mips_break( int error );
    731714
  • cpukit/score/cpu/mips/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/moxie/cpu.c

    rf799b452 r8b65b574  
    1818#endif
    1919
     20#include <rtems/score/cpuimpl.h>
    2021#include <rtems/score/isr.h>
     22#include <rtems/bspIo.h>
    2123
    2224/*  _CPU_Initialize
     
    3638
    3739  /* FP context initialization support goes here */
     40}
     41
     42void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     43{
     44  ISR_Level level;
     45
     46  _CPU_ISR_Disable( level );
     47  (void) level;
     48
     49  while ( true ) {
     50    /* Do nothing */
     51  }
    3852}
    3953
  • cpukit/score/cpu/moxie/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    392392/* end of Context handler macros */
    393393
    394 /* Fatal Error manager macros */
    395 
    396 /*
    397  *  This routine copies _error into a known place -- typically a stack
    398  *  location or a register, optionally disables interrupts, and
    399  *  halts/stops the CPU.
    400  *
    401  *  MOXIE Specific Information:
    402  *
    403  *  XXX
    404  */
    405 #define _CPU_Fatal_halt( _source, _error ) \
    406         printk("Fatal Error %d.%lu Halted\n",_source,_error); \
    407         for(;;)
    408 
    409 /* end of Fatal Error manager macros */
    410 
    411394#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    412395
  • cpukit/score/cpu/moxie/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/nios2/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    291291  _CPU_Context_restore( (_the_context) );
    292292
    293 RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t _source, uint32_t _error );
    294 
    295293/**
    296294 * @brief CPU initialization.
  • cpukit/score/cpu/nios2/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840void _CPU_Context_volatile_clobber( uintptr_t pattern );
    3941
  • cpukit/score/cpu/nios2/nios2-fatal-halt.c

    rf799b452 r8b65b574  
    1212 */
    1313
    14 #include <rtems/score/cpu.h>
     14#include <rtems/score/cpuimpl.h>
    1515#include <rtems/score/nios2-utility.h>
    1616
    17 void _CPU_Fatal_halt( uint32_t _source, uint32_t _error )
     17void _CPU_Fatal_halt( uint32_t _source, CPU_Uint32ptr _error )
    1818{
    1919  /* write 0 to status register (disable interrupts) */
  • cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    825825/* end of Context handler macros */
    826826
    827 /* Fatal Error manager macros */
    828 
    829 /**
    830  * This routine copies _error into a known place -- typically a stack
    831  * location or a register, optionally disables interrupts, and
    832  * halts/stops the CPU.
    833  *
    834  * Port Specific Information:
    835  *
    836  * XXX document implementation including references if appropriate
    837  */
    838 #define _CPU_Fatal_halt( _source, _error ) \
    839   { \
    840   }
    841 
    842 /* end of Fatal Error manager macros */
    843 
    844827/* Bitfield handler macros */
    845828
  • cpukit/score/cpu/no_cpu/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    8585
    8686/**
     87 * This routine copies _error into a known place -- typically a stack
     88 * location or a register, optionally disables interrupts, and
     89 * halts/stops the CPU.
     90 *
     91 * Port Specific Information:
     92 *
     93 * XXX document implementation including references if appropriate
     94 */
     95RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     96
     97/* end of Fatal Error manager macros */
     98
     99/**
    87100 * @addtogroup RTEMSScoreCPUExampleContext
    88101 *
  • cpukit/score/cpu/or1k/cpu.c

    rf799b452 r8b65b574  
    1212 */
    1313
     14#include <rtems/score/cpuimpl.h>
    1415#include <rtems/score/isr.h>
    15 #include <rtems/score/cpu.h>
    1616
    1717/* bsp_start_vector_table_begin is the start address of the vector table
     
    2828  /* Do nothing */
    2929}
     30
     31void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     32{
     33  ISR_Level level;
     34
     35  _CPU_ISR_Disable( level );
     36  (void) level;
     37
     38  _OR1KSIM_CPU_Halt();
     39
     40  while ( true ) {
     41    /* Do nothing */
     42  }
     43}
     44
     45/* end of Fatal Error manager macros */
    3046
    3147/**
  • cpukit/score/cpu/or1k/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    391391/* end of Context handler macros */
    392392
    393 /* Fatal Error manager macros */
    394 
    395 /*
    396  *  This routine copies _error into a known place -- typically a stack
    397  *  location or a register, optionally disables interrupts, and
    398  *  halts/stops the CPU.
    399  *
    400  */
    401 
    402 #include <inttypes.h>
    403 
    404 #define _CPU_Fatal_halt(_source, _error ) \
    405         _OR1KSIM_CPU_Halt(); \
    406         for(;;)
    407 
    408 /* end of Fatal Error manager macros */
    409 
    410393#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    411394
  • cpukit/score/cpu/or1k/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840void _CPU_Context_volatile_clobber( uintptr_t pattern );
    3941
  • cpukit/score/cpu/powerpc/cpu.c

    rf799b452 r8b65b574  
    326326  CPU_Exception_frame
    327327);
     328
     329void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     330{
     331  ppc_interrupt_disable();
     332  __asm__ volatile (
     333    "mr 3, %0\n"
     334    "mr 4, %1\n"
     335    "1:\n"
     336    "b 1b\n"
     337    : \
     338    : "r" (source), "r" (error)
     339    : "memory"
     340  );
     341}
  • cpukit/score/cpu/powerpc/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    614614#endif /* ASM */
    615615
    616 #define _CPU_Fatal_halt( _source, _error ) \
    617   do { \
    618     ppc_interrupt_disable(); \
    619     __asm__ volatile ( \
    620       "mr 3, %0\n" \
    621       "mr 4, %1\n" \
    622       "1:\n" \
    623       "b 1b\n" \
    624       : \
    625       : "r" (_source), "r" (_error) \
    626       : "memory" \
    627     ); \
    628   } while ( 0 )
    629 
    630616/*
    631617 *  Should be large enough to run all RTEMS tests.  This ensures
  • cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    249249#endif /* RTEMS_SMP */
    250250
     251RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     252
    251253void _CPU_Context_volatile_clobber( uintptr_t pattern );
    252254
  • cpukit/score/cpu/riscv/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    211211#define _CPU_Context_Restart_self( _the_context ) \
    212212   _CPU_Context_restore( (_the_context) )
    213 
    214 RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    215213
    216214#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
  • cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    409409#endif /* RTEMS_SMP */
    410410
     411RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     412
    411413void _CPU_Context_volatile_clobber( uintptr_t pattern );
    412414
  • cpukit/score/cpu/sh/cpu.c

    rf799b452 r8b65b574  
    3131#endif
    3232
     33#include <rtems/score/cpuimpl.h>
    3334#include <rtems/score/isr.h>
    3435#include <rtems/score/sh_io.h>
    35 #include <rtems/score/cpu.h>
    3636#include <rtems/score/sh.h>
    3737
     
    7575  /* enable interrupts */
    7676  _CPU_ISR_Set_level( level ) ;
     77}
     78
     79void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     80{
     81  __asm__ volatile("mov.l %0,r0"::"m" (error));
     82  __asm__ volatile("mov #1, r4");
     83  __asm__ volatile("trapa #34");
    7784}
    7885
  • cpukit/score/cpu/sh/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    491491/* end of Context handler macros */
    492492
    493 /* Fatal Error manager macros */
    494 
    495 /*
    496  * FIXME: Trap32 ???
    497  *
    498  *  This routine copies _error into a known place -- typically a stack
    499  *  location or a register, optionally disables interrupts, and
    500  *  invokes a Trap32 Instruction which returns to the breakpoint
    501  *  routine of cmon.
    502  */
    503 
    504 #ifdef BSP_FATAL_HALT
    505   /* we manage the fatal error in the board support package */
    506   void bsp_fatal_halt( uint32_t   _error);
    507 #define _CPU_Fatal_halt( _source, _error ) bsp_fatal_halt( _error)
    508 #else
    509 #define _CPU_Fatal_halt( _source, _error)\
    510 { \
    511   __asm__ volatile("mov.l %0,r0"::"m" (_error)); \
    512   __asm__ volatile("mov #1, r4"); \
    513   __asm__ volatile("trapa #34"); \
    514 }
    515 #endif
    516 
    517 /* end of Fatal Error manager macros */
    518 
    519493#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    520494
  • cpukit/score/cpu/sh/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/sparc/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    884884/* end of Context handler macros */
    885885
    886 /* Fatal Error manager macros */
    887 
    888 /**
    889  * This routine copies _error into a known place -- typically a stack
    890  * location or a register, optionally disables interrupts, and
    891  * halts/stops the CPU.
    892  */
    893 RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, uint32_t error );
    894 
    895 /* end of Fatal Error manager macros */
    896 
    897886#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
    898887
  • cpukit/score/cpu/sparc/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    200200#define _CPU_Get_thread_executing() ( _SPARC_Per_CPU_current->executing )
    201201
     202RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     203
    202204void _CPU_Context_volatile_clobber( uintptr_t pattern );
    203205
  • cpukit/score/cpu/sparc64/cpu.c

    rf799b452 r8b65b574  
    1717 */
    1818
     19#include <rtems/score/cpuimpl.h>
    1920#include <rtems/score/isr.h>
    2021#include <rtems/score/tls.h>
     
    6263   */
    6364  _CPU_ISR_Dispatch_disable = 0;
     65}
     66
     67void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     68{
     69  uint32_t   level;
     70
     71  level = sparc_disable_interrupts();
     72  __asm__ volatile ( "mov  %0, %%g1 " : "=r" (level) : "0" (level) );
     73  while (1); /* loop forever */
    6474}
    6575
  • cpukit/score/cpu/sparc64/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    770770/* end of Context handler macros */
    771771
    772 /* Fatal Error manager macros */
    773 
    774 /*
    775  *  This routine copies _error into a known place -- typically a stack
    776  *  location or a register, optionally disables interrupts, and
    777  *  halts/stops the CPU.
    778  */
    779 
    780 #define _CPU_Fatal_halt( _source, _error ) \
    781   do { \
    782     uint32_t   level; \
    783     \
    784     level = sparc_disable_interrupts(); \
    785     __asm__ volatile ( "mov  %0, %%g1 " : "=r" (level) : "0" (level) ); \
    786     while (1); /* loop forever */ \
    787   } while (0)
    788 
    789 /* end of Fatal Error manager macros */
    790 
    791772#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
    792773
  • cpukit/score/cpu/sparc64/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/v850/cpu.c

    rf799b452 r8b65b574  
    1818#endif
    1919
     20#include <rtems/score/cpuimpl.h>
    2021#include <rtems/score/isr.h>
    2122
     
    2930void _CPU_Initialize(void)
    3031{
     32}
     33
     34void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     35{
     36  __asm__ __volatile__ ( "di" );
     37  __asm__ __volatile__ ( "mov %0, r10; " : "=r" ((error)) );
     38  __asm__ __volatile__ ( "halt" );
    3139}
    3240
  • cpukit/score/cpu/v850/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    462462/* end of Context handler macros */
    463463
    464 /* Fatal Error manager macros */
    465 
    466 /**
    467  * This routine copies _error into a known place -- typically a stack
    468  * location or a register, optionally disables interrupts, and
    469  * halts/stops the CPU.
    470  *
    471  * Port Specific Information:
    472  *
    473  * Move the error code into r10, disable interrupts and halt.
    474  */
    475 #define _CPU_Fatal_halt( _source, _error ) \
    476   do { \
    477     __asm__ __volatile__ ( "di" ); \
    478     __asm__ __volatile__ ( "mov %0, r10; " : "=r" ((_error)) ); \
    479     __asm__ __volatile__ ( "halt" ); \
    480   } while (0)
    481 
    482 /* end of Fatal Error manager macros */
    483 
    484464#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    485465
  • cpukit/score/cpu/v850/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3636#endif
    3737
     38RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     39
    3840RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    3941{
  • cpukit/score/cpu/x86_64/cpu.c

    rf799b452 r8b65b574  
    3838#endif
    3939
     40#include <rtems/score/cpuimpl.h>
    4041#include <rtems/score/idt.h>
    4142#include <rtems/score/isr.h>
     
    4950{
    5051}
     52
     53void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error )
     54{
     55  ISR_Level level;
     56
     57  _CPU_ISR_Disable( level );
     58  (void) level;
     59
     60  while ( true ) {
     61    /* Do nothing */
     62  }
     63}
  • cpukit/score/cpu/x86_64/include/rtems/score/cpu.h

    rf799b452 r8b65b574  
    233233/* end of Context handler macros */
    234234
    235 /* Fatal Error manager macros */
    236 
    237 #define _CPU_Fatal_halt( _source, _error ) \
    238   { \
    239   }
    240 
    241 /* end of Fatal Error manager macros */
    242 
    243235#define CPU_USE_LIBC_INIT_FINI_ARRAY FALSE
    244236
  • cpukit/score/cpu/x86_64/include/rtems/score/cpuimpl.h

    rf799b452 r8b65b574  
    3939#endif
    4040
     41RTEMS_NO_RETURN void _CPU_Fatal_halt( uint32_t source, CPU_Uint32ptr error );
     42
    4143RTEMS_INLINE_ROUTINE void _CPU_Context_volatile_clobber( uintptr_t pattern )
    4244{
  • cpukit/score/src/interr.c

    rf799b452 r8b65b574  
    2222
    2323#include <rtems/score/interr.h>
     24#include <rtems/score/cpuimpl.h>
    2425#include <rtems/score/smpimpl.h>
    2526#include <rtems/score/sysstate.h>
     
    3738  _SMP_Request_shutdown();
    3839  _CPU_Fatal_halt( the_source, the_error );
    39 
    40   /* will not return from this routine */
    41   while (true);
    4240}
    4341
Note: See TracChangeset for help on using the changeset viewer.