Changeset b028e72 in rtems


Ignore:
Timestamp:
Jan 5, 2009, 8:09:02 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
dee98ce
Parents:
e64a143
Message:

2009-01-05 Joel Sherrill <joel.sherrill@…>

  • score/include/rtems/score/object.h, score/src/objectallocatebyindex.c: Object index should be int. Fix bug when index is negative.
  • score/src/objectextendinformation.c: Do not allow maximum number of allocated objects to exceed maximum representable in index field of Object Id.
  • score/src/objectgetisr.c: Use same code that is in _Objects_Get to extract index field of Object Id.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    re64a143 rb028e72  
     12009-01-05      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * score/include/rtems/score/object.h,
     4        score/src/objectallocatebyindex.c: Object index should be int.
     5        Fix bug when index is negative.
     6        * score/src/objectextendinformation.c: Do not allow maximum number
     7        of allocated objects to exceed maximum representable in index
     8        field of Object Id.
     9        * score/src/objectgetisr.c: Use same code that is in _Objects_Get
     10        to extract index field of Object Id.
     11
    1122009-01-05      Joel Sherrill <joel.sherrill@oarcorp.com>
    213
  • cpukit/score/include/rtems/score/object.h

    re64a143 rb028e72  
    520520Objects_Control *_Objects_Allocate_by_index(
    521521  Objects_Information *information,
    522   uint16_t             the_index,
     522  int                  the_index,
    523523  uint16_t             sizeof_control
    524524);
  • cpukit/score/src/objectallocatebyindex.c

    re64a143 rb028e72  
    4242Objects_Control *_Objects_Allocate_by_index(
    4343  Objects_Information *information,
    44   uint16_t             the_index,
     44  int                  the_index,
    4545  uint16_t             sizeof_control
    4646)
     
    4848  Objects_Control *the_object;
    4949
    50   if ( the_index && information->maximum >= the_index ) {
     50  if ( the_index > 0 && information->maximum >= the_index ) {
    5151    the_object = information->local_table[ the_index ];
    5252    if ( the_object )
     
    5454
    5555    /* XXX
    56      *  This whole section of code needs to be addressed.
     56     *  This whole section of code needs to be evaluated for unlimited objects.
    5757     *    +  The 0 should be dealt with more properly so we can autoextend.
    58      *    +  The pointer arithmetic is probably too expensive.
     58     *    +  The pointer arithmetic is probably too expensive but is likely
     59     *       necessary especially on targets with 16 bit offset limits.
    5960     *    +  etc.
    6061     */
  • cpukit/score/src/objectextendinformation.c

    re64a143 rb028e72  
    115115
    116116    /*
     117     *  We need to limit the number of objects to the maximum number
     118     *  representable in the index portion of the object Id.  In the
     119     *  case of 16-bit Ids, this is only 256 object instances.
     120     */
     121    if ( maximum > OBJECTS_ID_FINAL_INDEX )
     122      return;
     123
     124    /*
    117125     *  Allocate the tables and break it up.
    118126     */
  • cpukit/score/src/objectgetisr.c

    re64a143 rb028e72  
    6262  ISR_Level        level;
    6363
    64 #if defined(RTEMS_MULTIPROCESSING)
    6564  index = id - information->minimum_id + 1;
    66 #else
    67   /* index = _Objects_Get_index( id ); */
    68   index = id & 0x0000ffff;
    69   /* This should work but doesn't always :( */
    70   /* index = (uint16_t  ) id; */
    71 #endif
    7265
    7366  _ISR_Disable( level );
Note: See TracChangeset for help on using the changeset viewer.