summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-07 21:36:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-08 15:48:03 +0200
commitb04b76c6a0c87ffc9670d356e793108411ce355a (patch)
treecaa6efe12424e3b91ce1902e50d74c0929d84bcd /cpukit/score/cpu
parentscore: Delete CPU_USE_GENERIC_BITFIELD_DATA (diff)
downloadrtems-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')
-rw-r--r--cpukit/score/cpu/arm/rtems/score/types.h2
-rw-r--r--cpukit/score/cpu/bfin/rtems/score/types.h3
-rw-r--r--cpukit/score/cpu/epiphany/rtems/score/cpu.h1
-rw-r--r--cpukit/score/cpu/epiphany/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/i386/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/lm32/rtems/score/types.h3
-rw-r--r--cpukit/score/cpu/m32c/rtems/score/types.h3
-rw-r--r--cpukit/score/cpu/m68k/rtems/score/types.h2
-rw-r--r--cpukit/score/cpu/mips/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/moxie/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/nios2/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/no_cpu/rtems/score/types.h3
-rw-r--r--cpukit/score/cpu/or1k/rtems/score/cpu.h1
-rw-r--r--cpukit/score/cpu/or1k/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/powerpc/rtems/score/cpu.h3
-rw-r--r--cpukit/score/cpu/powerpc/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/sh/rtems/score/types.h2
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/types.h9
-rw-r--r--cpukit/score/cpu/sparc64/rtems/score/types.h1
-rw-r--r--cpukit/score/cpu/v850/rtems/score/types.h3
20 files changed, 2 insertions, 41 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/types.h b/cpukit/score/cpu/arm/rtems/score/types.h
index deefd54996..37a56df029 100644
--- a/cpukit/score/cpu/arm/rtems/score/types.h
+++ b/cpukit/score/cpu/arm/rtems/score/types.h
@@ -40,8 +40,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
-
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/score/cpu/bfin/rtems/score/types.h b/cpukit/score/cpu/bfin/rtems/score/types.h
index eaa8de6bd9..9865357cdd 100644
--- a/cpukit/score/cpu/bfin/rtems/score/types.h
+++ b/cpukit/score/cpu/bfin/rtems/score/types.h
@@ -34,9 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-/** This defines the type for a priority bit map entry. */
-typedef uint16_t Priority_bit_map_Word;
-
/** This defines the return type for an ISR entry point. */
typedef void blackfin_isr;
diff --git a/cpukit/score/cpu/epiphany/rtems/score/cpu.h b/cpukit/score/cpu/epiphany/rtems/score/cpu.h
index e1dae21e40..9a6428aab4 100644
--- a/cpukit/score/cpu/epiphany/rtems/score/cpu.h
+++ b/cpukit/score/cpu/epiphany/rtems/score/cpu.h
@@ -699,7 +699,6 @@ typedef struct {
#define CPU_MAXIMUM_PROCESSORS 32
#ifndef ASM
-typedef uint16_t Priority_bit_map_Word;
typedef struct {
uint32_t r[62];
diff --git a/cpukit/score/cpu/epiphany/rtems/score/types.h b/cpukit/score/cpu/epiphany/rtems/score/types.h
index 5b6c503739..24c8955fd3 100644
--- a/cpukit/score/cpu/epiphany/rtems/score/types.h
+++ b/cpukit/score/cpu/epiphany/rtems/score/types.h
@@ -53,7 +53,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void epiphany_isr;
typedef void ( *epiphany_isr_entry )( void );
diff --git a/cpukit/score/cpu/i386/rtems/score/types.h b/cpukit/score/cpu/i386/rtems/score/types.h
index 40ccecb1f8..00555d41b5 100644
--- a/cpukit/score/cpu/i386/rtems/score/types.h
+++ b/cpukit/score/cpu/i386/rtems/score/types.h
@@ -34,7 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void i386_isr;
typedef i386_isr ( *i386_isr_entry )( void );
diff --git a/cpukit/score/cpu/lm32/rtems/score/types.h b/cpukit/score/cpu/lm32/rtems/score/types.h
index c0fc8a8a89..c3d8666de4 100644
--- a/cpukit/score/cpu/lm32/rtems/score/types.h
+++ b/cpukit/score/cpu/lm32/rtems/score/types.h
@@ -37,9 +37,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-/** This defines the type for a priority bit map entry. */
-typedef uint16_t Priority_bit_map_Word;
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/score/cpu/m32c/rtems/score/types.h b/cpukit/score/cpu/m32c/rtems/score/types.h
index 11e0a0ceb4..99d8297143 100644
--- a/cpukit/score/cpu/m32c/rtems/score/types.h
+++ b/cpukit/score/cpu/m32c/rtems/score/types.h
@@ -34,9 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef unsigned long CPU_Uint32ptr;
-/** This defines the type for a priority bit map entry. */
-typedef uint16_t Priority_bit_map_Word;
-
/** This defines the return type for an ISR entry point. */
typedef void m32c_isr;
diff --git a/cpukit/score/cpu/m68k/rtems/score/types.h b/cpukit/score/cpu/m68k/rtems/score/types.h
index 96f9a4c37e..947c6ace69 100644
--- a/cpukit/score/cpu/m68k/rtems/score/types.h
+++ b/cpukit/score/cpu/m68k/rtems/score/types.h
@@ -34,8 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/score/cpu/mips/rtems/score/types.h b/cpukit/score/cpu/mips/rtems/score/types.h
index 01950cecef..e3226a3bb4 100644
--- a/cpukit/score/cpu/mips/rtems/score/types.h
+++ b/cpukit/score/cpu/mips/rtems/score/types.h
@@ -43,7 +43,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void mips_isr;
typedef void ( *mips_isr_entry )( void );
diff --git a/cpukit/score/cpu/moxie/rtems/score/types.h b/cpukit/score/cpu/moxie/rtems/score/types.h
index 64427a831a..99402b0208 100644
--- a/cpukit/score/cpu/moxie/rtems/score/types.h
+++ b/cpukit/score/cpu/moxie/rtems/score/types.h
@@ -38,7 +38,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void moxie_isr;
typedef void ( *moxie_isr_entry )( void );
diff --git a/cpukit/score/cpu/nios2/rtems/score/types.h b/cpukit/score/cpu/nios2/rtems/score/types.h
index 6eaee5c829..23cf39419b 100644
--- a/cpukit/score/cpu/nios2/rtems/score/types.h
+++ b/cpukit/score/cpu/nios2/rtems/score/types.h
@@ -34,7 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void nios2_isr;
typedef void ( *nios2_isr_entry )( void );
diff --git a/cpukit/score/cpu/no_cpu/rtems/score/types.h b/cpukit/score/cpu/no_cpu/rtems/score/types.h
index 94a93c2586..b330c33904 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/types.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/types.h
@@ -34,9 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-/** This defines the type for a priority bit map entry. */
-typedef uint16_t Priority_bit_map_Word;
-
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/score/cpu/or1k/rtems/score/cpu.h b/cpukit/score/cpu/or1k/rtems/score/cpu.h
index c75d9d8bad..33717bc6e2 100644
--- a/cpukit/score/cpu/or1k/rtems/score/cpu.h
+++ b/cpukit/score/cpu/or1k/rtems/score/cpu.h
@@ -687,7 +687,6 @@ typedef struct {
#ifndef ASM
typedef uint32_t CPU_Counter_ticks;
-typedef uint16_t Priority_bit_map_Word;
typedef struct {
uint32_t r[32];
diff --git a/cpukit/score/cpu/or1k/rtems/score/types.h b/cpukit/score/cpu/or1k/rtems/score/types.h
index b3beb8371f..09790feb29 100644
--- a/cpukit/score/cpu/or1k/rtems/score/types.h
+++ b/cpukit/score/cpu/or1k/rtems/score/types.h
@@ -39,7 +39,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void or1k_isr;
typedef void ( *or1k_isr_entry )( void );
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
diff --git a/cpukit/score/cpu/sh/rtems/score/types.h b/cpukit/score/cpu/sh/rtems/score/types.h
index d740b2f901..a449a6d6e3 100644
--- a/cpukit/score/cpu/sh/rtems/score/types.h
+++ b/cpukit/score/cpu/sh/rtems/score/types.h
@@ -44,8 +44,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
-
typedef void sh_isr;
typedef void ( *sh_isr_entry )( void );
diff --git a/cpukit/score/cpu/sparc/rtems/score/types.h b/cpukit/score/cpu/sparc/rtems/score/types.h
index 4186012589..6419c9f15f 100644
--- a/cpukit/score/cpu/sparc/rtems/score/types.h
+++ b/cpukit/score/cpu/sparc/rtems/score/types.h
@@ -31,15 +31,6 @@ extern "C" {
typedef uintptr_t CPU_Uint32ptr;
/**
- * @brief Priority bit map type.
- *
- * On the SPARC, there is no bitscan instruction and no penalty associated
- * for using 16-bit variables. With no overriding architectural factors,
- * just using a uint16_t.
- */
-typedef uint16_t Priority_bit_map_Word;
-
-/**
* @brief SPARC ISR handler return type.
*
* This is the type which SPARC ISR Handlers return.
diff --git a/cpukit/score/cpu/sparc64/rtems/score/types.h b/cpukit/score/cpu/sparc64/rtems/score/types.h
index c4d1c7f85e..faf50b7a55 100644
--- a/cpukit/score/cpu/sparc64/rtems/score/types.h
+++ b/cpukit/score/cpu/sparc64/rtems/score/types.h
@@ -33,7 +33,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-typedef uint16_t Priority_bit_map_Word;
typedef void sparc_isr;
typedef void ( *sparc_isr_entry )( void );
diff --git a/cpukit/score/cpu/v850/rtems/score/types.h b/cpukit/score/cpu/v850/rtems/score/types.h
index a209d091f3..bfec49d284 100644
--- a/cpukit/score/cpu/v850/rtems/score/types.h
+++ b/cpukit/score/cpu/v850/rtems/score/types.h
@@ -34,9 +34,6 @@ extern "C" {
/** Type that can store a 32-bit integer or a pointer. */
typedef uintptr_t CPU_Uint32ptr;
-/** This defines the type for a priority bit map entry. */
-typedef uint16_t Priority_bit_map_Word;
-
#ifdef __cplusplus
}
#endif