bsps: Interrupt initialization error is fatal

This commit is contained in:
Sebastian Huber
2012-11-14 13:59:27 +01:00
parent b9bc399bdd
commit dd8df59413
28 changed files with 61 additions and 116 deletions

View File

@@ -63,9 +63,7 @@ void bsp_start_default( void )
/*
* Init rtems interrupt management
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
} /* bsp_start */
/* Calcuate the frequency for perclk1 */

View File

@@ -62,9 +62,7 @@ void bsp_start_default( void )
/*
* Init rtems interrupt management
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
} /* bsp_start */

View File

@@ -43,9 +43,7 @@ void bsp_start_default( void )
/*
* Init rtems interrupt management
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
} /* bsp_start */
/*

View File

@@ -46,9 +46,7 @@ void bsp_start_default( void )
/* rtems_exception_init_mngt(); */
/* Init rtems interrupt management */
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
}
/**

View File

@@ -92,9 +92,7 @@ void bsp_start_default( void )
/*
* Init rtems interrupt management
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
}
/*

View File

@@ -34,9 +34,7 @@ void bsp_start_default( void )
/* disable interrupts */
XSCALE_INT_ICMR = 0x0;
rtems_exception_init_mngt();
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
} /* bsp_start */
/*

View File

@@ -20,7 +20,5 @@
void bsp_start(void)
{
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
}

View File

@@ -87,9 +87,7 @@ void bsp_start(void)
initialize_console();
/* Interrupts */
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
/* DMA */
lpc24xx_dma_initialize();

View File

@@ -29,7 +29,5 @@
void bsp_start(void)
{
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
}

View File

@@ -85,9 +85,7 @@ void bsp_start_default( void )
/*
* Init rtems interrupt management
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
} /* bsp_start */
/*

View File

@@ -22,7 +22,5 @@ void bsp_start(void)
{
stm32f4_gpio_set_config_array(&stm32f4_start_config_gpio [0]);
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
_CPU_Fatal_halt(0xe);
}
bsp_interrupt_initialize();
}

View File

@@ -158,13 +158,7 @@ void rtems_irq_mngt_init(void)
/*
* Init initial Interrupt management config
*/
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
/*
* put something here that will show the failure...
*/
printk("Unable to initialize RTEMS interrupt Management!!! System locked\n");
while (1);
}
bsp_interrupt_initialize();
/*
* #define DEBUG

View File

@@ -184,10 +184,7 @@ void bsp_start(void)
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts");
}
bsp_interrupt_initialize();
/*
* If the BSP was built with IRQ benchmarking enabled,

View File

@@ -150,10 +150,7 @@ void bsp_start( void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts\n");
}
bsp_interrupt_initialize();
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Exit from bspstart\n");

View File

@@ -123,10 +123,7 @@ void bsp_start(void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if ( sc != RTEMS_SUCCESSFUL ) {
BSP_panic( "cannot initialize interrupts" );
}
bsp_interrupt_initialize();
/*
* initialize the device driver parameters

View File

@@ -130,10 +130,7 @@ void bsp_start(void)
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
/* Initialize interrupts */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic( "Cannot initialize interrupts");
}
bsp_interrupt_initialize();
mpc55xx_edma_init();
#ifdef MPC55XX_EMIOS_PRESCALER

View File

@@ -183,11 +183,7 @@ void bsp_start(void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts");
}
bsp_interrupt_initialize();
/*
mmu_init();

View File

@@ -107,10 +107,7 @@ void bsp_start( void )
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts");
}
bsp_interrupt_initialize();
#if 0
/*

View File

@@ -126,10 +126,7 @@ void bsp_start(void)
);
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts\n");
}
bsp_interrupt_initialize();
/* Disable boot page translation */
qoriq.lcc.bptr &= ~BPTR_EN;

View File

@@ -77,8 +77,5 @@ void bsp_start(void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot initialize interrupts\n");
}
bsp_interrupt_initialize();
}

View File

@@ -192,10 +192,7 @@ void bsp_start( void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL) {
BSP_panic("cannot intitialize interrupts");
}
bsp_interrupt_initialize();
#ifdef SHOW_MORE_INIT_SETTINGS
printk("Exit from bspstart\n");

View File

@@ -50,6 +50,13 @@ extern "C" {
* @{
*/
/**
* @brief Generic BSP fatal error codes.
*/
typedef enum {
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
} bsp_generic_fatal_code;
/**
* @brief Global pointer to the command line of boot_card().
*/

View File

@@ -9,10 +9,11 @@
/*
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
*
* Copyright (c) 2008, 2009, 2010
* Copyright (c) 2008-2012 embedded brains GmbH.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
@@ -163,11 +164,15 @@ void bsp_interrupt_handler_default(rtems_vector_number vector);
* @brief Initialize BSP interrupt support.
*
* You must call this function before you can install, remove and dispatch
* interrupt handlers. The BSP specific bsp_interrupt_facility_initialize()
* function will be called after all internals are initialized. Initialization
* is complete if everything was successful.
* interrupt handlers. There is no protection against concurrent
* initialization. This function must be called at most once. The BSP
* specific bsp_interrupt_facility_initialize() function will be called after
* all internals are initialized. If the BSP specific 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_INTERRUPT_INITIALIZATION.
*/
rtems_status_code bsp_interrupt_initialize(void);
void bsp_interrupt_initialize(void);
/**
* @brief BSP specific initialization.

View File

@@ -9,10 +9,11 @@
/*
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
*
* Copyright (c) 2008, 2009
* Copyright (c) 2008-2012 embedded brains GmbH.
*
* embedded brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
@@ -22,6 +23,7 @@
*/
#include <bsp/irq-generic.h>
#include <bsp/bootcard.h>
#include <stdlib.h>
@@ -155,18 +157,11 @@ static void bsp_interrupt_unlock(void)
}
}
rtems_status_code bsp_interrupt_initialize(void)
void bsp_interrupt_initialize(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
size_t i = 0;
bsp_interrupt_lock();
if (bsp_interrupt_is_initialized()) {
bsp_interrupt_unlock();
return RTEMS_INTERNAL_ERROR;
}
/* Initialize handler table */
for (i = 0; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
bsp_interrupt_handler_table [i].handler = bsp_interrupt_handler_empty;
@@ -175,15 +170,13 @@ rtems_status_code bsp_interrupt_initialize(void)
sc = bsp_interrupt_facility_initialize();
if (sc != RTEMS_SUCCESSFUL) {
bsp_interrupt_unlock();
return sc;
rtems_fatal(
RTEMS_FATAL_SOURCE_BSP_GENERIC,
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
);
}
bsp_interrupt_set_initialized();
bsp_interrupt_unlock();
return RTEMS_SUCCESSFUL;
}
/**

View File

@@ -93,7 +93,7 @@ void *bsp_early_malloc(int size);
typedef void (*bsp_shared_isr)(void *arg);
/* Initializes the Shared System Interrupt service */
extern int BSP_shared_interrupt_init(void);
extern void BSP_shared_interrupt_init(void);
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
* interrupt handlers may use the same IRQ number, all ISRs will be called

View File

@@ -113,7 +113,7 @@ void *bsp_early_malloc(int size);
typedef void (*bsp_shared_isr)(void *arg);
/* Initializes the Shared System Interrupt service */
extern int BSP_shared_interrupt_init(void);
extern void BSP_shared_interrupt_init(void);
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
* interrupt handlers may use the same IRQ number, all ISRs will be called

View File

@@ -126,7 +126,7 @@ void *bsp_early_malloc(int size);
typedef void (*bsp_shared_isr)(void *arg);
/* Initializes the Shared System Interrupt service */
extern int BSP_shared_interrupt_init(void);
extern void BSP_shared_interrupt_init(void);
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
* interrupt handlers may use the same IRQ number, all ISRs will be called

View File

@@ -25,7 +25,7 @@ static void BSP_ISR_handler(rtems_vector_number vector)
}
/* Initialize interrupts */
int BSP_shared_interrupt_init(void)
void BSP_shared_interrupt_init(void)
{
rtems_vector_number vector;
rtems_isr_entry previous_isr;
@@ -37,11 +37,7 @@ int BSP_shared_interrupt_init(void)
}
/* Initalize interrupt support */
sc = bsp_interrupt_initialize();
if (sc != RTEMS_SUCCESSFUL)
return -1;
return 0;
bsp_interrupt_initialize();
}
/* Callback from bsp_interrupt_initialize() */