summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/m68k/rtems/score/cpu.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-19 14:19:12 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-19 14:19:12 +0000
commit60a3fa0c2edea6fbe277706059f37459e3d916bf (patch)
treec8bb688011b590a33c2e7dd877ca9db2caecb538 /cpukit/score/cpu/m68k/rtems/score/cpu.h
parentAdd missing prototypes. (diff)
downloadrtems-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/cpu/m68k/rtems/score/cpu.h')
-rw-r--r--cpukit/score/cpu/m68k/rtems/score/cpu.h17
1 files changed, 11 insertions, 6 deletions
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