source: rtems/cpukit/score/include/rtems/system.h @ 860c34e

4.104.114.95
Last change on this file since 860c34e was 860c34e, checked in by Glenn Humphrey <glenn.humphrey@…>, on 11/30/07 at 20:34:13

2007-11-30 Glenn Humphrey <glenn.humphrey@…>

  • posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/semaphore.h, posix/src/cancel.c, posix/src/conddestroy.c, posix/src/condsignalsupp.c, posix/src/condwaitsupp.c, posix/src/keydelete.c, posix/src/keygetspecific.c, posix/src/keysetspecific.c, posix/src/mqueueclose.c, posix/src/mqueuegetattr.c, posix/src/mqueuenotify.c, posix/src/mqueuerecvsupp.c, posix/src/mqueuesendsupp.c, posix/src/mqueuesetattr.c, posix/src/mqueuetranslatereturncode.c, posix/src/mutexdestroy.c, posix/src/mutexgetprioceiling.c, posix/src/mutexinit.c, posix/src/mutexlocksupp.c, posix/src/mutexsetprioceiling.c, posix/src/mutexunlock.c, posix/src/pbarrierdestroy.c, posix/src/pbarriertranslatereturncode.c, posix/src/pbarrierwait.c, posix/src/prwlockdestroy.c, posix/src/prwlockrdlock.c, posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c, posix/src/prwlocktranslatereturncode.c, posix/src/prwlocktryrdlock.c, posix/src/prwlocktrywrlock.c, posix/src/prwlockunlock.c, posix/src/prwlockwrlock.c, posix/src/pspindestroy.c, posix/src/pspinlock.c, posix/src/pspinlocktranslatereturncode.c, posix/src/pspintrylock.c, posix/src/pspinunlock.c, posix/src/pthreaddetach.c, posix/src/pthreadequal.c, posix/src/pthreadgetschedparam.c, posix/src/pthreadjoin.c, posix/src/pthreadkill.c, posix/src/pthreadsetschedparam.c, posix/src/ptimer1.c, posix/src/semaphorewaitsupp.c, posix/src/semclose.c, posix/src/semdestroy.c, posix/src/semgetvalue.c, posix/src/sempost.c, posix/src/types.c, rtems/src/msgqtranslatereturncode.c, rtems/src/semobtain.c, rtems/src/timerfireafter.c, score/include/rtems/system.h, score/include/rtems/score/corebarrier.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h: Restructed to move the OBJECTS_LOCAL case to the top of the switch statement and eliminate the fall-through return of POSIX_BOTTOM_REACHED. These changes produced simplier assembly code and allowed for complete test coverage. Also applied some consistency to the functions that translate the core status codes to POSIX status codes.
  • posix/src/mutextranslatereturncode.c, posix/src/semaphoretranslatereturncode.c: New files.
  • posix/src/mutexfromcorestatus.c: Removed.
  • Property mode set to 100644
File size: 7.1 KB
RevLine 
[baff4da]1/**
[11874561]2 *  @file  rtems/system.h
[ac7d5ef0]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.
[baff4da]7 */
8
9/*
[7d12442c]10 *  COPYRIGHT (c) 1989-2007.
[ac7d5ef0]11 *  On-Line Applications Research Corporation (OAR).
12 *
[98e4ebf5]13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
[dd687d97]15 *  http://www.rtems.com/license/LICENSE.
[ac7d5ef0]16 *
17 *  $Id$
18 */
19
[092f142a]20#ifndef _RTEMS_SYSTEM_H
21#define _RTEMS_SYSTEM_H
[ac7d5ef0]22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
[a0ed4ed]28 *  The cpu options include file defines all cpu dependent
[541dfb2]29 *  parameters for this build of RTEMS.  It must be included
30 *  first so the basic macro definitions are in place.
[ac7d5ef0]31 */
[61129cc5]32#include <rtems/score/cpuopts.h>
33
[6a07436]34/**
[b5c50309]35 *  The following ensures that all data is declared in the space
[c627b2a3]36 *  of the initialization routine for either the Initialization Manager
[a0ed4ed]37 *  or the initialization file for the appropriate API.  It is
[c627b2a3]38 *  referenced as "external" in every other file.
[ac7d5ef0]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
[6a07436]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 */
[c627b2a3]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
[6a07436]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 */
[c627b2a3]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
[6a07436]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 */
[c627b2a3]82#ifdef POSIX_API_INIT
83#undef  POSIX_EXTERN
84#define POSIX_EXTERN
85#else
86#undef  POSIX_EXTERN
87#define POSIX_EXTERN  extern
[ac7d5ef0]88#endif
89
[6a07436]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 */
[352c9b2]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
[6a07436]104/**
[ac7d5ef0]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 */
[04dba49]110#ifdef __GNUC__
[503dc058]111#  define RTEMS_INLINE_ROUTINE static __inline__
[ac7d5ef0]112#else
[04dba49]113#  define RTEMS_INLINE_ROUTINE static inline
[ac7d5ef0]114#endif
115
[f0ad529]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
[7d12442c]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
[ba41dfd]141#ifdef RTEMS_POSIX_API
[6a07436]142/** The following is used by the POSIX implementation to catch bad paths.  */
[b5c50309]143int POSIX_NOT_IMPLEMENTED( void );
144#endif
145
[ac7d5ef0]146/*
147 *  Include a base set of files.
148 */
149
[6a07436]150/**
[ac7d5ef0]151 * XXX: Eventually proc_ptr needs to disappear!!!
152 */
153typedef void * proc_ptr;
154
[f44f0c7]155#include <stddef.h>
[ac7d5ef0]156
157#if !defined( TRUE ) || (TRUE != 1)
[6a07436]158/**  Boolean constant TRUE */
[ac7d5ef0]159#undef TRUE
160#define TRUE     (1)
161#endif
162
163#if !defined( FALSE ) || (FALSE != 0)
[6a07436]164/**  Boolean constant TRUE */
[ac7d5ef0]165#undef FALSE
166#define FALSE     (0)
167#endif
168
[28b63352]169#include <rtems/stdint.h>
[01a5f6b2]170#include <rtems/score/cpu.h>        /* processor specific information */
171
[6a07436]172/**
173 *  This macro is used to obtain the offset of a field in a structure.
174 */
[b06e68ef]175#define RTEMS_offsetof(type, field) \
[6a07436]176       ((uint32_t  ) &(((type *) 0)->field))
[b06e68ef]177
[6a07436]178/**
[ac7d5ef0]179 *  The following is the extern for the RTEMS version string.
[6a07436]180 *
181 *  @note The contents of this string are CPU specific.
[ac7d5ef0]182 */
[6a07436]183extern const char _RTEMS_version[];
[ac7d5ef0]184
[6a07436]185/**
186 *  The following is the extern for the RTEMS copyright string.
187 */
188extern const char _Copyright_Notice[];
[ac7d5ef0]189
[6a07436]190/**
[ac7d5ef0]191 *  The following defines the CPU dependent information table.
192 */
[6a07436]193SCORE_EXTERN rtems_cpu_table _CPU_Table;
[ac7d5ef0]194
[458bd34]195/*
196 *  Macros to access CPU Table fields required by ALL ports.
197 */
198
[6a07436]199/** This macro assists in accessing the CPU Specific Configuration Table. */
200#define rtems_cpu_configuration_get_table() (&_CPU_Table)
201
[458bd34]202
[6a07436]203/** This macro assists in accessing the pretasking BSP hook. */
[458bd34]204#define rtems_cpu_configuration_get_pretasking_hook() \
205   (_CPU_Table.pretasking_hook)
206
[6a07436]207/** This macro assists in accessing the predriver BSP hook. */
[458bd34]208#define rtems_cpu_configuration_get_predriver_hook() \
209   (_CPU_Table.predriver_hook)
210
[6a07436]211/** This macro assists in accessing the postdriver BSP hook. */
[458bd34]212#define rtems_cpu_configuration_get_postdriver_hook() \
213   (_CPU_Table.postdriver_hook)
214
[6a07436]215/** This macro assists in accessing the BSP specific IDLE task entry point. */
[458bd34]216#define rtems_cpu_configuration_get_idle_task() \
217   (_CPU_Table.idle_task)
218
[6a07436]219/**
220  * This macro assists in accessing the field which indicates whether
221  * RTEMS is responsible for zeroing the Executive Workspace.
222  */
[458bd34]223#define rtems_cpu_configuration_get_do_zero_of_workspace() \
224   (_CPU_Table.do_zero_of_workspace)
225
[6a07436]226/** This macro assists in accessing the IDLE task stack point size. */
[458bd34]227#define rtems_cpu_configuration_get_idle_task_stack_size() \
228   (_CPU_Table.idle_task_stack_size)
229
[6a07436]230/** This macro assists in accessing the interrupt stack size. */
[458bd34]231#define rtems_cpu_configuration_get_interrupt_stack_size() \
232   (_CPU_Table.interrupt_stack_size)
233
[6a07436]234/** This macro assists in accessing the size of the MPCI receiver server. */
[458bd34]235#define rtems_cpu_configuration_get_extra_mpci_receive_server_stack() \
236   (_CPU_Table.extra_mpci_receive_server_stack)
237
[6a07436]238/** This macro assists in accessing the BSP stack allocation hook. */
[458bd34]239#define rtems_cpu_configuration_get_stack_allocate_hook() \
240   (_CPU_Table.stack_allocate_hook)
241
[6a07436]242/** This macro assists in accessing the BSP stack allocation free hook. */
[458bd34]243#define rtems_cpu_configuration_get_stack_free_hook() \
244   (_CPU_Table.stack_free_hook)
245
[6a07436]246/** This macro defines the maximum length of a Classic API name. */
[df49c60]247#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)
[3235ad9]248
[ac7d5ef0]249#ifdef __cplusplus
250}
251#endif
252
253#endif
254/* end of include file */
Note: See TracBrowser for help on using the repository browser.