Changeset dc6e830 in rtems


Ignore:
Timestamp:
Nov 13, 2012, 4:40:33 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
b31a960
Parents:
e4b40531
git-author:
Sebastian Huber <sebastian.huber@…> (11/13/12 16:40:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/15/12 14:33:11)
Message:

sapi: Add and use rtems_internal_error_description

Files:
5 added
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/startup/panic.c

    re4b40531 rdc6e830  
    2727#define THEERR _Internal_errors_What_happened.the_error
    2828
    29 char *score_status_text(rtems_status_code sc)
    30 {
    31   switch (sc) {
    32     case INTERNAL_ERROR_NO_CONFIGURATION_TABLE:
    33       return "INTERNAL_ERROR_NO_CONFIGURATION_TABLE";
    34     case INTERNAL_ERROR_NO_CPU_TABLE:
    35       return "INTERNAL_ERROR_NO_CPU_TABLE";
    36     case INTERNAL_ERROR_TOO_LITTLE_WORKSPACE:
    37       return "INTERNAL_ERROR_TOO_LITTLE_WORKSPACE";
    38     case INTERNAL_ERROR_WORKSPACE_ALLOCATION:
    39       return "INTERNAL_ERROR_WORKSPACE_ALLOCATION";
    40     case INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL:
    41       return "INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL";
    42     case INTERNAL_ERROR_THREAD_EXITTED:
    43       return "INTERNAL_ERROR_THREAD_EXITTED";
    44     case INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION:
    45       return "INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION";
    46     case INTERNAL_ERROR_INVALID_NODE:
    47       return "INTERNAL_ERROR_INVALID_NODE";
    48     case INTERNAL_ERROR_NO_MPCI:
    49       return "INTERNAL_ERROR_NO_MPCI";
    50     case INTERNAL_ERROR_BAD_PACKET:
    51       return "INTERNAL_ERROR_BAD_PACKET";
    52     case INTERNAL_ERROR_OUT_OF_PACKETS:
    53       return "INTERNAL_ERROR_OUT_OF_PACKETS";
    54     case INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS:
    55       return "INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS";
    56     case INTERNAL_ERROR_OUT_OF_PROXIES:
    57       return "INTERNAL_ERROR_OUT_OF_PROXIES";
    58     case INTERNAL_ERROR_INVALID_GLOBAL_ID:
    59       return "INTERNAL_ERROR_INVALID_GLOBAL_ID";
    60     case INTERNAL_ERROR_BAD_STACK_HOOK:
    61       return "INTERNAL_ERROR_BAD_STACK_HOOK";
    62     case INTERNAL_ERROR_BAD_ATTRIBUTES:
    63       return "INTERNAL_ERROR_BAD_ATTRIBUTES";
    64     case 18: /* not in header (yet) :-( */
    65       return "INTERNAL_ERROR_CALLED_FROM_WRONG_ENVIRONMENT";
    66     default:
    67       break;
    68   }
    69   return 0;
    70 }
    71 
    7229void _BSP_Fatal_error(unsigned int v)
    7330{
     
    8340    case INTERNAL_ERROR_CORE:
    8441      printk(" RTEMS Core\n");
    85       err = score_status_text(THEERR);
     42      err = rtems_internal_error_description(THEERR);
    8643    break;
    8744
  • cpukit/sapi/Makefile.am

    re4b40531 rdc6e830  
    3838    src/rtemsapi.c src/extensiondata.c src/getversionstring.c \
    3939    src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
    40     src/chainprependnotify.c src/rbheap.c
     40    src/chainprependnotify.c src/rbheap.c src/interrdesc.c
    4141libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
    4242
  • cpukit/sapi/include/rtems/fatal.h

    re4b40531 rdc6e830  
    2424
    2525#include <rtems/score/basedefs.h> /* RTEMS_COMPILER_NO_RETURN_ATTRIBUTE */
     26#include <rtems/extension.h>
    2627
    2728#ifdef __cplusplus
     
    4344) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
    4445
     46/**
     47 * @brief Returns a description for an internal error code.
     48 *
     49 * @param[in] error The error code.
     50 *
     51 * @return The error code description or "?" in case the passed error code is
     52 * invalid.
     53 */
     54const char *rtems_internal_error_description( rtems_fatal_code error );
     55
    4556#ifdef __cplusplus
    4657}
  • doc/user/Makefile.am

    re4b40531 rdc6e830  
    145145
    146146bsp.texi: bsp.t
    147         $(BMENU2) -p "Fatal Error Manager FATAL_ERROR_OCCURRED - Invoke the fatal error handler" \
     147        $(BMENU2) -p "Fatal Error Manager INTERNAL_ERROR_DESCRIPTION - Returns a description for an internal error code" \
    148148            -u "Top" \
    149149            -n "User Extensions Manager" < $< > $@
  • doc/user/fatal.t

    re4b40531 rdc6e830  
    130130@findex rtems_fatal_error_occurred
    131131@example
    132 void volatile rtems_fatal_error_occurred(
     132void rtems_fatal_error_occurred(
    133133  uint32_t  the_error
    134134);
     
    168168The user-defined extension for this directive may
    169169wish to initiate a global shutdown.
     170
     171@c
     172@c
     173@c
     174@page
     175@subsection INTERNAL_ERROR_DESCRIPTION - Returns a description for an internal error code
     176
     177@cindex fatal error
     178
     179@subheading CALLING SEQUENCE:
     180
     181@ifset is-C
     182@findex rtems_internal_error_description
     183@example
     184const char *rtems_internal_error_description(
     185  rtems_fatal_code error
     186);
     187@end example
     188@end ifset
     189
     190@subheading DIRECTIVE STATUS CODES
     191
     192The error code description or "?" in case the passed error code is invalid.
     193
     194@subheading DESCRIPTION:
     195
     196Returns a description for an internal error code.
  • testsuites/psxtests/psxfatal_support/init.c

    re4b40531 rdc6e830  
    6969};
    7070
    71 char *Errors_Core[] = {
    72   "INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
    73   "INTERNAL_ERROR_NO_CPU_TABLE",
    74   "INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
    75   "INTERNAL_ERROR_WORKSPACE_ALLOCATION",
    76   "INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL",
    77   "INTERNAL_ERROR_THREAD_EXITTED",
    78   "INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION",
    79   "INTERNAL_ERROR_INVALID_NODE",
    80   "INTERNAL_ERROR_NO_MPCI",
    81   "INTERNAL_ERROR_BAD_PACKET",
    82   "INTERNAL_ERROR_OUT_OF_PACKETS",
    83   "INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS",
    84   "INTERNAL_ERROR_OUT_OF_PROXIES",
    85   "INTERNAL_ERROR_INVALID_GLOBAL_ID",
    86   "INTERNAL_ERROR_BAD_STACK_HOOK",
    87   "INTERNAL_ERROR_BAD_ATTRIBUTES",
    88   "INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY",
    89   "INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL",
    90   "INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE",
    91   "INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0",
    92   "INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP",
    93   "INTERNAL_ERROR_GXX_KEY_ADD_FAILED",
    94   "INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED",
    95   "INTERNAL_ERROR_NO_MEMORY_FOR_HEAP"
    96 };
    97 
    9871void Put_Error( uint32_t source, uint32_t error )
    9972{
    10073  if ( source == INTERNAL_ERROR_CORE ) {
    101     if ( error >  INTERNAL_ERROR_NO_MEMORY_FOR_HEAP )
    102       printk("Unknown Internal Core Error (%d)", error);
    103     else
    104       printk( Errors_Core[ error ] );
     74    printk( rtems_internal_error_description( error ) );
    10575  }
    10676  else if (source == INTERNAL_ERROR_RTEMS_API ){
  • testsuites/sptests/Makefile.am

    re4b40531 rdc6e830  
    3232SUBDIRS += speventsystem01
    3333SUBDIRS += spinternalerror01
     34SUBDIRS += spinternalerror02
    3435
    3536include $(top_srcdir)/../automake/subdirs.am
  • testsuites/sptests/configure.ac

    re4b40531 rdc6e830  
    2828# Explicitly list all Makefiles here
    2929AC_CONFIG_FILES([Makefile
     30spinternalerror02/Makefile
    3031spinternalerror01/Makefile
    3132speventsystem01/Makefile
  • testsuites/sptests/spfatal_support/init.c

    re4b40531 rdc6e830  
    7070};
    7171
    72 char *Errors_Core[] = {
    73   "INTERNAL_ERROR_NO_CONFIGURATION_TABLE",
    74   "INTERNAL_ERROR_NO_CPU_TABLE",
    75   "INTERNAL_ERROR_TOO_LITTLE_WORKSPACE",
    76   "INTERNAL_ERROR_WORKSPACE_ALLOCATION",
    77   "INTERNAL_ERROR_INTERRUPT_STACK_TOO_SMALL",
    78   "INTERNAL_ERROR_THREAD_EXITTED",
    79   "INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION",
    80   "INTERNAL_ERROR_INVALID_NODE",
    81   "INTERNAL_ERROR_NO_MPCI",
    82   "INTERNAL_ERROR_BAD_PACKET",
    83   "INTERNAL_ERROR_OUT_OF_PACKETS",
    84   "INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS",
    85   "INTERNAL_ERROR_OUT_OF_PROXIES",
    86   "INTERNAL_ERROR_INVALID_GLOBAL_ID",
    87   "INTERNAL_ERROR_BAD_STACK_HOOK",
    88   "INTERNAL_ERROR_BAD_ATTRIBUTES",
    89   "INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY",
    90   "INTERNAL_ERROR_IMPLEMENTATION_BLOCKING_OPERATION_CANCEL",
    91   "INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE",
    92   "INTERNAL_ERROR_UNLIMITED_AND_MAXIMUM_IS_0",
    93   "INTERNAL_ERROR_SHUTDOWN_WHEN_NOT_UP",
    94   "INTERNAL_ERROR_GXX_KEY_ADD_FAILED",
    95   "INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED",
    96   "INTERNAL_ERROR_NO_MEMORY_FOR_HEAP"
    97 };
    98 
    9972void Put_Error( uint32_t source, uint32_t error )
    10073{
    10174  if ( source == INTERNAL_ERROR_CORE ) {
    102     if ( error >  INTERNAL_ERROR_NO_MEMORY_FOR_HEAP )
    103       printk("Unknown Internal Core Error (%d)", error);
    104     else
    105       printk( Errors_Core[ error ] );
     75    printk( rtems_internal_error_description( error ) );
    10676  }
    10777  else if (source == INTERNAL_ERROR_RTEMS_API ){
Note: See TracChangeset for help on using the changeset viewer.