summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-20 21:32:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-20 21:32:07 +0000
commit4f3e4f33db96df1182c0fb24c987fd9cbed95062 (patch)
tree791e7ffa208a92511c7f899ec4905b8afe24f9c3 /c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
parent2003-02-20 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-4f3e4f33db96df1182c0fb24c987fd9cbed95062.tar.bz2
2003-02-20 Till Straumann <strauman@slac.stanford.edu>
PR 349/bsps * console/console.c, console/uart.c, console/uart.h: implement IOCTLs for the serial (UART) console to install/retrieve a BREAK-IRQ callback. The callback routine (if installed) is invoked from the UART ISR when a BREAK interrupt is detected. This can be used e.g. to enforce a "hotkey" reboot a la vxWorks Ctrl-X (although we use the serial line break condition) NOTE: The callback runs in ISR context.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c b/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
index cb4c44b348..6a49a95a30 100644
--- a/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
+++ b/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
@@ -16,6 +16,7 @@
#include <bsp/vectors.h>
#include <libcpu/raw_exception.h>
+#include <libcpu/spr.h>
#include <bsp.h>
static rtems_raw_except_global_settings exception_config;
@@ -33,16 +34,28 @@ typedef struct LRFrameRec_ {
#define STACK_CLAMP 50 /* in case we have a corrupted bottom */
+SPR_RO(LR)
+
void
BSP_printStackTrace(BSP_Exception_frame* excPtr)
{
-LRFrame f;
-int i;
+LRFrame f;
+int i;
+LRFrame sp;
+void *lr;
- printk("Stack Trace: ");
- printk(" IP: 0x%08x, LR: 0x%08x\n",
- excPtr->EXC_SRR0, excPtr->EXC_LR);
- for (f=(LRFrame)excPtr->GPR1, i=0; f->frameLink && i<STACK_CLAMP; f=f->frameLink) {
+ printk("Stack Trace: \n ");
+ if (excPtr) {
+ printk("IP: 0x%08x, ",excPtr->EXC_SRR0);
+ sp=(LRFrame)excPtr->GPR1;
+ lr=(void*)excPtr->EXC_LR;
+ } else {
+ /* there's no macro for this */
+ __asm__ __volatile__("mr %0, 1":"=r"(sp));
+ lr=(LRFrame)_read_LR();
+ }
+ printk("LR: 0x%08x\n",lr);
+ for (f=(LRFrame)sp, i=0; f->frameLink && i<STACK_CLAMP; f=f->frameLink) {
printk("--^ 0x%08x", (long)(f->frameLink->lr));
if (!(++i%5))
printk("\n");