summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-10 16:41:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-08-10 16:41:44 +0000
commit981b99faf208e2c7f6e2b83d73e1b89b669112ee (patch)
tree1f2e2b431853a81be77417c1026c75c53e04d5ea /c/src/lib/libbsp/powerpc/motorola_powerpc/vectors
parentNew configuration files added by patch from (diff)
downloadrtems-981b99faf208e2c7f6e2b83d73e1b89b669112ee.tar.bz2
Patch from Eric Valette <valette@crf.canon.fr> and Emmanuel Raguet
<raguet@crf.canon.fr>: - the dec21140 driver code has been hardened (various bug fixed) Emmanuel, - bug in the mcp750 init code have been fixed (interrupt stack/initial stack initialization), BSS correctly cleared (Eric V) - remote debugging over TCP/IP is nearly complete (berakpoints, backtrace, variables,...) (Eric V), - exception handling code has also been improved in order to fully support RDBG requirements (Eric V),
Diffstat (limited to 'c/src/lib/libbsp/powerpc/motorola_powerpc/vectors')
-rw-r--r--c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.S24
-rw-r--r--c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.h11
-rw-r--r--c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors_init.c18
3 files changed, 41 insertions, 12 deletions
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.S b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.S
index 7fe6a82f73..fca0cbfac1 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.S
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.S
@@ -86,6 +86,14 @@ SYM (push_normalized_frame):
stw r30, EXC_CTR_OFFSET(r1)
mfxer r28
stw r28, EXC_XER_OFFSET(r1)
+ /*
+ * compute SP at exception entry
+ */
+ addi r2, r1, EXCEPTION_FRAME_END
+ /*
+ * store it at the right place
+ */
+ stw r2, GPR1_OFFSET(r1)
/*
* Enable data and instruction address translation, exception nesting
*/
@@ -97,8 +105,17 @@ SYM (push_normalized_frame):
/*
* Call C exception handler
*/
+ /*
+ * store the execption frame address in r3 (first param)
+ */
addi r3, r1, 0x8
- bl C_exception_handler
+ /*
+ * globalExceptHdl(r3)
+ */
+ addis r4, 0, globalExceptHdl@ha
+ lwz r5, globalExceptHdl@l(r4)
+ mtlr r5
+ blrl
/*
* Restore registers status
*/
@@ -135,8 +152,3 @@ SYM (push_normalized_frame):
addi r1,r1, EXCEPTION_FRAME_END
SYNC
rfi
-
-
-
-
-
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.h b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.h
index 8b871d74e1..101f46f121 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.h
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors.h
@@ -128,9 +128,16 @@ typedef struct {
unsigned EXC_LR;
unsigned EXC_MSR;
unsigned EXC_DAR;
-} exception_frame;
+}BSP_Exception_frame;
-extern void C_exception_handler(exception_frame* excPtr);
+
+typedef void (*exception_handler_t) (BSP_Exception_frame* excPtr);
+extern exception_handler_t globalExceptHdl;
+/*
+ * Compatibility with pc386
+ */
+typedef BSP_Exception_frame CPU_Exception_frame;
+typedef exception_handler_t cpuExcHandlerType;
#endif /* ASM */
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors_init.c b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors_init.c
index 83adc22db1..7310fbd2c5 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors_init.c
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/vectors/vectors_init.c
@@ -19,7 +19,9 @@
static rtems_raw_except_global_settings exception_config;
static rtems_raw_except_connect_data exception_table[LAST_VALID_EXC + 1];
-void C_exception_handler(exception_frame* excPtr)
+exception_handler_t globalExceptHdl;
+
+void C_exception_handler(BSP_Exception_frame* excPtr)
{
int recoverable = 0;
@@ -81,9 +83,17 @@ int except_always_enabled(const rtems_raw_except_connect_data* ptr)
void initialize_exceptions()
{
int i;
-
- exception_config.exceptSize = LAST_VALID_EXC + 1;
- exception_config.rawExceptHdlTbl = &exception_table[0];
+
+ /*
+ * Initialize pointer used by low level execption handling
+ */
+ 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;