source: rtems/cpukit/score/include/rtems/score/basedefs.h @ 06dcaf0

4.115
Last change on this file since 06dcaf0 was 06dcaf0, checked in by Joel Sherrill <joel.sherrill@…>, on 03/16/11 at 20:05:06

2011-03-16 Jennifer Averett <jennifer.averett@…>

PR 1729/cpukit

  • configure.ac, sapi/include/confdefs.h, sapi/src/exinit.c, score/Makefile.am, score/preinstall.am, score/cpu/i386/rtems/score/cpu.h, score/cpu/sparc/cpu_asm.S, score/cpu/sparc/rtems/score/cpu.h, score/include/rtems/score/basedefs.h, score/include/rtems/score/context.h, score/include/rtems/score/percpu.h, score/src/percpu.c, score/src/thread.c, score/src/threadcreateidle.c: Add next step in SMP support. This adds an allocated array of the Per_CPU structures to support multiple cpus vs a single instance of the structure which is still used if SMP support is disabled. Configuration support is also added to explicitly enable or disable SMP. But SMP can only be enabled for the CPUs which will support it initially -- SPARC and i386. With the stub BSP support, a BSP can be run as a single core SMP system from an RTEMS data structure standpoint.
  • aclocal/check-smp.m4, aclocal/enable-smp.m4, score/include/rtems/bspsmp.h, score/include/rtems/score/smplock.h, score/src/smp.c, score/src/smplock.c: New files.
  • Property mode set to 100644
File size: 4.3 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 *  The following defines a compiler specific attribute which informs
140 *  the compiler that the method has no effect except the return value
141 *  and that the return value depends only on parameters and/or global
142 *  variables.
143 */
144#ifdef __GNUC__
145  #define RTEMS_COMPILER_PURE_ATTRIBUTE \
146     __attribute__ ((pure))
147#else
148  #define RTEMS_COMPILER_PURE_ATTRIBUTE
149#endif
150
151/**
152 *  Instructs the compiler to issue a warning whenever a variable or function
153 *  with this attribute will be used.
154 */
155#ifdef __GNUC__
156  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE \
157     __attribute__ ((deprecated))
158#else
159  #define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
160#endif
161
162#ifndef ASM
163  #ifdef RTEMS_DEPRECATED_TYPES
164    typedef bool boolean;
165    typedef float single_precision;
166    typedef double double_precision;
167  #endif
168
169  /**
170   * XXX: Eventually proc_ptr needs to disappear!!!
171   */
172  typedef void * proc_ptr;
173#endif
174
175#endif /* _RTEMS_BASEDEFS_H */
Note: See TracBrowser for help on using the repository browser.