source: rtems/cpukit/score/include/rtems/score/basedefs.h @ 9f9a82b

4.115
Last change on this file since 9f9a82b was 9f9a82b, checked in by Sebastian Huber <sebastian.huber@…>, on 07/16/10 at 08:31:34

2010-07-16 Sebastian Huber <sebastian.huber@…>

  • score/include/rtems/score/basedefs.h: New file.
  • score/Makefile.am, score/preinstall.am: Reflect change above.
  • score/include/rtems/score/percpu.h: Include <rtems/score/cpu.h>.
  • score/include/rtems/system.h: Moved definition of SCORE_EXTERN, SAPI_EXTERN, RTEMS_EXTERN, POSIX_EXTERN, RTEMS_INLINE_ROUTINE, RTEMS_COMPILER_MEMORY_BARRIER, RTEMS_COMPILER_NO_RETURN_ATTRIBUTE, RTEMS_COMPILER_DEPRECATED_ATTRIBUTE, TRUE, and FALSE to <rtems/score/basedefs.h>. Removed include of <rtems/score/cpu.h>, <stdint.h> and <stddef.h>.
  • Property mode set to 100644
File size: 3.9 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup Score
5 *
6 * @brief Basic definitions.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2007.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  Copyright (c) 2010 embedded brains GmbH.
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.com/license/LICENSE.
18 *
19 *  $Id$
20 */
21
22#ifndef _RTEMS_BASEDEFS_H
23#define _RTEMS_BASEDEFS_H
24
25#include <rtems/score/cpuopts.h>
26
27#ifndef ASM
28  #include <stddef.h>
29  #include <stdbool.h>
30  #include <stdint.h>
31#endif
32
33#ifndef TRUE
34  #define TRUE 1
35#endif
36
37#ifndef FALSE
38  #define FALSE 0
39#endif
40
41#if TRUE == FALSE
42  #error "TRUE equals FALSE"
43#endif
44
45/**
46 *  The following ensures that all data is declared in the space
47 *  of the initialization routine for either the Initialization Manager
48 *  or the initialization file for the appropriate API.  It is
49 *  referenced as "external" in every other file.
50 */
51#ifdef SCORE_INIT
52#undef  SCORE_EXTERN
53#define SCORE_EXTERN
54#else
55#undef  SCORE_EXTERN
56#define SCORE_EXTERN  extern
57#endif
58
59/**
60 *  The following ensures that all data is declared in the space
61 *  of the initialization routine for either the Initialization Manager
62 *  or the initialization file for the appropriate API.  It is
63 *  referenced as "external" in every other file.
64 */
65#ifdef SAPI_INIT
66#undef  SAPI_EXTERN
67#define SAPI_EXTERN
68#else
69#undef  SAPI_EXTERN
70#define SAPI_EXTERN  extern
71#endif
72
73/**
74 *  The following ensures that all data is declared in the space
75 *  of the initialization routine for either the Initialization Manager
76 *  or the initialization file for the appropriate API.  It is
77 *  referenced as "external" in every other file.
78 */
79#ifdef RTEMS_API_INIT
80#undef  RTEMS_EXTERN
81#define RTEMS_EXTERN
82#else
83#undef  RTEMS_EXTERN
84#define RTEMS_EXTERN  extern
85#endif
86
87/**
88 *  The following ensures that all data is declared in the space
89 *  of the initialization routine for either the Initialization Manager
90 *  or the initialization file for the appropriate API.  It is
91 *  referenced as "external" in every other file.
92 */
93#ifdef POSIX_API_INIT
94#undef  POSIX_EXTERN
95#define POSIX_EXTERN
96#else
97#undef  POSIX_EXTERN
98#define POSIX_EXTERN  extern
99#endif
100
101/**
102 *  The following (in conjunction with compiler arguments) are used
103 *  to choose between the use of static inline functions and macro
104 *  functions.   The static inline implementation allows better
105 *  type checking with no cost in code size or execution speed.
106 */
107#ifdef __GNUC__
108#  define RTEMS_INLINE_ROUTINE static __inline__
109#else
110#  define RTEMS_INLINE_ROUTINE static inline
111#endif
112
113/**
114 *  The following macro is a compiler specific way to ensure that memory
115 *  writes are not reordered around certian points.  This specifically can
116 *  impact interrupt disable and thread dispatching critical sections.
117 */
118#ifdef __GNUC__
119  #define RTEMS_COMPILER_MEMORY_BARRIER() asm volatile("" ::: "memory")
120#else
121  #define RTEMS_COMPILER_MEMORY_BARRIER()
122#endif
123
124/**
125 *  The following macro is a compiler specific way to indicate that
126 *  the method will NOT return to the caller.  This can assist the
127 *  compiler in code generation and avoid unreachable paths.  This
128 *  can impact the code generated following calls to
129 *  rtems_fatal_error_occurred and _Internal_error_Occurred.
130 */
131#ifdef __GNUC__
132  #define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE \
133      __attribute__ ((noreturn))
134#else
135  #define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE
136#endif
137
138/**
139 *  Instructs the compiler to issue a warning whenever a variable or function
140 *  with this attribute will be used.
141 */
142#ifdef __GNUC__
143  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE \
144     __attribute__ ((deprecated))
145#else
146  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
147#endif
148
149#ifndef ASM
150  #ifdef RTEMS_DEPRECATED_TYPES
151    typedef bool boolean;
152    typedef float single_precision;
153    typedef double double_precision;
154  #endif
155
156  /**
157   * XXX: Eventually proc_ptr needs to disappear!!!
158   */
159  typedef void * proc_ptr;
160#endif
161
162#endif /* _RTEMS_BASEDEFS_H */
Note: See TracBrowser for help on using the repository browser.