1 | /* system.h |
---|
2 | * |
---|
3 | * This include file contains information that is included in every |
---|
4 | * function in the test set. |
---|
5 | * |
---|
6 | * COPYRIGHT (c) 1989-2009. |
---|
7 | * On-Line Applications Research Corporation (OAR). |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.org/license/LICENSE. |
---|
12 | */ |
---|
13 | |
---|
14 | #include <rtems.h> |
---|
15 | #include <rtems/test.h> |
---|
16 | #include <inttypes.h> |
---|
17 | #include "tmacros.h" |
---|
18 | |
---|
19 | /* functions */ |
---|
20 | |
---|
21 | rtems_task Init( |
---|
22 | rtems_task_argument argument |
---|
23 | ); |
---|
24 | |
---|
25 | rtems_task Test_task( |
---|
26 | rtems_task_argument argument |
---|
27 | ); |
---|
28 | |
---|
29 | /* global variables */ |
---|
30 | |
---|
31 | /* |
---|
32 | * Keep the names and IDs in global variables so another task can use them. |
---|
33 | */ |
---|
34 | |
---|
35 | extern rtems_id Task_id[ 4 ]; /* array of task ids */ |
---|
36 | extern rtems_name Task_name[ 4 ]; /* array of task names */ |
---|
37 | |
---|
38 | |
---|
39 | /* configuration information */ |
---|
40 | |
---|
41 | #include <bsp.h> /* for device driver prototypes */ |
---|
42 | |
---|
43 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
44 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
45 | |
---|
46 | #define CONFIGURE_MAXIMUM_TASKS 4 |
---|
47 | |
---|
48 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
49 | |
---|
50 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
---|
51 | |
---|
52 | #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION |
---|
53 | |
---|
54 | #include <rtems/confdefs.h> |
---|
55 | |
---|
56 | /* |
---|
57 | * This allows us to view the "Test_task" instantiations as a set |
---|
58 | * of numbered tasks by eliminating the number of application |
---|
59 | * tasks created. |
---|
60 | * |
---|
61 | * In reality, this is too complex for the purposes of this |
---|
62 | * example. It would have been easier to pass a task argument. :) |
---|
63 | * But it shows how rtems_id's can sometimes be used. |
---|
64 | */ |
---|
65 | |
---|
66 | #define task_number( tid ) \ |
---|
67 | ( rtems_object_id_get_index( tid ) - \ |
---|
68 | rtems_configuration_get_rtems_api_configuration()-> \ |
---|
69 | number_of_initialization_tasks ) |
---|
70 | |
---|
71 | /* end of include file */ |
---|