From 18e29faf9898a4011e042daaa75bc30a7b56ffdd Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 8 Jun 2016 10:10:40 +0200 Subject: score: Delete CPU_USE_GENERIC_BITFIELD_DATA Rename __log2table into _Bitfield_Leading_zeros since it acually returns the count of leading zeros of an 8-bit integer. The value for zero is a bit odd. Provide it unconditionally. --- cpukit/score/cpu/nios2/rtems/score/cpu.h | 2 -- cpukit/score/cpu/nios2/rtems/score/nios2-count-zeros.h | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'cpukit/score/cpu/nios2') diff --git a/cpukit/score/cpu/nios2/rtems/score/cpu.h b/cpukit/score/cpu/nios2/rtems/score/cpu.h index 0dd7ed4fab..4c56de0a16 100644 --- a/cpukit/score/cpu/nios2/rtems/score/cpu.h +++ b/cpukit/score/cpu/nios2/rtems/score/cpu.h @@ -105,8 +105,6 @@ extern "C" { #define CPU_USE_GENERIC_BITFIELD_CODE TRUE -#define CPU_USE_GENERIC_BITFIELD_DATA TRUE - #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 #define CPU_PER_CPU_CONTROL_SIZE 0 diff --git a/cpukit/score/cpu/nios2/rtems/score/nios2-count-zeros.h b/cpukit/score/cpu/nios2/rtems/score/nios2-count-zeros.h index 0ec259aa0c..bf2390a51f 100644 --- a/cpukit/score/cpu/nios2/rtems/score/nios2-count-zeros.h +++ b/cpukit/score/cpu/nios2/rtems/score/nios2-count-zeros.h @@ -37,17 +37,17 @@ static inline unsigned _Nios2_Count_leading_zeros( uint32_t p ) if ( p <= 0xffffu ) { if ( p < 0x100u ) { - bitIdx = __log2table[ p ] + 24u; + bitIdx = _Bitfield_Leading_zeros[ p ] + 24u; } else { - bitIdx = __log2table[ p >> 8u ] + 16u; + bitIdx = _Bitfield_Leading_zeros[ p >> 8u ] + 16u; } } else { p >>= 16u; if ( p < 0x100u ) { - bitIdx = __log2table[ p ] + 8u; + bitIdx = _Bitfield_Leading_zeros[ p ] + 8u; } else { - bitIdx = __log2table[ p >> 8u ]; + bitIdx = _Bitfield_Leading_zeros[ p >> 8u ]; } } -- cgit v1.2.3