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 |
---|
13 | rtems_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 | |
---|
34 | rtems_id Mutex_id[1]; |
---|
35 | rtems_name Mutex_name[1]; |
---|
36 | |
---|
37 | void 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 | } |
---|