[ac7d5ef0] | 1 | /* system.h |
---|
| 2 | * |
---|
| 3 | * This include file contains information that is included in every |
---|
| 4 | * function in the executive. This must be the first include file |
---|
| 5 | * included in all internal RTEMS files. |
---|
| 6 | * |
---|
[08311cc3] | 7 | * COPYRIGHT (c) 1989-1999. |
---|
[ac7d5ef0] | 8 | * On-Line Applications Research Corporation (OAR). |
---|
| 9 | * |
---|
[98e4ebf5] | 10 | * The license and distribution terms for this file may be |
---|
| 11 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 12 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 13 | * |
---|
| 14 | * $Id$ |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | #ifndef __RTEMS_SYSTEM_h |
---|
| 18 | #define __RTEMS_SYSTEM_h |
---|
| 19 | |
---|
| 20 | #ifdef __cplusplus |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | /* |
---|
[541dfb2] | 25 | * The target options include file defines all target dependent |
---|
| 26 | * parameters for this build of RTEMS. It must be included |
---|
| 27 | * first so the basic macro definitions are in place. |
---|
[ac7d5ef0] | 28 | */ |
---|
| 29 | |
---|
[e0ba3e8] | 30 | /* |
---|
[270e3cc] | 31 | * FIXME: cpuopts.h should be included here. |
---|
[e0ba3e8] | 32 | */ |
---|
[a8d650c] | 33 | #if defined(_AM29K) \ |
---|
| 34 | || defined(__hppa__) \ |
---|
| 35 | || defined(__h8300__) \ |
---|
[4159370] | 36 | || defined(__i960__) \ |
---|
[270e3cc] | 37 | || defined(__mc68000__) \ |
---|
[4159370] | 38 | || defined(__sh__) \ |
---|
[8ca1e808] | 39 | || defined(__sparc__) \ |
---|
| 40 | || defined(__i386__) |
---|
[270e3cc] | 41 | /* these cpus are ready to apply cpuopts.h */ |
---|
| 42 | #include <rtems/score/cpuopts.h> |
---|
| 43 | #else |
---|
[a8d650c] | 44 | /* fallback to targopts.h for mips and powerpc */ |
---|
[541dfb2] | 45 | #include <rtems/score/targopts.h> |
---|
[270e3cc] | 46 | #endif |
---|
[ac7d5ef0] | 47 | |
---|
| 48 | /* |
---|
[b5c50309] | 49 | * The following ensures that all data is declared in the space |
---|
[c627b2a3] | 50 | * of the initialization routine for either the Initialization Manager |
---|
| 51 | * or the initialization file for the appropriate API. It is |
---|
| 52 | * referenced as "external" in every other file. |
---|
[ac7d5ef0] | 53 | */ |
---|
| 54 | |
---|
[c627b2a3] | 55 | #ifdef SCORE_INIT |
---|
| 56 | #undef SCORE_EXTERN |
---|
| 57 | #define SCORE_EXTERN |
---|
[ac7d5ef0] | 58 | #else |
---|
[c627b2a3] | 59 | #undef SCORE_EXTERN |
---|
| 60 | #define SCORE_EXTERN extern |
---|
| 61 | #endif |
---|
| 62 | |
---|
| 63 | #ifdef SAPI_INIT |
---|
| 64 | #undef SAPI_EXTERN |
---|
| 65 | #define SAPI_EXTERN |
---|
| 66 | #else |
---|
| 67 | #undef SAPI_EXTERN |
---|
| 68 | #define SAPI_EXTERN extern |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | #ifdef RTEMS_API_INIT |
---|
| 72 | #undef RTEMS_EXTERN |
---|
| 73 | #define RTEMS_EXTERN |
---|
| 74 | #else |
---|
| 75 | #undef RTEMS_EXTERN |
---|
| 76 | #define RTEMS_EXTERN extern |
---|
| 77 | #endif |
---|
| 78 | |
---|
| 79 | #ifdef POSIX_API_INIT |
---|
| 80 | #undef POSIX_EXTERN |
---|
| 81 | #define POSIX_EXTERN |
---|
| 82 | #else |
---|
| 83 | #undef POSIX_EXTERN |
---|
| 84 | #define POSIX_EXTERN extern |
---|
[ac7d5ef0] | 85 | #endif |
---|
| 86 | |
---|
[352c9b2] | 87 | #ifdef ITRON_API_INIT |
---|
| 88 | #undef ITRON_EXTERN |
---|
| 89 | #define ITRON_EXTERN |
---|
| 90 | #else |
---|
| 91 | #undef ITRON_EXTERN |
---|
| 92 | #define ITRON_EXTERN extern |
---|
| 93 | #endif |
---|
| 94 | |
---|
[ac7d5ef0] | 95 | /* |
---|
| 96 | * The following (in conjunction with compiler arguments) are used |
---|
| 97 | * to choose between the use of static inline functions and macro |
---|
| 98 | * functions. The static inline implementation allows better |
---|
| 99 | * type checking with no cost in code size or execution speed. |
---|
| 100 | */ |
---|
| 101 | |
---|
| 102 | #ifdef USE_INLINES |
---|
[c64e4ed4] | 103 | # ifdef __GNUC__ |
---|
[503dc058] | 104 | # define RTEMS_INLINE_ROUTINE static __inline__ |
---|
[c64e4ed4] | 105 | # else |
---|
[503dc058] | 106 | # define RTEMS_INLINE_ROUTINE static inline |
---|
[c64e4ed4] | 107 | # endif |
---|
[ac7d5ef0] | 108 | #else |
---|
[503dc058] | 109 | # define RTEMS_INLINE_ROUTINE |
---|
[ac7d5ef0] | 110 | #endif |
---|
| 111 | |
---|
[b5c50309] | 112 | /* |
---|
| 113 | * The following are used by the POSIX implementation to catch bad paths. |
---|
| 114 | */ |
---|
| 115 | |
---|
[ba41dfd] | 116 | #ifdef RTEMS_POSIX_API |
---|
[b5c50309] | 117 | int POSIX_MP_NOT_IMPLEMENTED( void ); |
---|
| 118 | int POSIX_NOT_IMPLEMENTED( void ); |
---|
| 119 | int POSIX_BOTTOM_REACHED( void ); |
---|
| 120 | #endif |
---|
| 121 | |
---|
[ac7d5ef0] | 122 | /* |
---|
| 123 | * Include a base set of files. |
---|
| 124 | */ |
---|
| 125 | |
---|
| 126 | /* |
---|
| 127 | * XXX: Eventually proc_ptr needs to disappear!!! |
---|
| 128 | */ |
---|
| 129 | |
---|
| 130 | typedef void * proc_ptr; |
---|
| 131 | |
---|
| 132 | /* |
---|
| 133 | * Define NULL |
---|
| 134 | */ |
---|
| 135 | |
---|
| 136 | #ifndef NULL |
---|
| 137 | #define NULL 0 /* NULL value */ |
---|
| 138 | #endif |
---|
| 139 | |
---|
| 140 | /* |
---|
| 141 | * Boolean constants |
---|
| 142 | */ |
---|
| 143 | |
---|
| 144 | #if !defined( TRUE ) || (TRUE != 1) |
---|
| 145 | #undef TRUE |
---|
| 146 | #define TRUE (1) |
---|
| 147 | #endif |
---|
| 148 | |
---|
| 149 | #if !defined( FALSE ) || (FALSE != 0) |
---|
| 150 | #undef FALSE |
---|
| 151 | #define FALSE (0) |
---|
| 152 | #endif |
---|
| 153 | |
---|
[01a5f6b2] | 154 | #include <rtems/score/cpu.h> /* processor specific information */ |
---|
| 155 | |
---|
[ac7d5ef0] | 156 | #define stringify( _x ) # _x |
---|
| 157 | |
---|
[b06e68ef] | 158 | #define RTEMS_offsetof(type, field) \ |
---|
| 159 | ((unsigned32) &(((type *) 0)->field)) |
---|
| 160 | |
---|
[ac7d5ef0] | 161 | /* |
---|
| 162 | * The following is the extern for the RTEMS version string. |
---|
| 163 | * The contents of this string are CPU specific. |
---|
| 164 | */ |
---|
| 165 | |
---|
| 166 | extern const char _RTEMS_version[]; /* RTEMS version string */ |
---|
| 167 | extern const char _Copyright_Notice[]; /* RTEMS copyright string */ |
---|
| 168 | |
---|
| 169 | /* |
---|
| 170 | * The following defines the CPU dependent information table. |
---|
| 171 | */ |
---|
| 172 | |
---|
[c627b2a3] | 173 | SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */ |
---|
[ac7d5ef0] | 174 | |
---|
[458bd34] | 175 | /* |
---|
| 176 | * Macros to access CPU Table fields required by ALL ports. |
---|
| 177 | * |
---|
| 178 | * NOTE: Similar macros to access port specific fields in in the |
---|
| 179 | * appropriate cpu.h file. |
---|
| 180 | */ |
---|
| 181 | |
---|
| 182 | #define rtems_cpu_configuration_get_table() \ |
---|
| 183 | (&_CPU_Table) |
---|
| 184 | |
---|
| 185 | #define rtems_cpu_configuration_get_pretasking_hook() \ |
---|
| 186 | (_CPU_Table.pretasking_hook) |
---|
| 187 | |
---|
| 188 | #define rtems_cpu_configuration_get_predriver_hook() \ |
---|
| 189 | (_CPU_Table.predriver_hook) |
---|
| 190 | |
---|
| 191 | #define rtems_cpu_configuration_get_postdriver_hook() \ |
---|
| 192 | (_CPU_Table.postdriver_hook) |
---|
| 193 | |
---|
| 194 | #define rtems_cpu_configuration_get_idle_task() \ |
---|
| 195 | (_CPU_Table.idle_task) |
---|
| 196 | |
---|
| 197 | #define rtems_cpu_configuration_get_do_zero_of_workspace() \ |
---|
| 198 | (_CPU_Table.do_zero_of_workspace) |
---|
| 199 | |
---|
| 200 | #define rtems_cpu_configuration_get_idle_task_stack_size() \ |
---|
| 201 | (_CPU_Table.idle_task_stack_size) |
---|
| 202 | |
---|
| 203 | #define rtems_cpu_configuration_get_interrupt_stack_size() \ |
---|
| 204 | (_CPU_Table.interrupt_stack_size) |
---|
| 205 | |
---|
| 206 | #define rtems_cpu_configuration_get_extra_mpci_receive_server_stack() \ |
---|
| 207 | (_CPU_Table.extra_mpci_receive_server_stack) |
---|
| 208 | |
---|
| 209 | #define rtems_cpu_configuration_get_stack_allocate_hook() \ |
---|
| 210 | (_CPU_Table.stack_allocate_hook) |
---|
| 211 | |
---|
| 212 | #define rtems_cpu_configuration_get_stack_free_hook() \ |
---|
| 213 | (_CPU_Table.stack_free_hook) |
---|
| 214 | |
---|
[3235ad9] | 215 | /* |
---|
[df49c60] | 216 | * XXX weird RTEMS stuff that probably should be somewhere else. |
---|
[3235ad9] | 217 | */ |
---|
| 218 | |
---|
[df49c60] | 219 | #define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name) |
---|
[3235ad9] | 220 | |
---|
[ac7d5ef0] | 221 | #ifdef __cplusplus |
---|
| 222 | } |
---|
| 223 | #endif |
---|
| 224 | |
---|
| 225 | #endif |
---|
| 226 | /* end of include file */ |
---|