summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/new-exceptions
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-14 09:57:55 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-15 15:33:13 +0100
commitb1e8a580bc73cdde0ddb9888c4f70afbf3ba0fb0 (patch)
tree8307d372aaf701a2037cd829051948d341565278 /c/src/lib/libcpu/powerpc/new-exceptions
parentbsps: Interrupt initialization error is fatal (diff)
downloadrtems-b1e8a580bc73cdde0ddb9888c4f70afbf3ba0fb0.tar.bz2
bsps/powerpc: Exception initialization error is fatal
Diffstat (limited to 'c/src/lib/libcpu/powerpc/new-exceptions')
-rw-r--r--c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c21
-rw-r--r--c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h16
2 files changed, 24 insertions, 13 deletions
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c
index 1f0d32646b..d9bb872f57 100644
--- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c
+++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c
@@ -12,7 +12,7 @@
*
* Copyright (C) 2007 Till Straumann <strauman@slac.stanford.edu>
*
- * Copyright (C) 2009 embedded brains GmbH.
+ * Copyright (C) 2009-2012 embedded brains GmbH.
*
* Derived from file "libcpu/powerpc/new-exceptions/bspsupport/vectors_init.c".
* Derived from file "libcpu/powerpc/new-exceptions/e500_raw_exc_init.c".
@@ -25,6 +25,7 @@
#include <rtems.h>
#include <bsp/vectors.h>
+#include <bsp/bootcard.h>
uint32_t ppc_exc_cache_wb_check = 1;
@@ -71,7 +72,15 @@ static void ppc_exc_initialize_booke(void)
}
}
-rtems_status_code ppc_exc_initialize(
+static void ppc_exc_fatal_error(void)
+{
+ rtems_fatal(
+ RTEMS_FATAL_SOURCE_BSP_GENERIC,
+ BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION
+ );
+}
+
+void ppc_exc_initialize(
uint32_t interrupt_disable_mask,
uintptr_t interrupt_stack_begin,
uintptr_t interrupt_stack_size
@@ -86,7 +95,7 @@ rtems_status_code ppc_exc_initialize(
uint32_t r13 = 0;
if (categories == NULL) {
- return RTEMS_NOT_IMPLEMENTED;
+ ppc_exc_fatal_error();
}
/* Assembly code needs SDA_BASE in r13 (SVR4 or EABI). Make sure
@@ -100,7 +109,7 @@ rtems_status_code ppc_exc_initialize(
);
if (sda_base != r13) {
- return RTEMS_NOT_CONFIGURED;
+ ppc_exc_fatal_error();
}
/* Ensure proper interrupt stack alignment */
@@ -137,7 +146,7 @@ rtems_status_code ppc_exc_initialize(
sc = ppc_exc_make_prologue(vector, category, prologue, &prologue_size);
if (sc != RTEMS_SUCCESSFUL) {
- return RTEMS_INTERNAL_ERROR;
+ ppc_exc_fatal_error();
}
ppc_code_copy(vector_address, prologue, prologue_size);
@@ -175,6 +184,4 @@ rtems_status_code ppc_exc_initialize(
__asm__ volatile ("dcbz 0, %0"::"b" (p));
/* If we make it thru here then things seem to be OK */
}
-
- return RTEMS_SUCCESSFUL;
}
diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h
index 1a071c27c3..9ba72db7a8 100644
--- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h
+++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h
@@ -428,13 +428,17 @@ rtems_status_code ppc_exc_make_prologue(
/**
* @brief Initializes the exception handling.
*
- * @retval RTEMS_SUCCESSFUL Successful initialization.
- * @retval RTEMS_NOT_IMPLEMENTED No category set available for the current CPU.
- * @retval RTEMS_NOT_CONFIGURED Register r13 does not point to the small data
- * area anchor required by SVR4/EABI.
- * @retval RTEMS_INTERNAL_ERROR Minimal prologue creation failed.
+ * If the initialization fails, then this is a fatal error. The fatal error
+ * source is RTEMS_FATAL_SOURCE_BSP_GENERIC and the fatal error code is
+ * BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION.
+ *
+ * Possible error reasons are
+ * - no category set available for the current CPU,
+ * - the register r13 does not point to the small data area anchor required by
+ * SVR4/EABI, or
+ * - the minimal prologue creation failed.
*/
-rtems_status_code ppc_exc_initialize(
+void ppc_exc_initialize(
uint32_t interrupt_disable_mask,
uintptr_t interrupt_stack_begin,
uintptr_t interrupt_stack_size