rtems: Create status implementation header

Move implementation specific parts of status.h and status.inl into new
header file statusimpl.h.  The status.h contains now only the
application visible API.
This commit is contained in:
Sebastian Huber
2013-07-23 10:54:37 +02:00
parent 93fb3cb059
commit faa2f8c4e9
17 changed files with 95 additions and 89 deletions

View File

@@ -39,6 +39,7 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/semimpl.h
include_rtems_rtems_HEADERS += include/rtems/rtems/signal.h include_rtems_rtems_HEADERS += include/rtems/rtems/signal.h
include_rtems_rtems_HEADERS += include/rtems/rtems/smp.h include_rtems_rtems_HEADERS += include/rtems/rtems/smp.h
include_rtems_rtems_HEADERS += include/rtems/rtems/status.h include_rtems_rtems_HEADERS += include/rtems/rtems/status.h
include_rtems_rtems_HEADERS += include/rtems/rtems/statusimpl.h
include_rtems_rtems_HEADERS += include/rtems/rtems/support.h include_rtems_rtems_HEADERS += include/rtems/rtems/support.h
include_rtems_rtems_HEADERS += include/rtems/rtems/tasks.h include_rtems_rtems_HEADERS += include/rtems/rtems/tasks.h
include_rtems_rtems_HEADERS += include/rtems/rtems/timer.h include_rtems_rtems_HEADERS += include/rtems/rtems/timer.h
@@ -70,7 +71,6 @@ include_rtems_rtems_HEADERS += inline/rtems/rtems/options.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/part.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/part.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/ratemon.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/ratemon.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/region.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/region.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/status.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/support.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/support.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/tasks.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/tasks.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/timer.inl include_rtems_rtems_HEADERS += inline/rtems/rtems/timer.inl

View File

@@ -21,6 +21,12 @@
#ifndef _RTEMS_RTEMS_STATUS_H #ifndef _RTEMS_RTEMS_STATUS_H
#define _RTEMS_RTEMS_STATUS_H #define _RTEMS_RTEMS_STATUS_H
#include <rtems/score/basedefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @defgroup ClassicStatus Status Codes * @defgroup ClassicStatus Status Codes
* *
@@ -30,10 +36,6 @@
*/ */
/**@{*/ /**@{*/
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @brief Classic API Status * @brief Classic API Status
* *
@@ -188,23 +190,37 @@ typedef enum {
#define RTEMS_STATUS_CODES_LAST RTEMS_PROXY_BLOCKING #define RTEMS_STATUS_CODES_LAST RTEMS_PROXY_BLOCKING
/** /**
* @brief Status Object Name Errors to Status Array * @brief Checks if the status code is equal to RTEMS_SUCCESSFUL.
* *
* This array is used to map SuperCore Object Handler return * This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
* codes to Classic API status codes. * and FALSE otherwise.
*/ */
extern const rtems_status_code _Status_Object_name_errors_to_status[]; RTEMS_INLINE_ROUTINE bool rtems_is_status_successful(
rtems_status_code code
)
{
return (code == RTEMS_SUCCESSFUL);
}
/* /**
* Applications are allowed to use the macros to compare status codes. * @brief Checks if the status code1 is equal to code2.
*
* This function returns TRUE if the status code1 is equal to code2,
* and FALSE otherwise.
*/ */
#include <rtems/rtems/status.inl> RTEMS_INLINE_ROUTINE bool rtems_are_statuses_equal(
rtems_status_code code1,
rtems_status_code code2
)
{
return (code1 == code2);
}
/**@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/**@}*/
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -0,0 +1,49 @@
/**
* @file
*
* @ingroup ClassicStatusImpl
*
* @brief Classic Status Implementation
*/
/* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* 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.
*/
#ifndef _RTEMS_RTEMS_STATUSIMPL_H
#define _RTEMS_RTEMS_STATUSIMPL_H
#include <rtems/rtems/status.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup ClassicStatusImpl Classic Status Implementation
*
* @ingroup ClassicStatus
*
* @{
*/
/**
* @brief Status Object Name Errors to Status Array
*
* This array is used to map SuperCore Object Handler return
* codes to Classic API status codes.
*/
extern const rtems_status_code _Status_Object_name_errors_to_status[];
/**@}*/
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */

View File

@@ -1,60 +0,0 @@
/**
* @file rtems/rtems/status.inl
*
* This include file contains the implementations of the inlined
* routines for the status package.
*/
/* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* 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.
*/
#ifndef _RTEMS_RTEMS_STATUS_H
# error "Never use <rtems/rtems/status.inl> directly; include <rtems/rtems/status.h> instead."
#endif
#ifndef _RTEMS_RTEMS_STATUS_INL
#define _RTEMS_RTEMS_STATUS_INL
#include <rtems/score/basedefs.h>
/**
* @addtogroup ClassicStatus
* @{
*/
/**
* @brief Checks if the status code is equal to RTEMS_SUCCESSFUL.
*
* This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL,
* and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_is_status_successful(
rtems_status_code code
)
{
return (code == RTEMS_SUCCESSFUL);
}
/**
* @brief Checks if the status code1 is equal to code2.
*
* This function returns TRUE if the status code1 is equal to code2,
* and FALSE otherwise.
*/
RTEMS_INLINE_ROUTINE bool rtems_are_statuses_equal(
rtems_status_code code1,
rtems_status_code code2
)
{
return (code1 == code2);
}
/**@}*/
#endif
/* end of include file */

View File

@@ -127,6 +127,10 @@ $(PROJECT_INCLUDE)/rtems/rtems/status.h: include/rtems/rtems/status.h $(PROJECT_
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/status.h $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/status.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/status.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/status.h
$(PROJECT_INCLUDE)/rtems/rtems/statusimpl.h: include/rtems/rtems/statusimpl.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/statusimpl.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/statusimpl.h
$(PROJECT_INCLUDE)/rtems/rtems/support.h: include/rtems/rtems/support.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) $(PROJECT_INCLUDE)/rtems/rtems/support.h: include/rtems/rtems/support.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/support.h $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/support.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/support.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/support.h
@@ -225,10 +229,6 @@ $(PROJECT_INCLUDE)/rtems/rtems/region.inl: inline/rtems/rtems/region.inl $(PROJE
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/region.inl $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/region.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/region.inl PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/region.inl
$(PROJECT_INCLUDE)/rtems/rtems/status.inl: inline/rtems/rtems/status.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/status.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/status.inl
$(PROJECT_INCLUDE)/rtems/rtems/support.inl: inline/rtems/rtems/support.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp) $(PROJECT_INCLUDE)/rtems/rtems/support.inl: inline/rtems/rtems/support.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/support.inl $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/support.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/support.inl PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/support.inl

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/rtems/options.h> #include <rtems/rtems/options.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/address.h> #include <rtems/score/address.h>
#include <rtems/rtems/dpmem.h> #include <rtems/rtems/dpmem.h>

View File

@@ -30,7 +30,7 @@
#if defined(RTEMS_MULTIPROCESSING) #if defined(RTEMS_MULTIPROCESSING)
#include <rtems/score/mpci.h> #include <rtems/score/mpci.h>
#endif #endif
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/attr.h> #include <rtems/rtems/attr.h>
#include <rtems/rtems/messageimpl.h> #include <rtems/rtems/messageimpl.h>
#include <rtems/rtems/options.h> #include <rtems/rtems/options.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/address.h> #include <rtems/score/address.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/isr.h> #include <rtems/score/isr.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/rtems/options.h> #include <rtems/rtems/options.h>

View File

@@ -20,7 +20,7 @@
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/types.h> #include <rtems/rtems/types.h>
#include <rtems/rtems/object.h> #include <rtems/rtems/object.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/rtems/attr.h> #include <rtems/rtems/attr.h>
#include <rtems/score/isr.h> #include <rtems/score/isr.h>

View File

@@ -13,7 +13,7 @@
* http://www.rtems.com/license/LICENSE. * http://www.rtems.com/license/LICENSE.
*/ */
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
const rtems_status_code _Status_Object_name_errors_to_status[] = { const rtems_status_code _Status_Object_name_errors_to_status[] = {
/** This maps OBJECTS_SUCCESSFUL to RTEMS_SUCCESSFUL. */ /** This maps OBJECTS_SUCCESSFUL to RTEMS_SUCCESSFUL. */

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/rtems/modes.h> #include <rtems/rtems/modes.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>

View File

@@ -19,7 +19,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/status.h> #include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/score/thread.h> #include <rtems/score/thread.h>

View File

@@ -20,6 +20,7 @@
#endif #endif
#include <rtems/system.h> #include <rtems/system.h>
#include <rtems/rtems/statusimpl.h>
#include <rtems/rtems/support.h> #include <rtems/rtems/support.h>
#include <rtems/score/object.h> #include <rtems/score/object.h>
#include <rtems/score/thread.h> #include <rtems/score/thread.h>