1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2011. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.org/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #include "tmacros.h" |
---|
11 | #include "test_support.h" |
---|
12 | |
---|
13 | /* functions */ |
---|
14 | |
---|
15 | rtems_task Init( |
---|
16 | rtems_task_argument argument |
---|
17 | ); |
---|
18 | |
---|
19 | rtems_task Test_task( |
---|
20 | rtems_task_argument argument |
---|
21 | ); |
---|
22 | |
---|
23 | /* configuration information */ |
---|
24 | |
---|
25 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
26 | #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER |
---|
27 | |
---|
28 | #define CONFIGURE_MAXIMUM_PROCESSORS 4 |
---|
29 | |
---|
30 | #define CONFIGURE_MAXIMUM_TASKS \ |
---|
31 | (1 + CONFIGURE_MAXIMUM_PROCESSORS) |
---|
32 | |
---|
33 | #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION |
---|
34 | |
---|
35 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
36 | #define CONFIGURE_INIT_TASK_STACK_SIZE \ |
---|
37 | (3 * CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
38 | |
---|
39 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
40 | |
---|
41 | #define CONFIGURE_MAXIMUM_SEMAPHORES 2 |
---|
42 | |
---|
43 | #include <rtems/confdefs.h> |
---|
44 | |
---|
45 | |
---|
46 | /* global variables */ |
---|
47 | |
---|
48 | /* |
---|
49 | * Keep the names and IDs in global variables so another task can use them. |
---|
50 | */ |
---|
51 | |
---|
52 | typedef struct { |
---|
53 | bool IsLocked; |
---|
54 | uint32_t cpu_num; |
---|
55 | uint32_t task_index; |
---|
56 | } Log_t; |
---|
57 | |
---|
58 | #define LOG_SIZE 20 |
---|
59 | |
---|
60 | TEST_EXTERN rtems_id Semaphore; /* synchronisation semaphore */ |
---|
61 | TEST_EXTERN Log_t Log[LOG_SIZE]; /* A log of locks/unlocks */ |
---|
62 | TEST_EXTERN volatile uint32_t Log_index; /* Index into log */ |
---|
63 | |
---|
64 | /* |
---|
65 | * Handy macros and static inline functions |
---|
66 | */ |
---|
67 | |
---|
68 | /* |
---|
69 | * Macro to hide the ugliness of printing the time. |
---|
70 | */ |
---|
71 | |
---|
72 | /* end of include file */ |
---|