diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-07 21:36:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-08 15:48:03 +0200 |
commit | b04b76c6a0c87ffc9670d356e793108411ce355a (patch) | |
tree | caa6efe12424e3b91ce1902e50d74c0929d84bcd /cpukit/score/cpu/powerpc/rtems/score | |
parent | score: Delete CPU_USE_GENERIC_BITFIELD_DATA (diff) | |
download | rtems-b04b76c6a0c87ffc9670d356e793108411ce355a.tar.bz2 |
score: Simplify priority bit map implementation
The priority bit map can deal with a maximum of 256 priority values
ranging from 0 to 255. Consistently use an unsigned int for
computation, due to the usual integer promotion rules.
Make Priority_bit_map_Word definition architecture-independent and
define it to uint16_t. This was already the case for all architectures
except PowerPC. Adjust the PowerPC bitmap support accordingly.
Diffstat (limited to 'cpukit/score/cpu/powerpc/rtems/score')
-rw-r--r-- | cpukit/score/cpu/powerpc/rtems/score/cpu.h | 3 | ||||
-rw-r--r-- | cpukit/score/cpu/powerpc/rtems/score/types.h | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index beb5127d8f..7a0fa23dcf 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -981,6 +981,7 @@ void _CPU_Context_Initialize( { \ __asm__ volatile ("cntlzw %0, %1" : "=r" ((_output)), "=r" ((_value)) : \ "1" ((_value))); \ + (_output) = (_output) - 16; \ } /* end of Bitfield handler macros */ @@ -992,7 +993,7 @@ void _CPU_Context_Initialize( */ #define _CPU_Priority_Mask( _bit_number ) \ - ( 0x80000000 >> (_bit_number) ) + ( 0x8000u >> (_bit_number) ) /* * This routine translates the bit numbers returned by diff --git a/cpukit/score/cpu/powerpc/rtems/score/types.h b/cpukit/score/cpu/powerpc/rtems/score/types.h index f36038fe09..cdab30234d 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/types.h +++ b/cpukit/score/cpu/powerpc/rtems/score/types.h @@ -51,7 +51,6 @@ extern "C" { /** Type that can store a 32-bit integer or a pointer. */ typedef uintptr_t CPU_Uint32ptr; -typedef uint32_t Priority_bit_map_Word; typedef void ppc_isr; #ifdef __cplusplus |