diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-02 13:35:02 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-02 13:35:02 +0000 |
commit | 48816d7d7a60a8bc07ef3fe397ad20657761d284 (patch) | |
tree | 5849908364b2d6b1e97444233bcd2d20572a9a1c /cpukit/score/cpu/sparc/rtems/score/cpu.h | |
parent | Assume gdb >= 6.4 (diff) | |
download | rtems-48816d7d7a60a8bc07ef3fe397ad20657761d284.tar.bz2 |
2007-11-02 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/cpu/sparc/cpu.c, score/cpu/sparc/rtems/score/cpu.h,
score/include/rtems/score/context.h, score/src/threadhandler.c: Fix
stack so gdb backtrace does not print corrupted frame message after
_Thread_Handler. Daniel Hellstrom <daniel@gaisler.com> provided the
SPARC implementation and I made it more general.
Diffstat (limited to 'cpukit/score/cpu/sparc/rtems/score/cpu.h')
-rw-r--r-- | cpukit/score/cpu/sparc/rtems/score/cpu.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h index dfe9978c7f..8396d2c31f 100644 --- a/cpukit/score/cpu/sparc/rtems/score/cpu.h +++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h @@ -791,6 +791,25 @@ void _CPU_Context_Initialize( ); /* + * This macro is invoked from _Thread_Handler to do whatever CPU + * specific magic is required that must be done in the context of + * the thread when it starts. + * + * On the SPARC, this is setting the frame pointer so GDB is happy. + * Make GDB stop unwinding at _Thread_Handler, previous register window + * Frame pointer is 0 and calling address must be a function with starting + * with a SAVE instruction. If return address is leaf-function (no SAVE) + * GDB will not look at prev reg window fp. + * + * _Thread_Handler is known to start with SAVE. + */ + +#define _CPU_Context_Initialization_at_thread_begin() \ + do { \ + asm volatile ("set _Thread_Handler,%%i7\n"::); \ + } while (0) + +/* * This routine is responsible for somehow restarting the currently * executing task. * |