diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 11:38:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-23 15:12:53 +0200 |
commit | 9108bef646d4ba91c820cf7d5ffda6e5853f1093 (patch) | |
tree | 2f4bdbc5fd225c2b061565d1c0497b70a16f535c /cpukit/rtems/include/rtems/rtems/support.h | |
parent | rtems: Create asr implementation header (diff) | |
download | rtems-9108bef646d4ba91c820cf7d5ffda6e5853f1093.tar.bz2 |
rtems: Merge support API into one file
Diffstat (limited to '')
-rw-r--r-- | cpukit/rtems/include/rtems/rtems/support.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h index 335b8c02fa..e2e01b0b15 100644 --- a/cpukit/rtems/include/rtems/rtems/support.h +++ b/cpukit/rtems/include/rtems/rtems/support.h @@ -18,12 +18,12 @@ #ifndef _RTEMS_RTEMS_SUPPORT_H #define _RTEMS_RTEMS_SUPPORT_H +#include <rtems/rtems/types.h> + #ifdef __cplusplus extern "C" { #endif -#include <rtems/rtems/types.h> - /** * @addtogroup ClassicRTEMS */ @@ -48,6 +48,34 @@ extern "C" { #define RTEMS_MICROSECONDS_TO_TICKS(_us) \ ((_us) / rtems_configuration_get_microseconds_per_tick()) +/** + * @brief Returns @c true if the name is valid, and @c false otherwise. + */ +RTEMS_INLINE_ROUTINE bool rtems_is_name_valid ( + rtems_name name +) +{ + return ( name != 0 ); +} + +/** + * @brief Breaks the object name into the four component characters @a c1, + * @a c2, @a c3, and @a c4. + */ +RTEMS_INLINE_ROUTINE void rtems_name_to_characters( + rtems_name name, + char *c1, + char *c2, + char *c3, + char *c4 +) +{ + *c1 = (char) ((name >> 24) & 0xff); + *c2 = (char) ((name >> 16) & 0xff); + *c3 = (char) ((name >> 8) & 0xff); + *c4 = (char) ( name & 0xff); +} + /** @} */ /** @@ -134,15 +162,9 @@ void rtems_workspace_greedy_free( void *opaque ); /** @} */ -#ifndef __RTEMS_APPLICATION__ -#include <rtems/rtems/support.inl> -#endif - #ifdef __cplusplus } #endif -/**@}*/ - #endif /* end of include file */ |