_CPU_Fatal_halt does not "halt" on Cyrix MediaGX MMX-S CPU (pc586 BSP)

Ralf Corsepius ralf_corsepius at rtems.org
Mon Oct 18 09:05:12 UTC 2004


On Mon, 2004-10-18 at 10:11, Valery Pykhtin wrote:
> Hi all,
> 
> _CPU_Fatal_halt function doesn't work properly on Cyrix MediaGX MMX-S CPU.
> The macro is defined as follows:
> 
> cpukit\score\cpu\i386\rtems\score\cpu.h
> 
> #define _CPU_Fatal_halt( _error ) \
>   { \
>     asm volatile ( "cli ; \
>                     movl %0,%%eax ; \
>                     hlt" \
>                     : "=r" ((_error)) : "0" ((_error)) \
>     ); \
>   } 
> 
> If I change it to
> 
> #define _CPU_Fatal_halt( _error ) \
>  while(1)  { \
>     asm volatile ( "cli ; \
>                     movl %0,%%eax ; \
>                     hlt" \
>                     : "=r" ((_error)) : "0" ((_error)) \
>     ); \
>   } 
> 
> - all works ok.
> 
> Can it be considered as appropriate patch?

Now, IMO, it actually is a question of what you expect "halting the CPU"
to do. Some BSPs/users/applications will expect a "reset/reboot on fatal
error", some will expect "busy waiting until reset-button pressed",
others will expect program execution flow to "enter a monitor".

So, in general, I'd expect a "_CPU_Fatal_error" to return to whatever
started the RTEMS executable (startup code, monitor, gdb-stub or
similar) and "busy-waiting etc." to be handled there.

To put it differently: IMO, the currently implementation is questionable
and so is your proposal.

Ralf





More information about the users mailing list