[PATCH 14/16] bsps: Exception initialization error is fatal
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Nov 14 15:47:08 UTC 2012
---
c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/gen5200/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/gen83xx/startup/bspstart.c | 5 +---
.../libbsp/powerpc/haleakala/startup/bspstart.c | 6 +----
c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c | 6 +----
.../libbsp/powerpc/mpc55xxevb/startup/bspstart.c | 7 +-----
.../libbsp/powerpc/mpc8260ads/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/mvme3100/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/mvme5500/startup/bspstart.c | 6 +----
c/src/lib/libbsp/powerpc/psim/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/qemuppc/startup/bspstart.c | 5 +---
c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c | 6 +----
.../libbsp/powerpc/score603e/startup/bspstart.c | 6 +----
c/src/lib/libbsp/powerpc/shared/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/t32mppc/startup/bspstart.c | 7 +-----
c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c | 6 +----
c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c | 6 +----
.../lib/libbsp/powerpc/virtex4/startup/bspstart.c | 8 ++----
.../lib/libbsp/powerpc/virtex5/startup/bspstart.c | 8 ++----
c/src/lib/libbsp/shared/include/bootcard.h | 1 +
c/src/lib/libbsp/shared/include/irq-generic.h | 13 ++++++-----
.../new-exceptions/bspsupport/ppc_exc_initialize.c | 21 +++++++++++++------
.../powerpc/new-exceptions/bspsupport/vectors.h | 16 +++++++++-----
23 files changed, 55 insertions(+), 114 deletions(-)
diff --git a/c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c b/c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c
index 7d2ae9f..a766579 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c
@@ -275,7 +275,6 @@ void Read_ep1a_config_registers( ppc_cpu_id_t myCpu ) {
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
uintptr_t intrStackStart;
uintptr_t intrStackSize;
ppc_cpu_id_t myCpu;
@@ -320,14 +319,11 @@ ShowBATS();
/*
* Initialize default raw exception hanlders.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/*
* Init MMU block address translation to enable hardware
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
index b71d6c5..c733295 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
@@ -125,7 +125,6 @@ void _BSP_Fatal_error(unsigned int v)
void bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -173,14 +172,11 @@ void bsp_start(void)
/* Initialize exception handler */
ppc_exc_cache_wb_check = 0;
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) bsp_interrupt_stack_start,
(uintptr_t) bsp_interrupt_stack_size
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
/* Initalize interrupt support */
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
index 6baf0ca..f60d1be 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c
@@ -134,14 +134,11 @@ void bsp_start( void)
#ifndef BSP_DATA_CACHE_ENABLED
ppc_exc_cache_wb_check = 0;
#endif
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
interrupt_stack_start,
interrupt_stack_size
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/* Install default handler for the decrementer exception */
sc = ppc_exc_set_handler( ASM_DEC_VECTOR, mpc83xx_decrementer_exception_handler);
diff --git a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
index d984a7a..078a469 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
@@ -170,7 +170,6 @@ BSP_polling_getchar_function_type BSP_poll_char = NULL;
*/
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -203,14 +202,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) intrStack_start,
(uintptr_t) intrStack_size
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/*
* Install our own set of exception vectors
diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c
index 1e76c45..09d4fab 100644
--- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c
@@ -82,7 +82,6 @@ void _BSP_Fatal_error(unsigned int v)
*/
void bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -113,14 +112,11 @@ void bsp_start(void)
#endif
/* Initialize exception handler */
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) IntrStack_start,
(uintptr_t) intrStack - (uintptr_t) IntrStack_start
);
- if ( sc != RTEMS_SUCCESSFUL ) {
- BSP_panic( "cannot initialize exceptions" );
- }
/* Initalize interrupt support */
bsp_interrupt_initialize();
diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
index d6a29e4..bad5a6f 100644
--- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c
@@ -90,7 +90,6 @@ static void null_pointer_protection(void)
void bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -118,15 +117,11 @@ void bsp_start(void)
bsp_clicks_per_usec = bsp_clock_speed / 1000000;
/* Initialize exceptions */
- ppc_exc_vector_base = (uint32_t) mpc55xx_exc_vector_base;
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) bsp_section_work_begin,
rtems_configuration_get_interrupt_stack_size()
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic( "Cannot initialize exceptions");
- }
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
/* Initialize interrupts */
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
index d1f91f0..d736f24 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
@@ -148,7 +148,6 @@ void _BSP_Uart2_disable(void)
void bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -173,14 +172,11 @@ void bsp_start(void)
/* Initialize exception handler */
/* FIXME: Interrupt stack begin and size */
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) IntrStack_start,
(uintptr_t) intrStack - (uintptr_t) IntrStack_start
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot intitialize exceptions");
- }
/* Initalize interrupt support */
bsp_interrupt_initialize();
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
index edf8ea1..9830b6c 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme3100/startup/bspstart.c
@@ -217,7 +217,6 @@ SPR_RW(HID1)
void bsp_start( void )
{
-rtems_status_code sc;
unsigned char *stack;
uintptr_t intrStackStart;
uintptr_t intrStackSize;
@@ -270,14 +269,11 @@ VpdBufRec vpdData [] = {
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
printk("CPU 0x%x - rev 0x%x\n", myCpu, myCpuRevision);
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
index 259935e..1ea4c67 100644
--- a/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mvme5500/startup/bspstart.c
@@ -187,7 +187,6 @@ save_boot_params(
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
#ifdef CONF_VPD
int i;
#endif
@@ -245,14 +244,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/*
* Init MMU block address translation to enable hardware
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
index 29cbb76..2689f5a 100644
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
@@ -77,7 +77,6 @@ void _BSP_Fatal_error(unsigned int v)
*/
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
uintptr_t intrStackStart;
uintptr_t intrStackSize;
@@ -110,14 +109,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/*
* Initalize RTEMS IRQ system
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c
index 4c10af9..4a0a66f 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qemuppc/startup/bspstart.c
@@ -91,14 +91,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/* Install default handler for the decrementer exception */
sc = ppc_exc_set_handler( ASM_DEC_VECTOR, default_decrementer_exception_handler);
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
index d76dae5..9264fab 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspstart.c
@@ -72,7 +72,6 @@ void _BSP_Fatal_error(unsigned n)
void bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
unsigned long i = 0;
ppc_cpu_id_t myCpu;
@@ -109,14 +108,11 @@ void bsp_start(void)
/* Initialize exception handler */
ppc_exc_vector_base = (uint32_t) bsp_exc_vector_base;
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) bsp_section_work_begin,
rtems_configuration_get_interrupt_stack_size()
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/* Now it is possible to make the code execute only */
qoriq_mmu_change_perm(
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c b/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
index 7962127..8739efb 100644
--- a/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/score603e/startup/bspstart.c
@@ -150,7 +150,6 @@ void initialize_PMC(void) {
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
unsigned int msr_value = 0x0000;
uintptr_t intrStackStart;
uintptr_t intrStackSize;
@@ -194,14 +193,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
msr_value = 0x2030;
_CPU_MSR_SET( msr_value );
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c b/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
index 3f5b220..a59c7eb 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
@@ -135,7 +135,6 @@ unsigned int get_eumbbar(void) {
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
#if !defined(mvme2100)
unsigned l2cr;
#endif
@@ -232,14 +231,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
intrStackStart,
intrStackSize
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
boardManufacturer = checkPrepBoardType(&residualCopy);
if (boardManufacturer != PREP_Motorola) {
diff --git a/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c b/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
index 50db2cd..089c1c4 100644
--- a/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c
@@ -60,21 +60,16 @@ void _BSP_Fatal_error(unsigned n)
void bsp_start(void)
{
- rtems_status_code sc;
-
get_ppc_cpu_type();
get_ppc_cpu_revision();
/* Initialize exception handler */
ppc_exc_vector_base = (uint32_t) bsp_exc_vector_base;
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uintptr_t) bsp_section_work_begin,
rtems_configuration_get_interrupt_stack_size()
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/* Initalize interrupt support */
bsp_interrupt_initialize();
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
index 7657390..fca3531 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
@@ -129,7 +129,6 @@ rtems_status_code bsp_tqm_get_cib_uint32( const char *cib_id,
void bsp_start( void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -182,14 +181,11 @@ void bsp_start( void)
bsp_timer_average_overhead = 3;
/* Initialize exception handler */
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
interrupt_stack_start,
interrupt_stack_size
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/* Initalize interrupt support */
bsp_interrupt_initialize();
diff --git a/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
index 843dddd..9a4dc9f 100644
--- a/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex/startup/bspstart.c
@@ -104,7 +104,6 @@ void bsp_XAssertHandler(const char* file, int line) {
*/
void bsp_start( void )
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
ppc_cpu_id_t myCpu;
ppc_cpu_revision_t myCpuRevision;
@@ -134,14 +133,11 @@ void bsp_start( void )
/*
* Initialize default raw exception handlers.
*/
- sc = ppc_exc_initialize(
+ ppc_exc_initialize(
PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
(uint32_t)IntrStack_start,
IntrStack_end - IntrStack_start
);
- if (sc != RTEMS_SUCCESSFUL) {
- BSP_panic("cannot initialize exceptions");
- }
/*
* Install our own set of exception vectors
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
index f995264..2aab2c2 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
@@ -104,7 +104,6 @@ LINKER_SYMBOL(__phy_ram_end);
static void _noopfun(void) {}
static void _bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
uintptr_t intrStackStart = CPU_UP_ALIGN((uint32_t)__bsp_ram_start);
uintptr_t intrStackSize = rtems_configuration_get_interrupt_stack_size();
@@ -115,10 +114,9 @@ static void _bsp_start(void)
* FPGA, so the external interrupt should not be enabled in order to avoid
* spurious interrupts.
*/
- sc = ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT & ~MSR_EE,
- intrStackStart,
- intrStackSize);
- if (sc != RTEMS_SUCCESSFUL) BSP_panic("Cannot initialize exceptions");
+ ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT & ~MSR_EE,
+ intrStackStart,
+ intrStackSize);
/* Install our own set of exception vectors */
BSP_rtems_irq_mngt_init(0);
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
index 31872d4..8847dc8 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
@@ -104,7 +104,6 @@ LINKER_SYMBOL(__phy_ram_end);
static void _noopfun(void) {}
static void _bsp_start(void)
{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
uintptr_t intrStackStart = CPU_UP_ALIGN((uint32_t)__bsp_ram_start);
uintptr_t intrStackSize = rtems_configuration_get_interrupt_stack_size();
@@ -115,10 +114,9 @@ static void _bsp_start(void)
* FPGA, so the external interrupt should not be enabled in order to avoid
* spurious interrupts.
*/
- sc = ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT & ~MSR_EE,
- intrStackStart,
- intrStackSize);
- if (sc != RTEMS_SUCCESSFUL) BSP_panic("Cannot initialize exceptions");
+ ppc_exc_initialize(PPC_INTERRUPT_DISABLE_MASK_DEFAULT & ~MSR_EE,
+ intrStackStart,
+ intrStackSize);
/* Install our own set of exception vectors */
BSP_rtems_irq_mngt_init(0);
diff --git a/c/src/lib/libbsp/shared/include/bootcard.h b/c/src/lib/libbsp/shared/include/bootcard.h
index 610f175..237b76d 100644
--- a/c/src/lib/libbsp/shared/include/bootcard.h
+++ b/c/src/lib/libbsp/shared/include/bootcard.h
@@ -54,6 +54,7 @@ extern "C" {
* @brief Generic BSP fatal error codes.
*/
typedef enum {
+ BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION,
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
} bsp_generic_fatal_code;
diff --git a/c/src/lib/libbsp/shared/include/irq-generic.h b/c/src/lib/libbsp/shared/include/irq-generic.h
index e3f4d07..d365c0c 100644
--- a/c/src/lib/libbsp/shared/include/irq-generic.h
+++ b/c/src/lib/libbsp/shared/include/irq-generic.h
@@ -9,12 +9,13 @@
/*
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
*
- * Copyright (c) 2008, 2009, 2010
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems at embedded-brains.de>
+ * Copyright (c) 2008-2012 embedded brains GmbH.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems at embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
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 1f0d326..d9bb872 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 at 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 1a071c2..9ba72db 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
--
1.7.7
More information about the devel
mailing list