diff options
Diffstat (limited to 'c/src/lib')
-rw-r--r-- | c/src/lib/libbsp/Makefile.am | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/preinstall.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/include/bootcard.h | 13 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/include/generic-fatal.h | 42 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/src/irq-generic.c | 7 | ||||
-rw-r--r-- | c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_initialize.c | 7 |
7 files changed, 55 insertions, 26 deletions
diff --git a/c/src/lib/libbsp/Makefile.am b/c/src/lib/libbsp/Makefile.am index 60a0d49e9d..5e27b5b0e6 100644 --- a/c/src/lib/libbsp/Makefile.am +++ b/c/src/lib/libbsp/Makefile.am @@ -33,6 +33,7 @@ include_bspdir = $(includedir)/bsp include_bsp_HEADERS = include_bsp_HEADERS += shared/include/default-initial-extension.h +include_bsp_HEADERS += shared/include/generic-fatal.h include $(srcdir)/preinstall.am include $(top_srcdir)/automake/subdirs.am diff --git a/c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c b/c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c index c9c94fe552..1b659f0caf 100644 --- a/c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c +++ b/c/src/lib/libbsp/m68k/mrm332/spurious/spinit.c @@ -15,7 +15,7 @@ */ #include <bsp.h> -#include <bsp/bootcard.h> +#include <bsp/generic-fatal.h> #include <stdio.h> const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error", @@ -72,10 +72,7 @@ rtems_isr Spurious_Isr( RAW_PUTI(sp); RAW_PUTS("\n\r"); #endif - rtems_fatal( - RTEMS_FATAL_SOURCE_BSP_GENERIC, - BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT - ); + bsp_generic_fatal( BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT ); } void Spurious_Initialize(void) diff --git a/c/src/lib/libbsp/preinstall.am b/c/src/lib/libbsp/preinstall.am index f4f0fa4edb..07c18f17a8 100644 --- a/c/src/lib/libbsp/preinstall.am +++ b/c/src/lib/libbsp/preinstall.am @@ -22,3 +22,7 @@ $(PROJECT_INCLUDE)/bsp/default-initial-extension.h: shared/include/default-initi $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/default-initial-extension.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/default-initial-extension.h +$(PROJECT_INCLUDE)/bsp/generic-fatal.h: shared/include/generic-fatal.h $(PROJECT_INCLUDE)/bsp/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/generic-fatal.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/generic-fatal.h + diff --git a/c/src/lib/libbsp/shared/include/bootcard.h b/c/src/lib/libbsp/shared/include/bootcard.h index f3de76036c..ca27832ec2 100644 --- a/c/src/lib/libbsp/shared/include/bootcard.h +++ b/c/src/lib/libbsp/shared/include/bootcard.h @@ -7,10 +7,10 @@ */ /* - * Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2008-2013 embedded brains GmbH. All rights reserved. * * embedded brains GmbH - * Obere Lagerstr. 30 + * Dornierstr. 4 * 82178 Puchheim * Germany * <rtems@embedded-brains.de> @@ -51,15 +51,6 @@ extern "C" { */ /** - * @brief Generic BSP fatal error codes. - */ -typedef enum { - BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION, - BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION, - BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT -} bsp_generic_fatal_code; - -/** * @brief Global pointer to the command line of boot_card(). */ extern const char *bsp_boot_cmdline; diff --git a/c/src/lib/libbsp/shared/include/generic-fatal.h b/c/src/lib/libbsp/shared/include/generic-fatal.h new file mode 100644 index 0000000000..4edf4675a9 --- /dev/null +++ b/c/src/lib/libbsp/shared/include/generic-fatal.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2012-2013 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Dornierstr. 4 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifndef LIBBSP_SHARED_BSP_GENERIC_FATAL_H +#define LIBBSP_SHARED_BSP_GENERIC_FATAL_H + +#include <rtems.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @brief Generic BSP fatal error codes. + */ +typedef enum { + BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION, + BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION, + BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT +} bsp_generic_fatal_code; + +static inline void bsp_generic_fatal( bsp_generic_fatal_code code ) +{ + rtems_fatal( RTEMS_FATAL_SOURCE_BSP_GENERIC, (rtems_fatal_code) code ); +} + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBBSP_SHARED_BSP_GENERIC_FATAL_H */ diff --git a/c/src/lib/libbsp/shared/src/irq-generic.c b/c/src/lib/libbsp/shared/src/irq-generic.c index 5cf9c91d77..b2d712a273 100644 --- a/c/src/lib/libbsp/shared/src/irq-generic.c +++ b/c/src/lib/libbsp/shared/src/irq-generic.c @@ -23,7 +23,7 @@ */ #include <bsp/irq-generic.h> -#include <bsp/bootcard.h> +#include <bsp/generic-fatal.h> #include <stdlib.h> @@ -170,10 +170,7 @@ void bsp_interrupt_initialize(void) sc = bsp_interrupt_facility_initialize(); if (sc != RTEMS_SUCCESSFUL) { - rtems_fatal( - RTEMS_FATAL_SOURCE_BSP_GENERIC, - BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION - ); + bsp_generic_fatal(BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION); } bsp_interrupt_set_initialized(); 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 6ac98804dd..d0f911665d 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 @@ -25,7 +25,7 @@ #include <rtems.h> #include <bsp/vectors.h> -#include <bsp/bootcard.h> +#include <bsp/generic-fatal.h> #define PPC_EXC_ASSERT_OFFSET(field, off) \ RTEMS_STATIC_ASSERT( \ @@ -145,10 +145,7 @@ static void ppc_exc_initialize_booke(void *vector_base) static void ppc_exc_fatal_error(void) { - rtems_fatal( - RTEMS_FATAL_SOURCE_BSP_GENERIC, - BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION - ); + bsp_generic_fatal(BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION); } void ppc_exc_initialize_with_vector_base( |