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-1999. |
---|
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.OARcorp.com/rtems/license.html. |
---|
12 | * |
---|
13 | * system.h,v 1.13 2000/06/12 15:00:12 joel Exp |
---|
14 | */ |
---|
15 | |
---|
16 | #include <rtems.h> |
---|
17 | |
---|
18 | /* functions */ |
---|
19 | |
---|
20 | rtems_task Init( |
---|
21 | rtems_task_argument argument |
---|
22 | ); |
---|
23 | |
---|
24 | /* global variables */ |
---|
25 | |
---|
26 | |
---|
27 | /* configuration information */ |
---|
28 | |
---|
29 | #include <bsp.h> /* for device driver prototypes */ |
---|
30 | #include <libchip/ata.h> /* for ata driver prototype */ |
---|
31 | #include <libchip/ide_ctrl.h> /* for general ide driver prototype */ |
---|
32 | |
---|
33 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
34 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
35 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
36 | |
---|
37 | #define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
38 | |
---|
39 | #ifdef CONFIGURE_INIT |
---|
40 | rtems_driver_address_table Device_drivers[] = |
---|
41 | { |
---|
42 | CONSOLE_DRIVER_TABLE_ENTRY |
---|
43 | ,CLOCK_DRIVER_TABLE_ENTRY |
---|
44 | #ifdef RTEMS_BSP_HAS_IDE_DRIVER |
---|
45 | ,IDE_CONTROLLER_DRIVER_TABLE_ENTRY |
---|
46 | /* important: ATA driver must be after ide drivers */ |
---|
47 | ,ATA_DRIVER_TABLE_ENTRY |
---|
48 | #endif |
---|
49 | }; |
---|
50 | |
---|
51 | #include <rtems/bdbuf.h> |
---|
52 | rtems_bdbuf_config rtems_bdbuf_configuration[] = { |
---|
53 | {512,128,NULL} |
---|
54 | }; |
---|
55 | int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration) |
---|
56 | /sizeof(rtems_bdbuf_configuration[0])); |
---|
57 | #endif |
---|
58 | |
---|
59 | |
---|
60 | /* |
---|
61 | * XXX: these values are higher than needed... |
---|
62 | */ |
---|
63 | #define CONFIGURE_MAXIMUM_TASKS 20 |
---|
64 | #define CONFIGURE_MAXIMUM_SEMAPHORES 20 |
---|
65 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20 |
---|
66 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
67 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
68 | |
---|
69 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
---|
70 | |
---|
71 | #include <confdefs.h> |
---|
72 | |
---|
73 | /* |
---|
74 | * Handy macros and static inline functions |
---|
75 | */ |
---|
76 | |
---|
77 | /* |
---|
78 | * Macro to hide the ugliness of printing the time. |
---|
79 | */ |
---|
80 | |
---|
81 | #define print_time(_s1, _tb, _s2) \ |
---|
82 | do { \ |
---|
83 | printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ |
---|
84 | _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ |
---|
85 | (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ |
---|
86 | fflush(stdout); \ |
---|
87 | } while ( 0 ) |
---|
88 | |
---|
89 | /* |
---|
90 | * Macro to print an task name that is composed of ASCII characters. |
---|
91 | * |
---|
92 | */ |
---|
93 | |
---|
94 | #define put_name( _name, _crlf ) \ |
---|
95 | do { \ |
---|
96 | rtems_unsigned32 c0, c1, c2, c3; \ |
---|
97 | \ |
---|
98 | c0 = ((_name) >> 24) & 0xff; \ |
---|
99 | c1 = ((_name) >> 16) & 0xff; \ |
---|
100 | c2 = ((_name) >> 8) & 0xff; \ |
---|
101 | c3 = (_name) & 0xff; \ |
---|
102 | putchar( (char)c0 ); \ |
---|
103 | if ( c1 ) putchar( (char)c1 ); \ |
---|
104 | if ( c2 ) putchar( (char)c2 ); \ |
---|
105 | if ( c3 ) putchar( (char)c3 ); \ |
---|
106 | if ( (_crlf) ) \ |
---|
107 | putchar( '\n' ); \ |
---|
108 | } while (0) |
---|
109 | |
---|
110 | /* |
---|
111 | * static inline routine to make obtaining ticks per second easier. |
---|
112 | */ |
---|
113 | |
---|
114 | static inline rtems_unsigned32 get_ticks_per_second( void ) |
---|
115 | { |
---|
116 | rtems_interval ticks_per_second; |
---|
117 | (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; |
---|
118 | } |
---|
119 | |
---|
120 | |
---|
121 | /* |
---|
122 | * This allows us to view the "Test_task" instantiations as a set |
---|
123 | * of numbered tasks by eliminating the number of application |
---|
124 | * tasks created. |
---|
125 | * |
---|
126 | * In reality, this is too complex for the purposes of this |
---|
127 | * example. It would have been easier to pass a task argument. :) |
---|
128 | * But it shows how rtems_id's can sometimes be used. |
---|
129 | */ |
---|
130 | |
---|
131 | #define task_number( tid ) \ |
---|
132 | ( rtems_get_index( tid ) - \ |
---|
133 | rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks ) |
---|
134 | |
---|
135 | /* end of include file */ |
---|
136 | |
---|