diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-13 07:09:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-13 07:15:10 +0200 |
commit | f5eff007a44ad20c2a420b66903508e9d6c3b066 (patch) | |
tree | b5cfd3714b65c65d96297051e0f9342d91beabd1 | |
parent | libmisc/xz: Add xz decompression. (diff) | |
download | rtems-f5eff007a44ad20c2a420b66903508e9d6c3b066.tar.bz2 |
score: Rename RTEMS_OBFUSCATE_POINTER()
The inline asm construct works for everything which fits into a
register.
Close #2790.
-rw-r--r-- | cpukit/score/include/rtems/linkersets.h | 4 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/basedefs.h | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/linkersets.h b/cpukit/score/include/rtems/linkersets.h index b790fa5c24..390d2cba34 100644 --- a/cpukit/score/include/rtems/linkersets.h +++ b/cpukit/score/include/rtems/linkersets.h @@ -30,13 +30,13 @@ extern "C" { #define RTEMS_LINKER_SET_ASSIGN_BEGIN( set, item ) \ do { \ item = _LINKER_SET_BEGIN( set ); \ - RTEMS_OBFUSCATE_POINTER( item ); \ + RTEMS_OBFUSCATE_VARIABLE( item ); \ } while ( 0 ) #define RTEMS_LINKER_SET_ASSIGN_END( set, item ) \ do { \ item = _LINKER_SET_END( set ); \ - RTEMS_OBFUSCATE_POINTER( item ); \ + RTEMS_OBFUSCATE_VARIABLE( item ); \ } while ( 0 ) #define RTEMS_LINKER_SET_SIZE( set ) \ diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h index ea4d8314ce..d142163e91 100644 --- a/cpukit/score/include/rtems/score/basedefs.h +++ b/cpukit/score/include/rtems/score/basedefs.h @@ -222,13 +222,15 @@ #endif /** - * @brief Obfuscates the pointer so that the compiler cannot perform - * optimizations based on the pointer value. + * @brief Obfuscates the variable so that the compiler cannot perform + * optimizations based on the variable value. + * + * The variable must be simple enough to fit into a register. */ #if defined(__GNUC__) - #define RTEMS_OBFUSCATE_POINTER( _ptr ) __asm__("" : "+r" (_ptr)) + #define RTEMS_OBFUSCATE_VARIABLE( _var ) __asm__("" : "+r" (_var)) #else - #define RTEMS_OBFUSCATE_POINTER( _ptr ) (void) (_ptr) + #define RTEMS_OBFUSCATE_VARIABLE( _var ) (void) (_var) #endif #if __cplusplus >= 201103L |