diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-18 18:07:20 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-18 18:07:20 +0000 |
commit | ead311b8bf7f286d9a5be8fd8b56824e65815e43 (patch) | |
tree | fb0347c1edc242c5c69e0d10a156f622a2ce4877 /c | |
parent | Spacing. (diff) | |
download | rtems-ead311b8bf7f286d9a5be8fd8b56824e65815e43.tar.bz2 |
2007-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, vectors/vectors_init.c: Print stack trace on exception.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/ChangeLog | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/Makefile.am | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c | 51 |
3 files changed, 30 insertions, 26 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog index d7748fa8c0..7cf8ca5226 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog +++ b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog @@ -1,3 +1,7 @@ +2007-07-18 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, vectors/vectors_init.c: Print stack trace on exception. + 2007-07-12 Joel Sherrill <joel.sherrill@OARcorp.com> * startup/linkcmds.brs5l: Add .jcr section. diff --git a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am index 036f124587..608a288a55 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/Makefile.am +++ b/c/src/lib/libbsp/powerpc/gen5200/Makefile.am @@ -146,6 +146,7 @@ libbsp_a_LIBADD += network.rel endif libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \ ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \ + ../../../libcpu/@RTEMS_CPU@/shared/stack.rel \ ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \ ../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \ ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel \ diff --git a/c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c b/c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c index 5f7950c32c..9d9e5869ce 100644 --- a/c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c +++ b/c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c @@ -138,69 +138,68 @@ void C_exception_handler(BSP_Exception_frame* excPtr) #else recoverable = 0; #endif - if (!recoverable) { - printk("unrecoverable exception!!! Push reset button\n"); - while(1); - - } #endif - + CPU_print_stack(); + if (!recoverable) { + printk("unrecoverable exception!!! Push reset button\n"); + bsp_cleanup(); + } } void nop_except_enable(const rtems_raw_except_connect_data* ptr) { } + int except_always_enabled(const rtems_raw_except_connect_data* ptr) { return 1; } void initialize_exceptions() - { +{ int i; /* * Initialize pointer used by low level execption handling */ - globalExceptHdl = C_exception_handler; + globalExceptHdl = C_exception_handler; /* * Put default_exception_vector_code_prolog at relevant exception * code entry addresses */ - exception_config.exceptSize = LAST_VALID_EXC + 1; - exception_config.rawExceptHdlTbl = &exception_table[0]; - exception_config.defaultRawEntry.exceptIndex = 0; - exception_config.defaultRawEntry.hdl.vector = 0; - exception_config.defaultRawEntry.hdl.raw_hdl = default_exception_vector_code_prolog; + exception_config.exceptSize = LAST_VALID_EXC + 1; + exception_config.rawExceptHdlTbl = &exception_table[0]; + exception_config.defaultRawEntry.exceptIndex = 0; + exception_config.defaultRawEntry.hdl.vector = 0; + exception_config.defaultRawEntry.hdl.raw_hdl = default_exception_vector_code_prolog; /* * Note that next line the '&' before default_exception_vector_code_prolog_size * is not a bug as it is defined a .set directly in asm... */ - exception_config.defaultRawEntry.hdl.raw_hdl_size = (unsigned) &default_exception_vector_code_prolog_size; + exception_config.defaultRawEntry.hdl.raw_hdl_size = + (unsigned) &default_exception_vector_code_prolog_size; - for (i=0; i <= exception_config.exceptSize; i++) - { + for (i=0; i <= exception_config.exceptSize; i++) { #if defined(SHOW_MORE_INIT_SETTINGS) printk("installing exception number %d\n", i); #endif - if (!ppc_vector_is_valid(i)) - continue; + if (!ppc_vector_is_valid(i)) + continue; - exception_table[i].exceptIndex = i; - exception_table[i].hdl = exception_config.defaultRawEntry.hdl; - exception_table[i].hdl.vector = i; - exception_table[i].on = nop_except_enable; - exception_table[i].off = nop_except_enable; - exception_table[i].isOn = except_always_enabled; + exception_table[i].exceptIndex = i; + exception_table[i].hdl = exception_config.defaultRawEntry.hdl; + exception_table[i].hdl.vector = i; + exception_table[i].on = nop_except_enable; + exception_table[i].off = nop_except_enable; + exception_table[i].isOn = except_always_enabled; } if (!ppc_init_exceptions(&exception_config)) BSP_panic("Exception handling initialization failed\n"); else printk("Exception handling initialization done\n"); - - } +} |