forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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>
|
2008-07-31 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* rtems/score/cpu.h: Correct prototype of Idle threads.
|
* rtems/score/cpu.h: Correct prototype of Idle threads.
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ void _CPU_Install_interrupt_stack( void )
|
|||||||
/*
|
/*
|
||||||
* Returns table for duplication of the BFFFO instruction (16 bits only)
|
* 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,
|
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,
|
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,
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
|||||||
@@ -517,6 +517,13 @@ void *_CPU_Thread_Idle_body( uint32_t );
|
|||||||
#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
|
#define CPU_USE_GENERIC_BITFIELD_CODE FALSE
|
||||||
#define CPU_USE_GENERIC_BITFIELD_DATA 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 )
|
#if ( M68K_HAS_BFFFO == 1 )
|
||||||
|
|
||||||
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
#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
|
_CPU_Priority_bits_index is not needed), handles the 0 case, and
|
||||||
does not molest _value -- jsg */
|
does not molest _value -- jsg */
|
||||||
#if ( defined(__mcoldfire__) )
|
#if ( defined(__mcoldfire__) )
|
||||||
|
|
||||||
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
||||||
{ \
|
{ \
|
||||||
extern const unsigned char __BFFFOtable[256]; \
|
|
||||||
register int dumby; \
|
register int dumby; \
|
||||||
\
|
\
|
||||||
asm volatile ( \
|
asm volatile ( \
|
||||||
@@ -554,13 +561,12 @@ void *_CPU_Thread_Idle_body( uint32_t );
|
|||||||
" addq.l #8,%0\n" \
|
" addq.l #8,%0\n" \
|
||||||
"0: and.l #0xff,%0\n" \
|
"0: and.l #0xff,%0\n" \
|
||||||
: "=&d" ((_output)), "=&d" ((dumby)) \
|
: "=&d" ((_output)), "=&d" ((dumby)) \
|
||||||
: "d" ((_value)), "ao" ((__BFFFOtable)) \
|
: "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
|
||||||
: "cc" ) ; \
|
: "cc" ) ; \
|
||||||
}
|
}
|
||||||
#elif ( M68K_HAS_EXTB_L == 1 )
|
#elif ( M68K_HAS_EXTB_L == 1 )
|
||||||
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
||||||
{ \
|
{ \
|
||||||
extern const unsigned char __BFFFOtable[256]; \
|
|
||||||
register int dumby; \
|
register int dumby; \
|
||||||
\
|
\
|
||||||
asm volatile ( " move.w %2,%1\n" \
|
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" \
|
" add.b (%3,%2.w),%0\n" \
|
||||||
"0:\n" \
|
"0:\n" \
|
||||||
: "=&d" ((_output)), "=&d" ((dumby)) \
|
: "=&d" ((_output)), "=&d" ((dumby)) \
|
||||||
: "d" ((_value)), "ao" ((__BFFFOtable)) \
|
: "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
|
||||||
: "cc" ) ; \
|
: "cc" ) ; \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
#define _CPU_Bitfield_Find_first_bit( _value, _output ) \
|
||||||
{ \
|
{ \
|
||||||
extern const unsigned char __BFFFOtable[256]; \
|
|
||||||
register int dumby; \
|
register int dumby; \
|
||||||
\
|
\
|
||||||
asm volatile ( " move.w %2,%1\n" \
|
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" \
|
" add.b (%3,%2.w),%0\n" \
|
||||||
"0:\n" \
|
"0:\n" \
|
||||||
: "=&d" ((_output)), "=&d" ((dumby)) \
|
: "=&d" ((_output)), "=&d" ((dumby)) \
|
||||||
: "d" ((_value)), "ao" ((__BFFFOtable)) \
|
: "d" ((_value)), "ao" ((_CPU_m68k_BFFFO_table)) \
|
||||||
: "cc" ) ; \
|
: "cc" ) ; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user