diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-18 13:55:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:56:58 +0200 |
commit | c624c0e9e219cd89b651021b45ee8b4e24ff8c19 (patch) | |
tree | 311d790efb9ed49d614612ef1b8587e60656bdcf /cpukit/posix/include | |
parent | posix: Create semaphore implementation header (diff) | |
download | rtems-c624c0e9e219cd89b651021b45ee8b4e24ff8c19.tar.bz2 |
posix: Convert to inline function
Diffstat (limited to 'cpukit/posix/include')
-rw-r--r-- | cpukit/posix/include/rtems/posix/semaphoreimpl.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cpukit/posix/include/rtems/posix/semaphoreimpl.h b/cpukit/posix/include/rtems/posix/semaphoreimpl.h index 6d1939fe43..43b0e2b854 100644 --- a/cpukit/posix/include/rtems/posix/semaphoreimpl.h +++ b/cpukit/posix/include/rtems/posix/semaphoreimpl.h @@ -22,6 +22,8 @@ #include <rtems/posix/semaphore.h> #include <rtems/posix/posixapi.h> +#include <errno.h> + #ifdef __cplusplus extern "C" { #endif @@ -33,6 +35,9 @@ extern "C" { POSIX_EXTERN Objects_Information _POSIX_Semaphore_Information; +extern const int + _POSIX_Semaphore_Return_codes[CORE_SEMAPHORE_STATUS_LAST + 1]; + /* * _POSIX_Semaphore_Manager_initialization * @@ -136,9 +141,20 @@ int _POSIX_Semaphore_Wait_support( * appropriate POSIX status values. */ -int _POSIX_Semaphore_Translate_core_semaphore_return_code( +RTEMS_INLINE_ROUTINE int +_POSIX_Semaphore_Translate_core_semaphore_return_code( CORE_semaphore_Status the_semaphore_status -); +) +{ + /* + * Internal consistency check for bad status from SuperCore + */ + #if defined(RTEMS_DEBUG) + if ( the_semaphore_status > CORE_SEMAPHORE_STATUS_LAST ) + return EINVAL; + #endif + return _POSIX_Semaphore_Return_codes[the_semaphore_status]; +} /* * _POSIX_Semaphore_Allocate |