forked from Imagelibrary/rtems
bsps: Move bsp_generic_fatal_code to new file
Add bsp_generic_fatal().
This commit is contained in:
@@ -33,6 +33,7 @@ include_bspdir = $(includedir)/bsp
|
|||||||
|
|
||||||
include_bsp_HEADERS =
|
include_bsp_HEADERS =
|
||||||
include_bsp_HEADERS += shared/include/default-initial-extension.h
|
include_bsp_HEADERS += shared/include/default-initial-extension.h
|
||||||
|
include_bsp_HEADERS += shared/include/generic-fatal.h
|
||||||
|
|
||||||
include $(srcdir)/preinstall.am
|
include $(srcdir)/preinstall.am
|
||||||
include $(top_srcdir)/automake/subdirs.am
|
include $(top_srcdir)/automake/subdirs.am
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <bsp/bootcard.h>
|
#include <bsp/generic-fatal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
|
const char * const _Spurious_Error_[] = {"Reset","Bus Error","Address Error",
|
||||||
@@ -72,10 +72,7 @@ rtems_isr Spurious_Isr(
|
|||||||
RAW_PUTI(sp);
|
RAW_PUTI(sp);
|
||||||
RAW_PUTS("\n\r");
|
RAW_PUTS("\n\r");
|
||||||
#endif
|
#endif
|
||||||
rtems_fatal(
|
bsp_generic_fatal( BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT );
|
||||||
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
|
||||||
BSP_GENERIC_FATAL_SPURIOUS_INTERRUPT
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spurious_Initialize(void)
|
void Spurious_Initialize(void)
|
||||||
|
|||||||
@@ -22,3 +22,7 @@ $(PROJECT_INCLUDE)/bsp/default-initial-extension.h: shared/include/default-initi
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/default-initial-extension.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/default-initial-extension.h
|
||||||
PREINSTALL_FILES += $(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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
* embedded brains GmbH
|
||||||
* Obere Lagerstr. 30
|
* Dornierstr. 4
|
||||||
* 82178 Puchheim
|
* 82178 Puchheim
|
||||||
* Germany
|
* Germany
|
||||||
* <rtems@embedded-brains.de>
|
* <rtems@embedded-brains.de>
|
||||||
@@ -50,15 +50,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().
|
* @brief Global pointer to the command line of boot_card().
|
||||||
*/
|
*/
|
||||||
|
|||||||
42
c/src/lib/libbsp/shared/include/generic-fatal.h
Normal file
42
c/src/lib/libbsp/shared/include/generic-fatal.h
Normal file
@@ -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 */
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp/irq-generic.h>
|
#include <bsp/irq-generic.h>
|
||||||
#include <bsp/bootcard.h>
|
#include <bsp/generic-fatal.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -170,10 +170,7 @@ void bsp_interrupt_initialize(void)
|
|||||||
|
|
||||||
sc = bsp_interrupt_facility_initialize();
|
sc = bsp_interrupt_facility_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
if (sc != RTEMS_SUCCESSFUL) {
|
||||||
rtems_fatal(
|
bsp_generic_fatal(BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION);
|
||||||
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
|
||||||
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bsp_interrupt_set_initialized();
|
bsp_interrupt_set_initialized();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include <rtems.h>
|
#include <rtems.h>
|
||||||
|
|
||||||
#include <bsp/vectors.h>
|
#include <bsp/vectors.h>
|
||||||
#include <bsp/bootcard.h>
|
#include <bsp/generic-fatal.h>
|
||||||
|
|
||||||
#define PPC_EXC_ASSERT_OFFSET(field, off) \
|
#define PPC_EXC_ASSERT_OFFSET(field, off) \
|
||||||
RTEMS_STATIC_ASSERT( \
|
RTEMS_STATIC_ASSERT( \
|
||||||
@@ -145,10 +145,7 @@ static void ppc_exc_initialize_booke(void *vector_base)
|
|||||||
|
|
||||||
static void ppc_exc_fatal_error(void)
|
static void ppc_exc_fatal_error(void)
|
||||||
{
|
{
|
||||||
rtems_fatal(
|
bsp_generic_fatal(BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION);
|
||||||
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
|
||||||
BSP_GENERIC_FATAL_EXCEPTION_INITIALIZATION
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_exc_initialize_with_vector_base(
|
void ppc_exc_initialize_with_vector_base(
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ typedef enum {
|
|||||||
/**
|
/**
|
||||||
* @brief Fatal source for generic BSP errors.
|
* @brief Fatal source for generic BSP errors.
|
||||||
*
|
*
|
||||||
* The fatal codes are defined in <bsp/bootcard.h>. Examples are interrupt
|
* The fatal codes are defined in <bsp/generic-fatal.h>. Examples are
|
||||||
* and exception initialization.
|
* interrupt and exception initialization.
|
||||||
*
|
*
|
||||||
* @see bsp_generic_fatal_code.
|
* @see bsp_generic_fatal_code and bsp_generic_fatal().
|
||||||
*/
|
*/
|
||||||
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user