Changeset f2f39b62 in rtems


Ignore:
Timestamp:
Jan 7, 2013, 3:01:45 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4027e63
Parents:
40340b2
git-author:
Sebastian Huber <sebastian.huber@…> (01/07/13 15:01:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/07/13 15:08:19)
Message:

sapi: Add rtems_fatal_source_description()

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/Makefile.am

    r40340b2 rf2f39b62  
    3939    src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
    4040    src/chainprependnotify.c src/rbheap.c src/interrdesc.c \
    41     src/fatal2.c
     41    src/fatal2.c src/fatalsrcdesc.c
    4242libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
    4343
  • cpukit/sapi/include/rtems/fatal.h

    r40340b2 rf2f39b62  
    8484
    8585/**
     86 * @brief Returns a description for a fatal source.
     87 *
     88 * @param[in] source The fatal source.
     89 *
     90 * @return The fatal source description or "?" in case the passed fatal source
     91 * is invalid.
     92 */
     93const char *rtems_fatal_source_description( rtems_fatal_source source );
     94
     95/**
    8696 * @brief Returns a description for an internal error code.
    8797 *
  • doc/user/fatal.t

    r40340b2 rf2f39b62  
    231231@c
    232232@page
     233@subsection FATAL_SOURCE_DESCRIPTION - Returns a description for a fatal source
     234
     235@cindex fatal error
     236
     237@subheading CALLING SEQUENCE:
     238
     239@ifset is-C
     240@findex rtems_fatal_source_description
     241@example
     242const char *rtems_fatal_source_description(
     243  rtems_fatal_source source
     244);
     245@end example
     246@end ifset
     247
     248@subheading DIRECTIVE STATUS CODES
     249
     250The fatal source description or "?" in case the passed fatal source is invalid.
     251
     252@subheading DESCRIPTION:
     253
     254Returns a description for a fatal source.
     255
     256@c
     257@c
     258@c
     259@page
    233260@subsection INTERNAL_ERROR_DESCRIPTION - Returns a description for an internal error code
    234261
  • testsuites/sptests/spinternalerror02/init.c

    r40340b2 rf2f39b62  
    2121#include <rtems.h>
    2222
    23 static void test(void)
     23static void test_internal_error_description(void)
    2424{
    2525  rtems_fatal_code error = 0;
     
    3737}
    3838
     39static void test_fatal_source_description(void)
     40{
     41  rtems_fatal_source source = 0;
     42  const char *desc_last = NULL;
     43  const char *desc;
     44
     45  do {
     46    desc_last = desc;
     47    desc = rtems_fatal_source_description( source );
     48    ++source;
     49    puts( desc );
     50  } while ( desc != desc_last );
     51
     52  rtems_test_assert( source - 3 == RTEMS_FATAL_SOURCE_EXCEPTION );
     53}
     54
    3955static void Init(rtems_task_argument arg)
    4056{
    4157  puts("\n\n*** TEST SPINTERNALERROR 2 ***");
    4258
    43   test();
     59  test_internal_error_description();
     60  test_fatal_source_description();
    4461
    4562  puts("*** END OF TEST SPINTERNALERROR 2 ***");
  • testsuites/sptests/spinternalerror02/spinternalerror02.scn

    r40340b2 rf2f39b62  
    2727?
    2828?
     29INTERNAL_ERROR_CORE
     30INTERNAL_ERROR_RTEMS_API
     31INTERNAL_ERROR_POSIX_API
     32RTEMS_FATAL_SOURCE_BDBUF
     33RTEMS_FATAL_SOURCE_APPLICATION
     34RTEMS_FATAL_SOURCE_EXIT
     35RTEMS_FATAL_SOURCE_BSP_GENERIC
     36RTEMS_FATAL_SOURCE_BSP_SPECIFIC
     37RTEMS_FATAL_SOURCE_ASSERT
     38RTEMS_FATAL_SOURCE_STACK_CHECKER
     39RTEMS_FATAL_SOURCE_EXCEPTION
     40?
     41?
    2942*** END OF TEST SPINTERNALERROR 2 ***
Note: See TracChangeset for help on using the changeset viewer.