source: rtems/cpukit/score/include/rtems/system.h @ 232cdcb

4.104.11
Last change on this file since 232cdcb was 232cdcb, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 7, 2010 at 2:04:34 PM

2010-04-07 Joel Sherrill <joel.sherrill@…>

  • score/include/rtems/system.h: Fix warnings about TRUE/FALSE not defined on ARM target. This file need to be clean from .S files.
  • Property mode set to 100644
File size: 5.4 KB
Line 
1/**
2 *  @file  rtems/system.h
3 *
4 *  This include file contains information that is included in every
5 *  function in the executive.  This must be the first include file
6 *  included in all internal RTEMS files.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2007.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#ifndef _RTEMS_SYSTEM_H
21#define _RTEMS_SYSTEM_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
28 *  The cpu options include file defines all cpu dependent
29 *  parameters for this build of RTEMS.  It must be included
30 *  first so the basic macro definitions are in place.
31 */
32#include <rtems/score/cpuopts.h>
33
34/**
35 *  The following ensures that all data is declared in the space
36 *  of the initialization routine for either the Initialization Manager
37 *  or the initialization file for the appropriate API.  It is
38 *  referenced as "external" in every other file.
39 */
40#ifdef SCORE_INIT
41#undef  SCORE_EXTERN
42#define SCORE_EXTERN
43#else
44#undef  SCORE_EXTERN
45#define SCORE_EXTERN  extern
46#endif
47
48/**
49 *  The following ensures that all data is declared in the space
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.
53 */
54#ifdef SAPI_INIT
55#undef  SAPI_EXTERN
56#define SAPI_EXTERN
57#else
58#undef  SAPI_EXTERN
59#define SAPI_EXTERN  extern
60#endif
61
62/**
63 *  The following ensures that all data is declared in the space
64 *  of the initialization routine for either the Initialization Manager
65 *  or the initialization file for the appropriate API.  It is
66 *  referenced as "external" in every other file.
67 */
68#ifdef RTEMS_API_INIT
69#undef  RTEMS_EXTERN
70#define RTEMS_EXTERN
71#else
72#undef  RTEMS_EXTERN
73#define RTEMS_EXTERN  extern
74#endif
75
76/**
77 *  The following ensures that all data is declared in the space
78 *  of the initialization routine for either the Initialization Manager
79 *  or the initialization file for the appropriate API.  It is
80 *  referenced as "external" in every other file.
81 */
82#ifdef POSIX_API_INIT
83#undef  POSIX_EXTERN
84#define POSIX_EXTERN
85#else
86#undef  POSIX_EXTERN
87#define POSIX_EXTERN  extern
88#endif
89
90/**
91 *  The following ensures that all data is declared in the space
92 *  of the initialization routine for either the Initialization Manager
93 *  or the initialization file for the appropriate API.  It is
94 *  referenced as "external" in every other file.
95 */
96#ifdef ITRON_API_INIT
97#undef  ITRON_EXTERN
98#define ITRON_EXTERN
99#else
100#undef  ITRON_EXTERN
101#define ITRON_EXTERN  extern
102#endif
103
104/**
105 *  The following (in conjunction with compiler arguments) are used
106 *  to choose between the use of static inline functions and macro
107 *  functions.   The static inline implementation allows better
108 *  type checking with no cost in code size or execution speed.
109 */
110#ifdef __GNUC__
111#  define RTEMS_INLINE_ROUTINE static __inline__
112#else
113#  define RTEMS_INLINE_ROUTINE static inline
114#endif
115
116/**
117 *  The following macro is a compiler specific way to ensure that memory
118 *  writes are not reordered around certian points.  This specifically can
119 *  impact interrupt disable and thread dispatching critical sections.
120 */
121#ifdef __GNUC__
122  #define RTEMS_COMPILER_MEMORY_BARRIER() asm volatile("" ::: "memory")
123#else
124  #define RTEMS_COMPILER_MEMORY_BARRIER()
125#endif
126
127/**
128 *  The following macro is a compiler specific way to indicate that
129 *  the method will NOT return to the caller.  This can assist the
130 *  compiler in code generation and avoid unreachable paths.  This
131 *  can impact the code generated following calls to
132 *  rtems_fatal_error_occurred and _Internal_error_Occurred.
133 */
134#ifdef __GNUC__
135  #define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE \
136      __attribute__ ((noreturn))
137#else
138  #define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE
139#endif
140
141/**
142 *  Instructs the compiler to issue a warning whenever a variable or function
143 *  with this attribute will be used.
144 */
145#ifdef __GNUC__
146  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE \
147     __attribute__ ((deprecated))
148#else
149  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
150#endif
151
152#ifndef ASM
153#ifdef RTEMS_POSIX_API
154/** The following is used by the POSIX implementation to catch bad paths.  */
155int POSIX_NOT_IMPLEMENTED( void );
156#endif
157
158/*
159 *  Include a base set of files.
160 */
161
162/**
163 * XXX: Eventually proc_ptr needs to disappear!!!
164 */
165typedef void * proc_ptr;
166
167#include <stddef.h>
168#endif
169
170#if !defined( TRUE ) || (TRUE != 1)
171/**  Boolean constant TRUE */
172#undef TRUE
173#define TRUE     (1)
174#endif
175
176#if !defined( FALSE ) || (FALSE != 0)
177/**  Boolean constant FALSE */
178#undef FALSE
179#define FALSE     (0)
180#endif
181
182#ifndef ASM
183#include <stdint.h>
184#endif
185#include <rtems/score/cpu.h>        /* processor specific information */
186
187#ifndef ASM
188/**
189 *  This macro is used to obtain the offset of a field in a structure.
190 */
191#define RTEMS_offsetof(type, field) \
192       ((uint32_t) &(((type *) 0)->field))
193
194/**
195 *  The following is the extern for the RTEMS version string.
196 *
197 *  @note The contents of this string are CPU specific.
198 */
199extern const char _RTEMS_version[];
200
201/**
202 *  The following is the extern for the RTEMS copyright string.
203 */
204extern const char _Copyright_Notice[];
205
206/** This macro defines the maximum length of a Classic API name. */
207#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)
208#endif
209
210#ifdef __cplusplus
211}
212#endif
213
214#endif
215/* end of include file */
Note: See TracBrowser for help on using the repository browser.