source: rtems/testsuites/sptests/spfatal03/testcase.h @ 42840b4

4.104.114.9
Last change on this file since 42840b4 was 5fdb1e7b, checked in by Jennifer Averett <Jennifer.Averett@…>, on Jan 28, 2008 at 7:19:35 PM

2008-01-28 Jennifer Averett <jennifer.averett@…>

  • Makefile.am, configure.ac: Added fatal error tests
  • spfatal01/Makefile.am, spfatal01/spfatal01.scn, spfatal01/testcase.h, spfatal02/Makefile.am, spfatal02/spfatal02.scn, spfatal02/testcase.h, spfatal03/Makefile.am, spfatal03/spfatal03.scn, spfatal03/testcase.h, spfatal04/Makefile.am, spfatal04/spfatal04.scn, spfatal04/testcase.h, spfatal05/Makefile.am, spfatal05/spfatal05.scn, spfatal05/testcase.h, spfatal06/Makefile.am, spfatal06/spfatal06.scn, spfatal06/testcase.h, spfatal07/Makefile.am, spfatal07/spfatal07.scn, spfatal07/testcase.h, spfatal08/Makefile.am, spfatal08/spfatal08.scn, spfatal08/testcase.h, spfatal09/Makefile.am, spfatal09/spfatal09.scn, spfatal09/testcase.h, spfatal10/Makefile.am, spfatal10/spfatal10.scn, spfatal10/testcase.h, spfatal_support/init.c, spfatal_support/system.h: New files.
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 * Classic API Init task create failure
3 *
4 *  $Id$
5 */
6
7/*
8 *  Way too much stack space.  Should generate a fatal error
9 *  on the init task create.
10 */
11#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
12#define CONFIGURE_INIT_TASK_STACK_SIZE            RTEMS_MINIMUM_STACK_SIZE
13rtems_initialization_tasks_table Initialization_tasks[] = {
14  { rtems_build_name('I', 'N', 'I', ' '),
15    RTEMS_MINIMUM_STACK_SIZE,
16    1,
17    RTEMS_DEFAULT_ATTRIBUTES,
18    Init,
19    RTEMS_DEFAULT_MODES,
20    0
21  }
22};
23#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
24#define CONFIGURE_INIT_TASK_TABLE_SIZE \
25  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
26
27#define CONFIGURE_MAXIMUM_SEMAPHORES 10
28
29#define FATAL_ERROR_DESCRIPTION          "Core Mutex obtain in critical section"
30#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
31#define FATAL_ERROR_EXPECTED_IS_INTERNAL FALSE
32#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_MUTEX_OBTAIN_FROM_BAD_STATE
33
34rtems_id   Mutex_id[1];
35rtems_name Mutex_name[1];
36
37void force_error()
38{
39  ISR_Level level;
40  rtems_status_code status;
41
42
43  Mutex_name[0] = rtems_build_name( 'S','0',' ',' ');
44  status = rtems_semaphore_create(
45    Mutex_name[0],
46    1,
47    RTEMS_LOCAL|
48    RTEMS_SIMPLE_BINARY_SEMAPHORE|
49    RTEMS_PRIORITY_CEILING |
50    RTEMS_PRIORITY,
51    0,
52    &Mutex_id[0]
53  );
54  directive_failed( status, "rtems_semaphore_create of S0");
55  printf("Create S0\n");
56
57
58  _Thread_Disable_dispatch();
59  status = rtems_semaphore_obtain( Mutex_id[0], RTEMS_DEFAULT_OPTIONS, 0 );
60  /* !!! SHOULD NOT RETURN FROM THE ABOVE CALL */
61
62  _Thread_Enable_dispatch();
63  _ISR_Enable( level );
64  directive_failed( status, "rtems_semaphore_obtain" );
65 
66  /* we will not run this far */
67}
Note: See TracBrowser for help on using the repository browser.