diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-19 14:19:12 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-19 14:19:12 +0000 |
commit | 60a3fa0c2edea6fbe277706059f37459e3d916bf (patch) | |
tree | c8bb688011b590a33c2e7dd877ca9db2caecb538 /cpukit/score | |
parent | Add missing prototypes. (diff) | |
download | rtems-60a3fa0c2edea6fbe277706059f37459e3d916bf.tar.bz2 |
2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* cpu.c, rtems/score/cpu.h: Add extern for bfffo table and rename it to
indicate that it is specific to this architecture.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/cpu/m68k/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/score/cpu/m68k/cpu.c | 2 | ||||
-rw-r--r-- | cpukit/score/cpu/m68k/rtems/score/cpu.h | 17 |
3 files changed, 17 insertions, 7 deletions
diff --git a/cpukit/score/cpu/m68k/ChangeLog b/cpukit/score/cpu/m68k/ChangeLog index a6dc92c166..4733b975ed 100644 --- a/cpukit/score/cpu/m68k/ChangeLog +++ b/cpukit/score/cpu/m68k/ChangeLog @@ -1,3 +1,8 @@ +2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com> + + * cpu.c, rtems/score/cpu.h: Add extern for bfffo table and rename it to + indicate that it is specific to this architecture. + 2008-07-31 Joel Sherrill <joel.sherrill@OARcorp.com> * rtems/score/cpu.h: Correct prototype of Idle threads. diff --git a/cpukit/score/cpu/m68k/cpu.c b/cpukit/score/cpu/m68k/cpu.c index 6eb3ef7967..cfba5279a1 100644 --- a/cpukit/score/cpu/m68k/cpu.c +++ b/cpukit/score/cpu/m68k/cpu.c @@ -159,7 +159,7 @@ void _CPU_Install_interrupt_stack( void ) /* * Returns table for duplication of the BFFFO instruction (16 bits only) */ -const unsigned char __BFFFOtable[256] = { +const unsigned char _CPU_m68k_BFFFO_table[256] = { 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, diff --git a/cpukit/score/cpu/m68k/rtems/score/cpu.h b/cpukit/score/cpu/m68k/rtems/score/cpu.h index 5d6718f124..b87ba8adef 100644 --- a/cpukit/score/cpu/m68k/rtems/score/cpu.h +++ b/cpukit/score/cpu/m68k/rtems/score/cpu.h @@ -517,6 +517,13 @@ void *_CPU_Thread_Idle_body( uint32_t ); #define CPU_USE_GENERIC_BITFIELD_CODE FALSE #define CPU_USE_GENERIC_BITFIELD_DATA FALSE +#if ( M68K_HAS_BFFFO != 1 ) +/* + * Lookup table for BFFFO simulation + */ +extern const unsigned char _CPU_m68k_BFFFO_table[256]; +#endif + #if ( M68K_HAS_BFFFO == 1 ) #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ @@ -537,9 +544,9 @@ void *_CPU_Thread_Idle_body( uint32_t ); _CPU_Priority_bits_index is not needed), handles the 0 case, and does not molest _value -- jsg */ #if ( defined(__mcoldfire__) ) + #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ { \ - extern const unsigned char __BFFFOtable[256]; \ register int dumby; \ \ asm volatile ( \ @@ -554,13 +561,12 @@ void *_CPU_Thread_Idle_body( uint32_t ); " addq.l #8,%0\n" \ "0: and.l #0xff,%0\n" \ : "=&d" ((_output)), "=&d" ((dumby)) \ - : "d" ((_value)), "ao" ((__BFFFOtable)) \ + : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \ : "cc" ) ; \ } #elif ( M68K_HAS_EXTB_L == 1 ) #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ { \ - extern const unsigned char __BFFFOtable[256]; \ register int dumby; \ \ asm volatile ( " move.w %2,%1\n" \ @@ -573,13 +579,12 @@ void *_CPU_Thread_Idle_body( uint32_t ); " add.b (%3,%2.w),%0\n" \ "0:\n" \ : "=&d" ((_output)), "=&d" ((dumby)) \ - : "d" ((_value)), "ao" ((__BFFFOtable)) \ + : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \ : "cc" ) ; \ } #else #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ { \ - extern const unsigned char __BFFFOtable[256]; \ register int dumby; \ \ asm volatile ( " move.w %2,%1\n" \ @@ -592,7 +597,7 @@ void *_CPU_Thread_Idle_body( uint32_t ); " add.b (%3,%2.w),%0\n" \ "0:\n" \ : "=&d" ((_output)), "=&d" ((dumby)) \ - : "d" ((_value)), "ao" ((__BFFFOtable)) \ + : "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \ : "cc" ) ; \ } #endif |