Changeset ec5d7f92 in rtems


Ignore:
Timestamp:
Jun 7, 2016, 8:09:01 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
987ea1a
Parents:
4c19e59b
git-author:
Sebastian Huber <sebastian.huber@…> (06/07/16 20:09:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/08/16 13:48:02)
Message:

score: Delete dead copy and paste code

Location:
cpukit/score/cpu
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/bfin/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    850850/* end of Fatal Error manager macros */
    851851
    852 /* Bitfield handler macros */
    853 
    854 /**
    855  * @defgroup CPUBitfield Processor Dependent Bitfield Manipulation
    856  *
    857  * This set of routines are used to implement fast searches for
    858  * the most important ready task.
    859  */
    860 /**@{**/
    861 
    862 /**
    863  * This definition is set to TRUE if the port uses the generic bitfield
    864  * manipulation implementation.
    865  */
    866852#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    867853
    868 /**
    869  * This definition is set to TRUE if the port uses the data tables provided
    870  * by the generic bitfield manipulation implementation.
    871  * This can occur when actually using the generic bitfield manipulation
    872  * implementation or when implementing the same algorithm in assembly
    873  * language for improved performance.  It is unlikely that a port will use
    874  * the data if it has a bitfield scan instruction.
    875  */
    876854#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    877 
    878 /**
    879  * This routine sets @a _output to the bit number of the first bit
    880  * set in @a _value.  @a _value is of CPU dependent type
    881  * @a Priority_bit_map_Word.  This type may be either 16 or 32 bits
    882  * wide although only the 16 least significant bits will be used.
    883  *
    884  * There are a number of variables in using a "find first bit" type
    885  * instruction.
    886  *
    887  *   -# What happens when run on a value of zero?
    888  *   -# Bits may be numbered from MSB to LSB or vice-versa.
    889  *   -# The numbering may be zero or one based.
    890  *   -# The "find first bit" instruction may search from MSB or LSB.
    891  *
    892  * RTEMS guarantees that (1) will never happen so it is not a concern.
    893  * (2),(3), (4) are handled by the macros @ref _CPU_Priority_Mask and
    894  * @ref _CPU_Priority_bits_index.  These three form a set of routines
    895  * which must logically operate together.  Bits in the _value are
    896  * set and cleared based on masks built by @ref _CPU_Priority_Mask.
    897  * The basic major and minor values calculated by @ref _Priority_Major
    898  * and @ref _Priority_Minor are "massaged" by @ref _CPU_Priority_bits_index
    899  * to properly range between the values returned by the "find first bit"
    900  * instruction.  This makes it possible for @ref _Priority_Get_highest to
    901  * calculate the major and directly index into the minor table.
    902  * This mapping is necessary to ensure that 0 (a high priority major/minor)
    903  * is the first bit found.
    904  *
    905  * This entire "find first bit" and mapping process depends heavily
    906  * on the manner in which a priority is broken into a major and minor
    907  * components with the major being the 4 MSB of a priority and minor
    908  * the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    909  * priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    910  * to the lowest priority.
    911  *
    912  * If your CPU does not have a "find first bit" instruction, then
    913  * there are ways to make do without it.  Here are a handful of ways
    914  * to implement this in software:
    915  *
    916 @verbatim
    917       - a series of 16 bit test instructions
    918       - a "binary search using if's"
    919       - _number = 0
    920         if _value > 0x00ff
    921           _value >>=8
    922           _number = 8;
    923 
    924         if _value > 0x0000f
    925           _value >=8
    926           _number += 4
    927 
    928         _number += bit_set_table[ _value ]
    929 @endverbatim
    930 
    931  *   where bit_set_table[ 16 ] has values which indicate the first
    932  *     bit set
    933  *
    934  * @param[in] _value is the value to be scanned
    935  * @param[in] _output is the first bit set
    936  *
    937  * Port Specific Information:
    938  *
    939  * XXX document implementation including references if appropriate
    940  */
    941 
    942 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    943 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    944   { \
    945     __asm__ ("bit(1);"):
    946     (_output) = 0;   /* do something to prevent warnings */ \
    947   }
    948 #endif
    949 
    950 /* end of Bitfield handler macros */
    951 
    952 /** @} */
    953 
    954 /**
    955  * This routine builds the mask which corresponds to the bit fields
    956  * as searched by @ref _CPU_Bitfield_Find_first_bit.  See the discussion
    957  * for that routine.
    958  *
    959  * Port Specific Information:
    960  *
    961  * XXX document implementation including references if appropriate
    962  */
    963 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    964 
    965 #define _CPU_Priority_Mask( _bit_number ) \
    966   ( 1 << (_bit_number) )
    967 
    968 #endif
    969 
    970 /**
    971  * @ingroup CPUBitfield
    972  * This routine translates the bit numbers returned by
    973  * @ref _CPU_Bitfield_Find_first_bit into something suitable for use as
    974  * a major or minor component of a priority.  See the discussion
    975  * for that routine.
    976  *
    977  * @param[in] _priority is the major or minor number to translate
    978  *
    979  * Port Specific Information:
    980  *
    981  * XXX document implementation including references if appropriate
    982  */
    983 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    984 
    985 #define _CPU_Priority_bits_index( _priority ) \
    986   (_priority)
    987 
    988 #endif
    989 
    990 /* end of Priority handler macros */
    991855
    992856/* functions */
  • cpukit/score/cpu/epiphany/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    679679/* end of Fatal Error manager macros */
    680680
    681 /* Bitfield handler macros */
    682 
    683 /*
    684  *  This routine sets _output to the bit number of the first bit
    685  *  set in _value.  _value is of CPU dependent type Priority_Bit_map_control.
    686  *  This type may be either 16 or 32 bits wide although only the 16
    687  *  least significant bits will be used.
    688  *
    689  *  There are a number of variables in using a "find first bit" type
    690  *  instruction.
    691  *
    692  *    (1) What happens when run on a value of zero?
    693  *    (2) Bits may be numbered from MSB to LSB or vice-versa.
    694  *    (3) The numbering may be zero or one based.
    695  *    (4) The "find first bit" instruction may search from MSB or LSB.
    696  *
    697  *  RTEMS guarantees that (1) will never happen so it is not a concern.
    698  *  (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
    699  *  _CPU_Priority_bits_index().  These three form a set of routines
    700  *  which must logically operate together.  Bits in the _value are
    701  *  set and cleared based on masks built by _CPU_Priority_mask().
    702  *  The basic major and minor values calculated by _Priority_Major()
    703  *  and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
    704  *  to properly range between the values returned by the "find first bit"
    705  *  instruction.  This makes it possible for _Priority_Get_highest() to
    706  *  calculate the major and directly index into the minor table.
    707  *  This mapping is necessary to ensure that 0 (a high priority major/minor)
    708  *  is the first bit found.
    709  *
    710  *  This entire "find first bit" and mapping process depends heavily
    711  *  on the manner in which a priority is broken into a major and minor
    712  *  components with the major being the 4 MSB of a priority and minor
    713  *  the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    714  *  priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    715  *  to the lowest priority.
    716  *
    717  *  If your CPU does not have a "find first bit" instruction, then
    718  *  there are ways to make do without it.  Here are a handful of ways
    719  *  to implement this in software:
    720  *
    721  *    - a series of 16 bit test instructions
    722  *    - a "binary search using if's"
    723  *    - _number = 0
    724  *      if _value > 0x00ff
    725  *        _value >>=8
    726  *        _number = 8;
    727  *
    728  *      if _value > 0x0000f
    729  *        _value >=8
    730  *        _number += 4
    731  *
    732  *      _number += bit_set_table[ _value ]
    733  *
    734  *    where bit_set_table[ 16 ] has values which indicate the first
    735  *      bit set
    736  *
    737  */
    738 
    739   /* #define CPU_USE_GENERIC_BITFIELD_CODE FALSE */
    740681#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     682
    741683#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    742 
    743 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    744 
    745 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    746   { \
    747     (_output) = 0;   /* do something to prevent warnings */ \
    748   }
    749 #endif
    750 
    751 /* end of Bitfield handler macros */
    752 
    753 /*
    754  *  This routine builds the mask which corresponds to the bit fields
    755  *  as searched by _CPU_Bitfield_Find_first_bit().  See the discussion
    756  *  for that routine.
    757  *
    758  */
    759 
    760 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    761 
    762 #define _CPU_Priority_Mask( _bit_number ) \
    763     (1 << _bit_number)
    764 
    765 #endif
    766 
    767 /*
    768  *  This routine translates the bit numbers returned by
    769  *  _CPU_Bitfield_Find_first_bit() into something suitable for use as
    770  *  a major or minor component of a priority.  See the discussion
    771  *  for that routine.
    772  *
    773  */
    774 
    775 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    776 
    777 #define _CPU_Priority_bits_index( _priority ) \
    778   (_priority)
    779 
    780 #endif
    781684
    782685typedef struct {
  • cpukit/score/cpu/lm32/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    882882/* end of Fatal Error manager macros */
    883883
    884 /* Bitfield handler macros */
    885 
    886 /**
    887  * @defgroup CPUBitfield Processor Dependent Bitfield Manipulation
    888  *
    889  * This set of routines are used to implement fast searches for
    890  * the most important ready task.
    891  */
    892 /**@{**/
    893 
    894 /**
    895  * This definition is set to TRUE if the port uses the generic bitfield
    896  * manipulation implementation.
    897  */
    898884#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    899885
    900 /**
    901  * This definition is set to TRUE if the port uses the data tables provided
    902  * by the generic bitfield manipulation implementation.
    903  * This can occur when actually using the generic bitfield manipulation
    904  * implementation or when implementing the same algorithm in assembly
    905  * language for improved performance.  It is unlikely that a port will use
    906  * the data if it has a bitfield scan instruction.
    907  */
    908886#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    909 
    910 /**
    911  * This routine sets @a _output to the bit number of the first bit
    912  * set in @a _value.  @a _value is of CPU dependent type
    913  * @a Priority_bit_map_Word.  This type may be either 16 or 32 bits
    914  * wide although only the 16 least significant bits will be used.
    915  *
    916  * There are a number of variables in using a "find first bit" type
    917  * instruction.
    918  *
    919  *   -# What happens when run on a value of zero?
    920  *   -# Bits may be numbered from MSB to LSB or vice-versa.
    921  *   -# The numbering may be zero or one based.
    922  *   -# The "find first bit" instruction may search from MSB or LSB.
    923  *
    924  * RTEMS guarantees that (1) will never happen so it is not a concern.
    925  * (2),(3), (4) are handled by the macros @ref _CPU_Priority_Mask and
    926  * @ref _CPU_Priority_bits_index.  These three form a set of routines
    927  * which must logically operate together.  Bits in the _value are
    928  * set and cleared based on masks built by @ref _CPU_Priority_Mask.
    929  * The basic major and minor values calculated by @ref _Priority_Major
    930  * and @ref _Priority_Minor are "massaged" by @ref _CPU_Priority_bits_index
    931  * to properly range between the values returned by the "find first bit"
    932  * instruction.  This makes it possible for @ref _Priority_Get_highest to
    933  * calculate the major and directly index into the minor table.
    934  * This mapping is necessary to ensure that 0 (a high priority major/minor)
    935  * is the first bit found.
    936  *
    937  * This entire "find first bit" and mapping process depends heavily
    938  * on the manner in which a priority is broken into a major and minor
    939  * components with the major being the 4 MSB of a priority and minor
    940  * the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    941  * priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    942  * to the lowest priority.
    943  *
    944  * If your CPU does not have a "find first bit" instruction, then
    945  * there are ways to make do without it.  Here are a handful of ways
    946  * to implement this in software:
    947  *
    948 @verbatim
    949       - a series of 16 bit test instructions
    950       - a "binary search using if's"
    951       - _number = 0
    952         if _value > 0x00ff
    953           _value >>=8
    954           _number = 8;
    955 
    956         if _value > 0x0000f
    957           _value >=8
    958           _number += 4
    959 
    960         _number += bit_set_table[ _value ]
    961 @endverbatim
    962 
    963  *   where bit_set_table[ 16 ] has values which indicate the first
    964  *     bit set
    965  *
    966  * @param[in] _value is the value to be scanned
    967  * @param[in] _output is the first bit set
    968  *
    969  * Port Specific Information:
    970  *
    971  * XXX document implementation including references if appropriate
    972  */
    973 
    974 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    975 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    976   { \
    977     (_output) = 0;   /* do something to prevent warnings */ \
    978   }
    979 #endif
    980 
    981 /* end of Bitfield handler macros */
    982 
    983 /** @} */
    984 
    985 /**
    986  * This routine builds the mask which corresponds to the bit fields
    987  * as searched by @ref _CPU_Bitfield_Find_first_bit.  See the discussion
    988  * for that routine.
    989  *
    990  * Port Specific Information:
    991  *
    992  * XXX document implementation including references if appropriate
    993  */
    994 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    995 
    996 #define _CPU_Priority_Mask( _bit_number ) \
    997   ( 1 << (_bit_number) )
    998 
    999 #endif
    1000 
    1001 /**
    1002  * @ingroup CPUBitfield
    1003  * This routine translates the bit numbers returned by
    1004  * @ref _CPU_Bitfield_Find_first_bit into something suitable for use as
    1005  * a major or minor component of a priority.  See the discussion
    1006  * for that routine.
    1007  *
    1008  * @param[in] _priority is the major or minor number to translate
    1009  *
    1010  * Port Specific Information:
    1011  *
    1012  * XXX document implementation including references if appropriate
    1013  */
    1014 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    1015 
    1016 #define _CPU_Priority_bits_index( _priority ) \
    1017   (_priority)
    1018 
    1019 #endif
    1020 
    1021 /* end of Priority handler macros */
    1022887
    1023888/* functions */
  • cpukit/score/cpu/m32c/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    870870/* end of Fatal Error manager macros */
    871871
    872 /* Bitfield handler macros */
    873 
    874 /**
    875  * @defgroup CPUBitfield Processor Dependent Bitfield Manipulation
    876  *
    877  * This set of routines are used to implement fast searches for
    878  * the most important ready task.
    879  */
    880 /**@{**/
    881 
    882 /**
    883  * This definition is set to TRUE if the port uses the generic bitfield
    884  * manipulation implementation.
    885  */
    886872#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    887873
    888 /**
    889  * This definition is set to TRUE if the port uses the data tables provided
    890  * by the generic bitfield manipulation implementation.
    891  * This can occur when actually using the generic bitfield manipulation
    892  * implementation or when implementing the same algorithm in assembly
    893  * language for improved performance.  It is unlikely that a port will use
    894  * the data if it has a bitfield scan instruction.
    895  */
    896874#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    897 
    898 /**
    899  * This routine sets @a _output to the bit number of the first bit
    900  * set in @a _value.  @a _value is of CPU dependent type
    901  * @a Priority_bit_map_Word.  This type may be either 16 or 32 bits
    902  * wide although only the 16 least significant bits will be used.
    903  *
    904  * There are a number of variables in using a "find first bit" type
    905  * instruction.
    906  *
    907  *   -# What happens when run on a value of zero?
    908  *   -# Bits may be numbered from MSB to LSB or vice-versa.
    909  *   -# The numbering may be zero or one based.
    910  *   -# The "find first bit" instruction may search from MSB or LSB.
    911  *
    912  * RTEMS guarantees that (1) will never happen so it is not a concern.
    913  * (2),(3), (4) are handled by the macros @ref _CPU_Priority_Mask and
    914  * @ref _CPU_Priority_bits_index.  These three form a set of routines
    915  * which must logically operate together.  Bits in the _value are
    916  * set and cleared based on masks built by @ref _CPU_Priority_Mask.
    917  * The basic major and minor values calculated by @ref _Priority_Major
    918  * and @ref _Priority_Minor are "massaged" by @ref _CPU_Priority_bits_index
    919  * to properly range between the values returned by the "find first bit"
    920  * instruction.  This makes it possible for @ref _Priority_Get_highest to
    921  * calculate the major and directly index into the minor table.
    922  * This mapping is necessary to ensure that 0 (a high priority major/minor)
    923  * is the first bit found.
    924  *
    925  * This entire "find first bit" and mapping process depends heavily
    926  * on the manner in which a priority is broken into a major and minor
    927  * components with the major being the 4 MSB of a priority and minor
    928  * the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    929  * priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    930  * to the lowest priority.
    931  *
    932  * If your CPU does not have a "find first bit" instruction, then
    933  * there are ways to make do without it.  Here are a handful of ways
    934  * to implement this in software:
    935  *
    936 @verbatim
    937       - a series of 16 bit test instructions
    938       - a "binary search using if's"
    939       - _number = 0
    940         if _value > 0x00ff
    941           _value >>=8
    942           _number = 8;
    943 
    944         if _value > 0x0000f
    945           _value >=8
    946           _number += 4
    947 
    948         _number += bit_set_table[ _value ]
    949 @endverbatim
    950 
    951  *   where bit_set_table[ 16 ] has values which indicate the first
    952  *     bit set
    953  *
    954  * @param[in] _value is the value to be scanned
    955  * @param[in] _output is the first bit set
    956  *
    957  * Port Specific Information:
    958  *
    959  * XXX document implementation including references if appropriate
    960  */
    961 
    962 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    963 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    964   { \
    965     (_output) = 0;   /* do something to prevent warnings */ \
    966   }
    967 #endif
    968 
    969 /* end of Bitfield handler macros */
    970 
    971 /**
    972  * This routine builds the mask which corresponds to the bit fields
    973  * as searched by @ref _CPU_Bitfield_Find_first_bit.  See the discussion
    974  * for that routine.
    975  *
    976  * Port Specific Information:
    977  *
    978  * XXX document implementation including references if appropriate
    979  */
    980 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    981 
    982 #define _CPU_Priority_Mask( _bit_number ) \
    983   ( 1 << (_bit_number) )
    984 
    985 #endif
    986 
    987 /**
    988  * This routine translates the bit numbers returned by
    989  * @ref _CPU_Bitfield_Find_first_bit into something suitable for use as
    990  * a major or minor component of a priority.  See the discussion
    991  * for that routine.
    992  *
    993  * @param[in] _priority is the major or minor number to translate
    994  *
    995  * Port Specific Information:
    996  *
    997  * XXX document implementation including references if appropriate
    998  */
    999 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    1000 
    1001 #define _CPU_Priority_bits_index( _priority ) \
    1002   (_priority)
    1003 
    1004 #endif
    1005 
    1006 /** @} */
    1007 
    1008 /* end of Priority handler macros */
    1009875
    1010876/* functions */
  • cpukit/score/cpu/mips/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    883883extern void mips_break( int error );
    884884
    885 /* Bitfield handler macros */
    886 
    887 /*
    888  *  This routine sets _output to the bit number of the first bit
    889  *  set in _value.  _value is of CPU dependent type Priority_bit_map_Word.
    890  *  This type may be either 16 or 32 bits wide although only the 16
    891  *  least significant bits will be used.
    892  *
    893  *  There are a number of variables in using a "find first bit" type
    894  *  instruction.
    895  *
    896  *    (1) What happens when run on a value of zero?
    897  *    (2) Bits may be numbered from MSB to LSB or vice-versa.
    898  *    (3) The numbering may be zero or one based.
    899  *    (4) The "find first bit" instruction may search from MSB or LSB.
    900  *
    901  *  RTEMS guarantees that (1) will never happen so it is not a concern.
    902  *  (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
    903  *  _CPU_Priority_bits_index().  These three form a set of routines
    904  *  which must logically operate together.  Bits in the _value are
    905  *  set and cleared based on masks built by _CPU_Priority_mask().
    906  *  The basic major and minor values calculated by _Priority_Major()
    907  *  and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
    908  *  to properly range between the values returned by the "find first bit"
    909  *  instruction.  This makes it possible for _Priority_Get_highest() to
    910  *  calculate the major and directly index into the minor table.
    911  *  This mapping is necessary to ensure that 0 (a high priority major/minor)
    912  *  is the first bit found.
    913  *
    914  *  This entire "find first bit" and mapping process depends heavily
    915  *  on the manner in which a priority is broken into a major and minor
    916  *  components with the major being the 4 MSB of a priority and minor
    917  *  the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    918  *  priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    919  *  to the lowest priority.
    920  *
    921  *  If your CPU does not have a "find first bit" instruction, then
    922  *  there are ways to make do without it.  Here are a handful of ways
    923  *  to implement this in software:
    924  *
    925  *    - a series of 16 bit test instructions
    926  *    - a "binary search using if's"
    927  *    - _number = 0
    928  *      if _value > 0x00ff
    929  *        _value >>=8
    930  *        _number = 8;
    931  *
    932  *      if _value > 0x0000f
    933  *        _value >=8
    934  *        _number += 4
    935  *
    936  *      _number += bit_set_table[ _value ]
    937  *
    938  *    where bit_set_table[ 16 ] has values which indicate the first
    939  *      bit set
    940  */
    941 
    942885#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     886
    943887#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    944 
    945 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    946 
    947 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    948   { \
    949     (_output) = 0;   /* do something to prevent warnings */ \
    950   }
    951 
    952 #endif
    953 
    954 /* end of Bitfield handler macros */
    955 
    956 /*
    957  *  This routine builds the mask which corresponds to the bit fields
    958  *  as searched by _CPU_Bitfield_Find_first_bit().  See the discussion
    959  *  for that routine.
    960  */
    961 
    962 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    963 
    964 #define _CPU_Priority_Mask( _bit_number ) \
    965   ( 1 << (_bit_number) )
    966 
    967 #endif
    968 
    969 /*
    970  *  This routine translates the bit numbers returned by
    971  *  _CPU_Bitfield_Find_first_bit() into something suitable for use as
    972  *  a major or minor component of a priority.  See the discussion
    973  *  for that routine.
    974  */
    975 
    976 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    977 
    978 #define _CPU_Priority_bits_index( _priority ) \
    979   (_priority)
    980 
    981 #endif
    982 
    983 /* end of Priority handler macros */
    984888
    985889/* functions */
  • cpukit/score/cpu/moxie/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    679679/* end of Fatal Error manager macros */
    680680
    681 /* Bitfield handler macros */
    682 
    683 /*
    684  *  This routine sets _output to the bit number of the first bit
    685  *  set in _value.  _value is of CPU dependent type Priority_Bit_map_control.
    686  *  This type may be either 16 or 32 bits wide although only the 16
    687  *  least significant bits will be used.
    688  *
    689  *  There are a number of variables in using a "find first bit" type
    690  *  instruction.
    691  *
    692  *    (1) What happens when run on a value of zero?
    693  *    (2) Bits may be numbered from MSB to LSB or vice-versa.
    694  *    (3) The numbering may be zero or one based.
    695  *    (4) The "find first bit" instruction may search from MSB or LSB.
    696  *
    697  *  RTEMS guarantees that (1) will never happen so it is not a concern.
    698  *  (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
    699  *  _CPU_Priority_bits_index().  These three form a set of routines
    700  *  which must logically operate together.  Bits in the _value are
    701  *  set and cleared based on masks built by _CPU_Priority_mask().
    702  *  The basic major and minor values calculated by _Priority_Major()
    703  *  and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
    704  *  to properly range between the values returned by the "find first bit"
    705  *  instruction.  This makes it possible for _Priority_Get_highest() to
    706  *  calculate the major and directly index into the minor table.
    707  *  This mapping is necessary to ensure that 0 (a high priority major/minor)
    708  *  is the first bit found.
    709  *
    710  *  This entire "find first bit" and mapping process depends heavily
    711  *  on the manner in which a priority is broken into a major and minor
    712  *  components with the major being the 4 MSB of a priority and minor
    713  *  the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    714  *  priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    715  *  to the lowest priority.
    716  *
    717  *  If your CPU does not have a "find first bit" instruction, then
    718  *  there are ways to make do without it.  Here are a handful of ways
    719  *  to implement this in software:
    720  *
    721  *    - a series of 16 bit test instructions
    722  *    - a "binary search using if's"
    723  *    - _number = 0
    724  *      if _value > 0x00ff
    725  *        _value >>=8
    726  *        _number = 8;
    727  *
    728  *      if _value > 0x0000f
    729  *        _value >=8
    730  *        _number += 4
    731  *
    732  *      _number += bit_set_table[ _value ]
    733  *
    734  *    where bit_set_table[ 16 ] has values which indicate the first
    735  *      bit set
    736  *
    737  *  MOXIE Specific Information:
    738  *
    739  *  XXX
    740  */
    741681#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     682
    742683#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    743 
    744 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    745 
    746 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    747   { \
    748     (_output) = 0;   /* do something to prevent warnings */ \
    749   }
    750 
    751 #endif
    752 
    753 /* end of Bitfield handler macros */
    754 
    755 /*
    756  *  This routine builds the mask which corresponds to the bit fields
    757  *  as searched by _CPU_Bitfield_Find_first_bit().  See the discussion
    758  *  for that routine.
    759  *
    760  *  MOXIE Specific Information:
    761  *
    762  *  XXX
    763  */
    764 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    765 
    766 #define _CPU_Priority_Mask( _bit_number ) \
    767   ( 1 << (_bit_number) )
    768 
    769 #endif
    770 
    771 /*
    772  *  This routine translates the bit numbers returned by
    773  *  _CPU_Bitfield_Find_first_bit() into something suitable for use as
    774  *  a major or minor component of a priority.  See the discussion
    775  *  for that routine.
    776  *
    777  *  MOXIE Specific Information:
    778  *
    779  *  XXX
    780  */
    781 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    782 
    783 #define _CPU_Priority_bits_index( _priority ) \
    784   (_priority)
    785 
    786 #endif
    787 
    788 /* end of Priority handler macros */
    789684
    790685/* functions */
  • cpukit/score/cpu/or1k/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    674674/* end of Fatal Error manager macros */
    675675
    676 /* Bitfield handler macros */
    677 
    678 /*
    679  *  This routine sets _output to the bit number of the first bit
    680  *  set in _value.  _value is of CPU dependent type Priority_Bit_map_control.
    681  *  This type may be either 16 or 32 bits wide although only the 16
    682  *  least significant bits will be used.
    683  *
    684  *  There are a number of variables in using a "find first bit" type
    685  *  instruction.
    686  *
    687  *    (1) What happens when run on a value of zero?
    688  *    (2) Bits may be numbered from MSB to LSB or vice-versa.
    689  *    (3) The numbering may be zero or one based.
    690  *    (4) The "find first bit" instruction may search from MSB or LSB.
    691  *
    692  *  RTEMS guarantees that (1) will never happen so it is not a concern.
    693  *  (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
    694  *  _CPU_Priority_bits_index().  These three form a set of routines
    695  *  which must logically operate together.  Bits in the _value are
    696  *  set and cleared based on masks built by _CPU_Priority_mask().
    697  *  The basic major and minor values calculated by _Priority_Major()
    698  *  and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
    699  *  to properly range between the values returned by the "find first bit"
    700  *  instruction.  This makes it possible for _Priority_Get_highest() to
    701  *  calculate the major and directly index into the minor table.
    702  *  This mapping is necessary to ensure that 0 (a high priority major/minor)
    703  *  is the first bit found.
    704  *
    705  *  This entire "find first bit" and mapping process depends heavily
    706  *  on the manner in which a priority is broken into a major and minor
    707  *  components with the major being the 4 MSB of a priority and minor
    708  *  the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    709  *  priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    710  *  to the lowest priority.
    711  *
    712  *  If your CPU does not have a "find first bit" instruction, then
    713  *  there are ways to make do without it.  Here are a handful of ways
    714  *  to implement this in software:
    715  *
    716  *    - a series of 16 bit test instructions
    717  *    - a "binary search using if's"
    718  *    - _number = 0
    719  *      if _value > 0x00ff
    720  *        _value >>=8
    721  *        _number = 8;
    722  *
    723  *      if _value > 0x0000f
    724  *        _value >=8
    725  *        _number += 4
    726  *
    727  *      _number += bit_set_table[ _value ]
    728  *
    729  *    where bit_set_table[ 16 ] has values which indicate the first
    730  *      bit set
    731  *
    732  */
    733 
    734   /* #define CPU_USE_GENERIC_BITFIELD_CODE FALSE */
    735676#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     677
    736678#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    737 
    738 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    739 
    740   /* Get a value between 0 and N where N is the bit size */
    741   /* This routine makes use of the fact that CPUCFGR defines
    742      OB32S to have value 32, and OB64S to have value 64. If
    743      this ever changes then this routine will fail. */
    744 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    745      asm volatile ("l.mfspr %0,r0,0x2   \n\t"\
    746                    "l.andi  %0,%0,0x60  \n\t"\
    747                    "l.ff1   %1,%1,r0    \n\t"\
    748                    "l.sub   %0,%0,%1    \n\t" : "=&r" (_output), "+r" (_value));
    749 
    750 #endif
    751 
    752 /* end of Bitfield handler macros */
    753 
    754 /*
    755  *  This routine builds the mask which corresponds to the bit fields
    756  *  as searched by _CPU_Bitfield_Find_first_bit().  See the discussion
    757  *  for that routine.
    758  *
    759  */
    760 
    761 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    762 
    763 #define _CPU_Priority_Mask( _bit_number ) \
    764     (1 << _bit_number)
    765 
    766 #endif
    767 
    768 /*
    769  *  This routine translates the bit numbers returned by
    770  *  _CPU_Bitfield_Find_first_bit() into something suitable for use as
    771  *  a major or minor component of a priority.  See the discussion
    772  *  for that routine.
    773  *
    774  */
    775 
    776 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    777 
    778 #define _CPU_Priority_bits_index( _priority ) \
    779   (_priority)
    780 
    781 #endif
    782679
    783680typedef struct {
  • cpukit/score/cpu/sh/cpu.c

    r4c19e59b rec5d7f92  
    202202    /* insert your "halt" instruction here */ ;
    203203}
    204 #endif
    205 
    206 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    207 
    208 uint8_t   _bit_set_table[16] =
    209   { 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1,0};
    210 
    211 
    212204#endif
    213205
  • cpukit/score/cpu/sh/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    651651/* end of Fatal Error manager macros */
    652652
    653 /* Bitfield handler macros */
    654 
    655 /*
    656  *  This routine sets _output to the bit number of the first bit
    657  *  set in _value.  _value is of CPU dependent type Priority_bit_map_Word.
    658  *  This type may be either 16 or 32 bits wide although only the 16
    659  *  least significant bits will be used.
    660  *
    661  *  There are a number of variables in using a "find first bit" type
    662  *  instruction.
    663  *
    664  *    (1) What happens when run on a value of zero?
    665  *    (2) Bits may be numbered from MSB to LSB or vice-versa.
    666  *    (3) The numbering may be zero or one based.
    667  *    (4) The "find first bit" instruction may search from MSB or LSB.
    668  *
    669  *  RTEMS guarantees that (1) will never happen so it is not a concern.
    670  *  (2),(3), (4) are handled by the macros _CPU_Priority_mask() and
    671  *  _CPU_Priority_bits_index().  These three form a set of routines
    672  *  which must logically operate together.  Bits in the _value are
    673  *  set and cleared based on masks built by _CPU_Priority_mask().
    674  *  The basic major and minor values calculated by _Priority_Major()
    675  *  and _Priority_Minor() are "massaged" by _CPU_Priority_bits_index()
    676  *  to properly range between the values returned by the "find first bit"
    677  *  instruction.  This makes it possible for _Priority_Get_highest() to
    678  *  calculate the major and directly index into the minor table.
    679  *  This mapping is necessary to ensure that 0 (a high priority major/minor)
    680  *  is the first bit found.
    681  *
    682  *  This entire "find first bit" and mapping process depends heavily
    683  *  on the manner in which a priority is broken into a major and minor
    684  *  components with the major being the 4 MSB of a priority and minor
    685  *  the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    686  *  priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    687  *  to the lowest priority.
    688  *
    689  *  If your CPU does not have a "find first bit" instruction, then
    690  *  there are ways to make do without it.  Here are a handful of ways
    691  *  to implement this in software:
    692  *
    693  *    - a series of 16 bit test instructions
    694  *    - a "binary search using if's"
    695  *    - _number = 0
    696  *      if _value > 0x00ff
    697  *        _value >>=8
    698  *        _number = 8;
    699  *
    700  *      if _value > 0x0000f
    701  *        _value >=8
    702  *        _number += 4
    703  *
    704  *      _number += bit_set_table[ _value ]
    705  *
    706  *    where bit_set_table[ 16 ] has values which indicate the first
    707  *      bit set
    708  */
    709 
    710653#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
     654
    711655#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    712 
    713 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    714 
    715 extern uint8_t   _bit_set_table[];
    716 
    717 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    718   { \
    719       _output = 0;\
    720       if(_value > 0x00ff) \
    721       { _value >>= 8; _output = 8; } \
    722       if(_value > 0x000f) \
    723         { _output += 4; _value >>= 4; } \
    724       _output += _bit_set_table[ _value]; }
    725 
    726 #endif
    727 
    728 /* end of Bitfield handler macros */
    729 
    730 /*
    731  *  This routine builds the mask which corresponds to the bit fields
    732  *  as searched by _CPU_Bitfield_Find_first_bit().  See the discussion
    733  *  for that routine.
    734  */
    735 
    736 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    737 
    738 #define _CPU_Priority_Mask( _bit_number ) \
    739   ( 1 << (_bit_number) )
    740 
    741 #endif
    742 
    743 /*
    744  *  This routine translates the bit numbers returned by
    745  *  _CPU_Bitfield_Find_first_bit() into something suitable for use as
    746  *  a major or minor component of a priority.  See the discussion
    747  *  for that routine.
    748  */
    749 
    750 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    751 
    752 #define _CPU_Priority_bits_index( _priority ) \
    753   (_priority)
    754 
    755 #endif
    756 
    757 /* end of Priority handler macros */
    758656
    759657/* functions */
  • cpukit/score/cpu/v850/rtems/score/cpu.h

    r4c19e59b rec5d7f92  
    834834/* end of Fatal Error manager macros */
    835835
    836 /* Bitfield handler macros */
    837 
    838 /**
    839  * @defgroup CPUBitfield Processor Dependent Bitfield Manipulation
    840  *
    841  * This set of routines are used to implement fast searches for
    842  * the most important ready task.
    843  */
    844 /**@{**/
    845 
    846 /**
    847  * This definition is set to TRUE if the port uses the generic bitfield
    848  * manipulation implementation.
    849  */
    850836#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
    851837
    852 /**
    853  * This definition is set to TRUE if the port uses the data tables provided
    854  * by the generic bitfield manipulation implementation.
    855  * This can occur when actually using the generic bitfield manipulation
    856  * implementation or when implementing the same algorithm in assembly
    857  * language for improved performance.  It is unlikely that a port will use
    858  * the data if it has a bitfield scan instruction.
    859  *
    860  * Port Specific Information:
    861  *
    862  * There is no single v850 instruction to do a bit scan so there is
    863  * no CPU specific implementation of bit field scanning. The empty
    864  * stub routines are left as a place holder in case someone figures
    865  * out how to do a v850 implementation better than the generic algorithm.
    866  */
    867838#define CPU_USE_GENERIC_BITFIELD_DATA TRUE
    868 
    869 /**
    870  * This routine sets @a _output to the bit number of the first bit
    871  * set in @a _value.  @a _value is of CPU dependent type
    872  * @a Priority_bit_map_Word.  This type may be either 16 or 32 bits
    873  * wide although only the 16 least significant bits will be used.
    874  *
    875  * There are a number of variables in using a "find first bit" type
    876  * instruction.
    877  *
    878  *   -# What happens when run on a value of zero?
    879  *   -# Bits may be numbered from MSB to LSB or vice-versa.
    880  *   -# The numbering may be zero or one based.
    881  *   -# The "find first bit" instruction may search from MSB or LSB.
    882  *
    883  * RTEMS guarantees that (1) will never happen so it is not a concern.
    884  * (2),(3), (4) are handled by the macros @ref _CPU_Priority_Mask and
    885  * @ref _CPU_Priority_bits_index.  These three form a set of routines
    886  * which must logically operate together.  Bits in the _value are
    887  * set and cleared based on masks built by @ref _CPU_Priority_Mask.
    888  * The basic major and minor values calculated by @ref _Priority_Major
    889  * and @ref _Priority_Minor are "massaged" by @ref _CPU_Priority_bits_index
    890  * to properly range between the values returned by the "find first bit"
    891  * instruction.  This makes it possible for @ref _Priority_Get_highest to
    892  * calculate the major and directly index into the minor table.
    893  * This mapping is necessary to ensure that 0 (a high priority major/minor)
    894  * is the first bit found.
    895  *
    896  * This entire "find first bit" and mapping process depends heavily
    897  * on the manner in which a priority is broken into a major and minor
    898  * components with the major being the 4 MSB of a priority and minor
    899  * the 4 LSB.  Thus (0 << 4) + 0 corresponds to priority 0 -- the highest
    900  * priority.  And (15 << 4) + 14 corresponds to priority 254 -- the next
    901  * to the lowest priority.
    902  *
    903  * If your CPU does not have a "find first bit" instruction, then
    904  * there are ways to make do without it.  Here are a handful of ways
    905  * to implement this in software:
    906  *
    907 @verbatim
    908       - a series of 16 bit test instructions
    909       - a "binary search using if's"
    910       - _number = 0
    911         if _value > 0x00ff
    912           _value >>=8
    913           _number = 8;
    914 
    915         if _value > 0x0000f
    916           _value >=8
    917           _number += 4
    918 
    919         _number += bit_set_table[ _value ]
    920 @endverbatim
    921 
    922  *   where bit_set_table[ 16 ] has values which indicate the first
    923  *     bit set
    924  *
    925  * @param[in] _value is the value to be scanned
    926  * @param[in] _output is the first bit set
    927  *
    928  * Port Specific Information:
    929  *
    930  * There is no single v850 instruction to do a bit scan so there is
    931  * no CPU specific implementation of bit field scanning.
    932  */
    933 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    934 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \
    935   { \
    936     (_output) = 0;   /* do something to prevent warnings */ \
    937   }
    938 #endif
    939 
    940 /* end of Bitfield handler macros */
    941 
    942 /**
    943  * This routine builds the mask which corresponds to the bit fields
    944  * as searched by @ref _CPU_Bitfield_Find_first_bit.  See the discussion
    945  * for that routine.
    946  *
    947  * Port Specific Information:
    948  *
    949  * There is no single v850 instruction to do a bit scan so there is
    950  * no CPU specific implementation of bit field scanning.
    951  */
    952 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    953 
    954 #define _CPU_Priority_Mask( _bit_number ) \
    955   ( 1 << (_bit_number) )
    956 
    957 #endif
    958 
    959 /**
    960  * This routine translates the bit numbers returned by
    961  * @ref _CPU_Bitfield_Find_first_bit into something suitable for use as
    962  * a major or minor component of a priority.  See the discussion
    963  * for that routine.
    964  *
    965  * @param[in] _priority is the major or minor number to translate
    966  *
    967  * Port Specific Information:
    968  *
    969  * There is no single v850 instruction to do a bit scan so there is
    970  * no CPU specific implementation of bit field scanning.
    971  */
    972 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE)
    973 
    974 #define _CPU_Priority_bits_index( _priority ) \
    975   (_priority)
    976 
    977 #endif
    978 
    979 /* end of Priority handler macros */
    980 
    981 /** @} */
    982839
    983840/* functions */
Note: See TracChangeset for help on using the changeset viewer.