forked from Imagelibrary/rtems
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* 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>.
This commit is contained in:
@@ -1,3 +1,15 @@
|
|||||||
|
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* 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>.
|
||||||
|
|
||||||
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
* libmd/md4.c: Removed definition of TRUE and FALSE.
|
* libmd/md4.c: Removed definition of TRUE and FALSE.
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ include_rtems_score_HEADERS = include/rtems/score/address.h \
|
|||||||
include/rtems/score/timestamp.h include/rtems/score/timestamp64.h \
|
include/rtems/score/timestamp.h include/rtems/score/timestamp64.h \
|
||||||
include/rtems/score/tod.h include/rtems/score/tqdata.h \
|
include/rtems/score/tod.h include/rtems/score/tqdata.h \
|
||||||
include/rtems/score/userext.h include/rtems/score/watchdog.h \
|
include/rtems/score/userext.h include/rtems/score/watchdog.h \
|
||||||
include/rtems/score/wkspace.h include/rtems/score/cpuopts.h
|
include/rtems/score/wkspace.h include/rtems/score/cpuopts.h \
|
||||||
|
include/rtems/score/basedefs.h
|
||||||
|
|
||||||
if HAS_PTHREADS
|
if HAS_PTHREADS
|
||||||
include_rtems_score_HEADERS += include/rtems/score/corespinlock.h \
|
include_rtems_score_HEADERS += include/rtems/score/corespinlock.h \
|
||||||
|
|||||||
162
cpukit/score/include/rtems/score/basedefs.h
Normal file
162
cpukit/score/include/rtems/score/basedefs.h
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @ingroup Score
|
||||||
|
*
|
||||||
|
* @brief Basic definitions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COPYRIGHT (c) 1989-2007.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 embedded brains GmbH.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _RTEMS_BASEDEFS_H
|
||||||
|
#define _RTEMS_BASEDEFS_H
|
||||||
|
|
||||||
|
#include <rtems/score/cpuopts.h>
|
||||||
|
|
||||||
|
#ifndef ASM
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TRUE == FALSE
|
||||||
|
#error "TRUE equals FALSE"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following ensures that all data is declared in the space
|
||||||
|
* of the initialization routine for either the Initialization Manager
|
||||||
|
* or the initialization file for the appropriate API. It is
|
||||||
|
* referenced as "external" in every other file.
|
||||||
|
*/
|
||||||
|
#ifdef SCORE_INIT
|
||||||
|
#undef SCORE_EXTERN
|
||||||
|
#define SCORE_EXTERN
|
||||||
|
#else
|
||||||
|
#undef SCORE_EXTERN
|
||||||
|
#define SCORE_EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following ensures that all data is declared in the space
|
||||||
|
* of the initialization routine for either the Initialization Manager
|
||||||
|
* or the initialization file for the appropriate API. It is
|
||||||
|
* referenced as "external" in every other file.
|
||||||
|
*/
|
||||||
|
#ifdef SAPI_INIT
|
||||||
|
#undef SAPI_EXTERN
|
||||||
|
#define SAPI_EXTERN
|
||||||
|
#else
|
||||||
|
#undef SAPI_EXTERN
|
||||||
|
#define SAPI_EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following ensures that all data is declared in the space
|
||||||
|
* of the initialization routine for either the Initialization Manager
|
||||||
|
* or the initialization file for the appropriate API. It is
|
||||||
|
* referenced as "external" in every other file.
|
||||||
|
*/
|
||||||
|
#ifdef RTEMS_API_INIT
|
||||||
|
#undef RTEMS_EXTERN
|
||||||
|
#define RTEMS_EXTERN
|
||||||
|
#else
|
||||||
|
#undef RTEMS_EXTERN
|
||||||
|
#define RTEMS_EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following ensures that all data is declared in the space
|
||||||
|
* of the initialization routine for either the Initialization Manager
|
||||||
|
* or the initialization file for the appropriate API. It is
|
||||||
|
* referenced as "external" in every other file.
|
||||||
|
*/
|
||||||
|
#ifdef POSIX_API_INIT
|
||||||
|
#undef POSIX_EXTERN
|
||||||
|
#define POSIX_EXTERN
|
||||||
|
#else
|
||||||
|
#undef POSIX_EXTERN
|
||||||
|
#define POSIX_EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following (in conjunction with compiler arguments) are used
|
||||||
|
* to choose between the use of static inline functions and macro
|
||||||
|
* functions. The static inline implementation allows better
|
||||||
|
* type checking with no cost in code size or execution speed.
|
||||||
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define RTEMS_INLINE_ROUTINE static __inline__
|
||||||
|
#else
|
||||||
|
# define RTEMS_INLINE_ROUTINE static inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following macro is a compiler specific way to ensure that memory
|
||||||
|
* writes are not reordered around certian points. This specifically can
|
||||||
|
* impact interrupt disable and thread dispatching critical sections.
|
||||||
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define RTEMS_COMPILER_MEMORY_BARRIER() asm volatile("" ::: "memory")
|
||||||
|
#else
|
||||||
|
#define RTEMS_COMPILER_MEMORY_BARRIER()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following macro is a compiler specific way to indicate that
|
||||||
|
* the method will NOT return to the caller. This can assist the
|
||||||
|
* compiler in code generation and avoid unreachable paths. This
|
||||||
|
* can impact the code generated following calls to
|
||||||
|
* rtems_fatal_error_occurred and _Internal_error_Occurred.
|
||||||
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE \
|
||||||
|
__attribute__ ((noreturn))
|
||||||
|
#else
|
||||||
|
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instructs the compiler to issue a warning whenever a variable or function
|
||||||
|
* with this attribute will be used.
|
||||||
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE \
|
||||||
|
__attribute__ ((deprecated))
|
||||||
|
#else
|
||||||
|
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASM
|
||||||
|
#ifdef RTEMS_DEPRECATED_TYPES
|
||||||
|
typedef bool boolean;
|
||||||
|
typedef float single_precision;
|
||||||
|
typedef double double_precision;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* XXX: Eventually proc_ptr needs to disappear!!!
|
||||||
|
*/
|
||||||
|
typedef void * proc_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _RTEMS_BASEDEFS_H */
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
#ifndef _RTEMS_PERCPU_H
|
#ifndef _RTEMS_PERCPU_H
|
||||||
#define _RTEMS_PERCPU_H
|
#define _RTEMS_PERCPU_H
|
||||||
|
|
||||||
|
#include <rtems/score/cpu.h>
|
||||||
|
|
||||||
#ifdef ASM
|
#ifdef ASM
|
||||||
#include <rtems/asm.h>
|
#include <rtems/asm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,158 +20,19 @@
|
|||||||
#ifndef _RTEMS_SYSTEM_H
|
#ifndef _RTEMS_SYSTEM_H
|
||||||
#define _RTEMS_SYSTEM_H
|
#define _RTEMS_SYSTEM_H
|
||||||
|
|
||||||
|
#include <rtems/score/percpu.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* The cpu options include file defines all cpu dependent
|
|
||||||
* parameters for this build of RTEMS. It must be included
|
|
||||||
* first so the basic macro definitions are in place.
|
|
||||||
*/
|
|
||||||
#include <rtems/score/cpuopts.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following ensures that all data is declared in the space
|
|
||||||
* of the initialization routine for either the Initialization Manager
|
|
||||||
* or the initialization file for the appropriate API. It is
|
|
||||||
* referenced as "external" in every other file.
|
|
||||||
*/
|
|
||||||
#ifdef SCORE_INIT
|
|
||||||
#undef SCORE_EXTERN
|
|
||||||
#define SCORE_EXTERN
|
|
||||||
#else
|
|
||||||
#undef SCORE_EXTERN
|
|
||||||
#define SCORE_EXTERN extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following ensures that all data is declared in the space
|
|
||||||
* of the initialization routine for either the Initialization Manager
|
|
||||||
* or the initialization file for the appropriate API. It is
|
|
||||||
* referenced as "external" in every other file.
|
|
||||||
*/
|
|
||||||
#ifdef SAPI_INIT
|
|
||||||
#undef SAPI_EXTERN
|
|
||||||
#define SAPI_EXTERN
|
|
||||||
#else
|
|
||||||
#undef SAPI_EXTERN
|
|
||||||
#define SAPI_EXTERN extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following ensures that all data is declared in the space
|
|
||||||
* of the initialization routine for either the Initialization Manager
|
|
||||||
* or the initialization file for the appropriate API. It is
|
|
||||||
* referenced as "external" in every other file.
|
|
||||||
*/
|
|
||||||
#ifdef RTEMS_API_INIT
|
|
||||||
#undef RTEMS_EXTERN
|
|
||||||
#define RTEMS_EXTERN
|
|
||||||
#else
|
|
||||||
#undef RTEMS_EXTERN
|
|
||||||
#define RTEMS_EXTERN extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following ensures that all data is declared in the space
|
|
||||||
* of the initialization routine for either the Initialization Manager
|
|
||||||
* or the initialization file for the appropriate API. It is
|
|
||||||
* referenced as "external" in every other file.
|
|
||||||
*/
|
|
||||||
#ifdef POSIX_API_INIT
|
|
||||||
#undef POSIX_EXTERN
|
|
||||||
#define POSIX_EXTERN
|
|
||||||
#else
|
|
||||||
#undef POSIX_EXTERN
|
|
||||||
#define POSIX_EXTERN extern
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following (in conjunction with compiler arguments) are used
|
|
||||||
* to choose between the use of static inline functions and macro
|
|
||||||
* functions. The static inline implementation allows better
|
|
||||||
* type checking with no cost in code size or execution speed.
|
|
||||||
*/
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# define RTEMS_INLINE_ROUTINE static __inline__
|
|
||||||
#else
|
|
||||||
# define RTEMS_INLINE_ROUTINE static inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following macro is a compiler specific way to ensure that memory
|
|
||||||
* writes are not reordered around certian points. This specifically can
|
|
||||||
* impact interrupt disable and thread dispatching critical sections.
|
|
||||||
*/
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define RTEMS_COMPILER_MEMORY_BARRIER() asm volatile("" ::: "memory")
|
|
||||||
#else
|
|
||||||
#define RTEMS_COMPILER_MEMORY_BARRIER()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The following macro is a compiler specific way to indicate that
|
|
||||||
* the method will NOT return to the caller. This can assist the
|
|
||||||
* compiler in code generation and avoid unreachable paths. This
|
|
||||||
* can impact the code generated following calls to
|
|
||||||
* rtems_fatal_error_occurred and _Internal_error_Occurred.
|
|
||||||
*/
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE \
|
|
||||||
__attribute__ ((noreturn))
|
|
||||||
#else
|
|
||||||
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instructs the compiler to issue a warning whenever a variable or function
|
|
||||||
* with this attribute will be used.
|
|
||||||
*/
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE \
|
|
||||||
__attribute__ ((deprecated))
|
|
||||||
#else
|
|
||||||
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ASM
|
#ifndef ASM
|
||||||
|
|
||||||
#ifdef RTEMS_POSIX_API
|
#ifdef RTEMS_POSIX_API
|
||||||
/** The following is used by the POSIX implementation to catch bad paths. */
|
/** The following is used by the POSIX implementation to catch bad paths. */
|
||||||
int POSIX_NOT_IMPLEMENTED( void );
|
int POSIX_NOT_IMPLEMENTED( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Include a base set of files.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* XXX: Eventually proc_ptr needs to disappear!!!
|
|
||||||
*/
|
|
||||||
typedef void * proc_ptr;
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( TRUE ) || (TRUE != 1)
|
|
||||||
/** Boolean constant TRUE */
|
|
||||||
#undef TRUE
|
|
||||||
#define TRUE (1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( FALSE ) || (FALSE != 0)
|
|
||||||
/** Boolean constant FALSE */
|
|
||||||
#undef FALSE
|
|
||||||
#define FALSE (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ASM
|
|
||||||
#include <stdint.h>
|
|
||||||
#endif
|
|
||||||
#include <rtems/score/cpu.h> /* processor specific information */
|
|
||||||
#include <rtems/score/percpu.h>
|
|
||||||
|
|
||||||
#ifndef ASM
|
|
||||||
/**
|
/**
|
||||||
* This macro is used to obtain the offset of a field in a structure.
|
* This macro is used to obtain the offset of a field in a structure.
|
||||||
*/
|
*/
|
||||||
@@ -192,7 +53,8 @@ extern const char _Copyright_Notice[];
|
|||||||
|
|
||||||
/** This macro defines the maximum length of a Classic API name. */
|
/** This macro defines the maximum length of a Classic API name. */
|
||||||
#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)
|
#define RTEMS_MAXIMUM_NAME_LENGTH sizeof(rtems_name)
|
||||||
#endif
|
|
||||||
|
#endif /* ASM */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,10 @@ $(PROJECT_INCLUDE)/rtems/score/cpuopts.h: include/rtems/score/cpuopts.h $(PROJEC
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuopts.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuopts.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuopts.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuopts.h
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/rtems/score/basedefs.h: include/rtems/score/basedefs.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
|
||||||
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/basedefs.h
|
||||||
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/basedefs.h
|
||||||
|
|
||||||
if HAS_PTHREADS
|
if HAS_PTHREADS
|
||||||
$(PROJECT_INCLUDE)/rtems/score/corespinlock.h: include/rtems/score/corespinlock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
|
$(PROJECT_INCLUDE)/rtems/score/corespinlock.h: include/rtems/score/corespinlock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
|
||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/corespinlock.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/corespinlock.h
|
||||||
|
|||||||
Reference in New Issue
Block a user