diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 10:54:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 15:12:52 +0200 |
commit | faa2f8c4e9145c629ad7670d0869c1caed33abc2 (patch) | |
tree | 27afeca6b33e3149b4c305e03e81a6a8746953d4 /cpukit/rtems/include/rtems/rtems | |
parent | score: Create rbtree implementation header (diff) | |
download | rtems-faa2f8c4e9145c629ad7670d0869c1caed33abc2.tar.bz2 |
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.
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/status.h | 42 | ||||
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/statusimpl.h | 49 |
2 files changed, 78 insertions, 13 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/status.h b/cpukit/rtems/include/rtems/rtems/status.h index 9732d290f0..4dad087435 100644 --- a/cpukit/rtems/include/rtems/rtems/status.h +++ b/cpukit/rtems/include/rtems/rtems/status.h @@ -21,6 +21,12 @@ #ifndef _RTEMS_RTEMS_STATUS_H #define _RTEMS_RTEMS_STATUS_H +#include <rtems/score/basedefs.h> + +#ifdef __cplusplus +extern "C" { +#endif + /** * @defgroup ClassicStatus Status Codes * @@ -30,10 +36,6 @@ */ /**@{*/ -#ifdef __cplusplus -extern "C" { -#endif - /** * @brief Classic API Status * @@ -188,23 +190,37 @@ typedef enum { #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 - * codes to Classic API status codes. + * This function returns TRUE if the status code is equal to RTEMS_SUCCESSFUL, + * 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 } #endif -/**@}*/ - #endif /* end of include file */ diff --git a/cpukit/rtems/include/rtems/rtems/statusimpl.h b/cpukit/rtems/include/rtems/rtems/statusimpl.h new file mode 100644 index 0000000000..1f74c6e332 --- /dev/null +++ b/cpukit/rtems/include/rtems/rtems/statusimpl.h @@ -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 */ |