[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 | * |
---|
| 7 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
| 8 | * On-Line Applications Research Corporation (OAR). |
---|
| 9 | * All rights assigned to U.S. Government, 1994. |
---|
| 10 | * |
---|
| 11 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
| 12 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
| 13 | * notice must appear in all copies of this file and its derivatives. |
---|
| 14 | * |
---|
| 15 | * $Id$ |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | #ifndef __RTEMS_SYSTEM_h |
---|
| 19 | #define __RTEMS_SYSTEM_h |
---|
| 20 | |
---|
| 21 | #ifdef __cplusplus |
---|
| 22 | extern "C" { |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | /* |
---|
[541dfb2] | 26 | * The target options include file defines all target dependent |
---|
| 27 | * parameters for this build of RTEMS. It must be included |
---|
| 28 | * first so the basic macro definitions are in place. |
---|
[ac7d5ef0] | 29 | */ |
---|
| 30 | |
---|
[541dfb2] | 31 | #include <rtems/score/targopts.h> |
---|
[ac7d5ef0] | 32 | |
---|
| 33 | /* |
---|
| 34 | * The following insures that all data is declared in the space |
---|
[c627b2a3] | 35 | * of the initialization routine for either the Initialization Manager |
---|
| 36 | * or the initialization file for the appropriate API. It is |
---|
| 37 | * referenced as "external" in every other file. |
---|
[ac7d5ef0] | 38 | */ |
---|
| 39 | |
---|
[c627b2a3] | 40 | #ifdef SCORE_INIT |
---|
| 41 | #undef SCORE_EXTERN |
---|
| 42 | #define SCORE_EXTERN |
---|
[ac7d5ef0] | 43 | #else |
---|
[c627b2a3] | 44 | #undef SCORE_EXTERN |
---|
| 45 | #define SCORE_EXTERN extern |
---|
| 46 | #endif |
---|
| 47 | |
---|
| 48 | #ifdef SAPI_INIT |
---|
| 49 | #undef SAPI_EXTERN |
---|
| 50 | #define SAPI_EXTERN |
---|
| 51 | #else |
---|
| 52 | #undef SAPI_EXTERN |
---|
| 53 | #define SAPI_EXTERN extern |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | #ifdef RTEMS_API_INIT |
---|
| 57 | #undef RTEMS_EXTERN |
---|
| 58 | #define RTEMS_EXTERN |
---|
| 59 | #else |
---|
| 60 | #undef RTEMS_EXTERN |
---|
| 61 | #define RTEMS_EXTERN extern |
---|
| 62 | #endif |
---|
| 63 | |
---|
| 64 | #ifdef POSIX_API_INIT |
---|
| 65 | #undef POSIX_EXTERN |
---|
| 66 | #define POSIX_EXTERN |
---|
| 67 | #else |
---|
| 68 | #undef POSIX_EXTERN |
---|
| 69 | #define POSIX_EXTERN extern |
---|
[ac7d5ef0] | 70 | #endif |
---|
| 71 | |
---|
| 72 | /* |
---|
| 73 | * The following (in conjunction with compiler arguments) are used |
---|
| 74 | * to choose between the use of static inline functions and macro |
---|
| 75 | * functions. The static inline implementation allows better |
---|
| 76 | * type checking with no cost in code size or execution speed. |
---|
| 77 | */ |
---|
| 78 | |
---|
| 79 | #ifdef USE_INLINES |
---|
[c64e4ed4] | 80 | # ifdef __GNUC__ |
---|
[503dc058] | 81 | # define RTEMS_INLINE_ROUTINE static __inline__ |
---|
[c64e4ed4] | 82 | # else |
---|
[503dc058] | 83 | # define RTEMS_INLINE_ROUTINE static inline |
---|
[c64e4ed4] | 84 | # endif |
---|
[ac7d5ef0] | 85 | #else |
---|
[503dc058] | 86 | # define RTEMS_INLINE_ROUTINE |
---|
[ac7d5ef0] | 87 | #endif |
---|
| 88 | |
---|
| 89 | /* |
---|
| 90 | * Include a base set of files. |
---|
| 91 | */ |
---|
| 92 | |
---|
| 93 | /* |
---|
| 94 | * XXX: Eventually proc_ptr needs to disappear!!! |
---|
| 95 | */ |
---|
| 96 | |
---|
| 97 | typedef void * proc_ptr; |
---|
| 98 | |
---|
[5e9b32b] | 99 | #include <rtems/score/cpu.h> /* processor specific information */ |
---|
[ac7d5ef0] | 100 | |
---|
| 101 | /* |
---|
| 102 | * Define NULL |
---|
| 103 | */ |
---|
| 104 | |
---|
| 105 | #ifndef NULL |
---|
| 106 | #define NULL 0 /* NULL value */ |
---|
| 107 | #endif |
---|
| 108 | |
---|
| 109 | /* |
---|
| 110 | * Boolean constants |
---|
| 111 | */ |
---|
| 112 | |
---|
| 113 | #if !defined( TRUE ) || (TRUE != 1) |
---|
| 114 | #undef TRUE |
---|
| 115 | #define TRUE (1) |
---|
| 116 | #endif |
---|
| 117 | |
---|
| 118 | #if !defined( FALSE ) || (FALSE != 0) |
---|
| 119 | #undef FALSE |
---|
| 120 | #define FALSE (0) |
---|
| 121 | #endif |
---|
| 122 | |
---|
| 123 | #define stringify( _x ) # _x |
---|
| 124 | |
---|
[b06e68ef] | 125 | #define RTEMS_offsetof(type, field) \ |
---|
| 126 | ((unsigned32) &(((type *) 0)->field)) |
---|
| 127 | |
---|
[ac7d5ef0] | 128 | /* |
---|
| 129 | * The following is the extern for the RTEMS version string. |
---|
| 130 | * The contents of this string are CPU specific. |
---|
| 131 | */ |
---|
| 132 | |
---|
| 133 | extern const char _RTEMS_version[]; /* RTEMS version string */ |
---|
| 134 | extern const char _Copyright_Notice[]; /* RTEMS copyright string */ |
---|
| 135 | |
---|
| 136 | /* |
---|
| 137 | * The following defines the CPU dependent information table. |
---|
| 138 | */ |
---|
| 139 | |
---|
[c627b2a3] | 140 | SCORE_EXTERN rtems_cpu_table _CPU_Table; /* CPU dependent info */ |
---|
[ac7d5ef0] | 141 | |
---|
[3235ad9] | 142 | /* |
---|
| 143 | * XXX weird RTEMS stuff |
---|
| 144 | */ |
---|
| 145 | |
---|
| 146 | #define RTEMS_MAXIMUM_NAME_LENGTH 4 |
---|
| 147 | |
---|
[ac7d5ef0] | 148 | #ifdef __cplusplus |
---|
| 149 | } |
---|
| 150 | #endif |
---|
| 151 | |
---|
| 152 | #endif |
---|
| 153 | /* end of include file */ |
---|