From 97005786d89fd7a57b5fe82f713cea739916f3da Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 30 Oct 1995 21:54:45 +0000 Subject: SPARC port passes all tests --- cpukit/score/include/rtems/score/bitfield.h | 49 +++++++++++++++++++++++++++++ cpukit/score/include/rtems/score/context.h | 5 +-- cpukit/score/include/rtems/score/isr.h | 15 ++++++--- cpukit/score/include/rtems/score/priority.h | 45 ++++++++++++++++++++++++++ 4 files changed, 108 insertions(+), 6 deletions(-) (limited to 'cpukit/score/include/rtems') diff --git a/cpukit/score/include/rtems/score/bitfield.h b/cpukit/score/include/rtems/score/bitfield.h index a74ea97735..6dbf1e0ba0 100644 --- a/cpukit/score/include/rtems/score/bitfield.h +++ b/cpukit/score/include/rtems/score/bitfield.h @@ -38,9 +38,58 @@ extern "C" { * significant impact on the performance of the executive as a whole. */ +#if ( CPU_USE_GENERIC_BITFIELD_DATA == TRUE ) + +#ifndef INIT + extern const unsigned char __log2table[256]; +#else +const unsigned char __log2table[256] = { + 7, 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, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +#endif + +#endif + +#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE ) + #define _Bitfield_Find_first_bit( _value, _bit_number ) \ _CPU_Bitfield_Find_first_bit( _value, _bit_number ) +#else + +/* + * The following must be a macro because if a CPU specific version + * is used it will most likely use inline assembly. + */ + +#define _Bitfield_Find_first_bit( _value, _bit_number ) \ + { \ + register __value = (_value); \ + register const unsigned char *__p = __log2table; \ + \ + if ( __value < 0x100 ) \ + (_bit_number) = __p[ __value ] + 8; \ + else \ + (_bit_number) = __p[ __value >> 8 ]; \ + } + +#endif + #ifdef __cplusplus } #endif diff --git a/cpukit/score/include/rtems/score/context.h b/cpukit/score/include/rtems/score/context.h index b3a423bb47..4cd1f1e4c5 100644 --- a/cpukit/score/include/rtems/score/context.h +++ b/cpukit/score/include/rtems/score/context.h @@ -47,8 +47,9 @@ EXTERN boolean _Context_Switch_necessary; * thread's initial state. */ -#define _Context_Initialize( _the_context, _stack, _size, _isr, _entry ) \ - _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry ) +#define \ + _Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) \ + _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp ) /* * _Context_Switch diff --git a/cpukit/score/include/rtems/score/isr.h b/cpukit/score/include/rtems/score/isr.h index 2409ed394a..bb80823cfb 100644 --- a/cpukit/score/include/rtems/score/isr.h +++ b/cpukit/score/include/rtems/score/isr.h @@ -50,11 +50,18 @@ typedef ISR_Handler ( *ISR_Handler_entry )( ISR_Vector_number ); /* - * This constant promotes out the number of vectors supported by - * the current CPU being used. + * This constant promotes out the number of vectors truly supported by + * the current CPU being used. This is usually the number of distinct vectors + * the cpu can vector. */ -#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS +#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS + +/* + * This constant promotes out the highest valid interrupt vector number. + */ + +#define ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER /* * The following is TRUE if signals have been sent to the currently @@ -75,7 +82,7 @@ EXTERN unsigned32 _ISR_Nest_level; * interrupt service routines are vectored by the ISR Handler via this table. */ -EXTERN ISR_Handler_entry _ISR_Vector_table[CPU_INTERRUPT_NUMBER_OF_VECTORS]; +EXTERN ISR_Handler_entry _ISR_Vector_table[ ISR_NUMBER_OF_VECTORS ]; /* * _ISR_Handler_initialization diff --git a/cpukit/score/include/rtems/score/priority.h b/cpukit/score/include/rtems/score/priority.h index 6639d56e0a..a4a96045d5 100644 --- a/cpukit/score/include/rtems/score/priority.h +++ b/cpukit/score/include/rtems/score/priority.h @@ -113,6 +113,51 @@ STATIC INLINE unsigned32 _Priority_Minor ( Priority_Control the_priority ); +/* + * _Priority_Mask + * + * DESCRIPTION: + * + * This function returns the mask associated with the major or minor + * number passed to it. + */ + +#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE ) + +STATIC INLINE unsigned32 _Priority_Mask ( + unsigned32 bit_number +); + +#else + +#define _Priority_Mask( _bit_number ) \ + _CPU_Priority_Mask( _bit_number ) + +#endif + +/* + * _Priority_Bits_index + * + * DESCRIPTION: + * + * This function translates the bit numbers returned by the bit scan + * of a priority bit field into something suitable for use as + * a major or minor component of a priority. + */ + +#if ( CPU_USE_GENERIC_BITFIELD_CODE == TRUE ) + +STATIC INLINE unsigned32 _Priority_Bits_index ( + unsigned32 bit_number +); + +#else + +#define _Priority_Bits_index( _priority ) \ + _CPU_Priority_bits_index( _priority ) + +#endif + /* * _Priority_Add_to_bit_map * -- cgit v1.2.3