Changeset ef9505a9 in rtems for cpukit/score/inline


Ignore:
Timestamp:
Jul 1, 2002, 10:30:12 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
0577ec1d
Parents:
3a05d15
Message:

2002-07-01 Joel Sherrill <joel@…>

  • Mega patch merge to change the format of the object IDs to loosen the dependency between the SCORE and the various APIs. There was considerable work to simplify the object name management and it appears that the name_table field is no longer needed. This patch also includes the addition of the internal mutex which is currently only used to protect some types of allocation and deallocation. This significantly can reduce context switch latency under certain circumstances. In particular, some heap/region operations were O(n) and had dispatching disabled. This should help enormously. With this merge, the patch is not as clean as it should be. In particular, the documentation has not been modified to reflect the new object ID layout, the IDs in the test screens are not updated, and _Objects_Get_information needs to be a real routine not inlined. As part of this patch a lot of MP code for thread/proxy blocking was made conditional and cleaned up.
  • include/Makefile.am, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/object.h, include/rtems/score/threadq.h, inline/rtems/score/object.inl, inline/rtems/score/thread.inl, macros/rtems/score/object.inl, src/Makefile.am, src/coremsg.c, src/coremutex.c, src/coresem.c, src/mpci.c, src/objectcomparenameraw.c, src/objectextendinformation.c, src/objectinitializeinformation.c, src/objectnametoid.c, src/thread.c, src/threadclose.c, src/threadget.c, src/threadq.c, src/threadqextractwithproxy.c: Modified as part of above.
  • include/rtems/score/apimutex.h, src/objectgetnoprotection.c: New files.
Location:
cpukit/score/inline/rtems/score
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/inline/rtems/score/object.inl

    r3a05d15 ref9505a9  
    44 *  of the inlined routines in the Object Handler.
    55 *
    6  *  COPYRIGHT (c) 1989-1999.
     6 *  COPYRIGHT (c) 1989-2002.
    77 *  On-Line Applications Research Corporation (OAR).
    88 *
     
    2828
    2929RTEMS_INLINE_ROUTINE Objects_Id _Objects_Build_id(
    30   Objects_Classes  the_class,
     30  Objects_APIs     the_api,
     31  unsigned32       the_class,
    3132  unsigned32       node,
    3233  unsigned32       index
    3334)
    3435{
    35   return (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
    36          (( (Objects_Id) node ) << OBJECTS_NODE_START_BIT)       |
    37          (( (Objects_Id) index ) << OBJECTS_INDEX_START_BIT);
     36  return (( (Objects_Id) the_api )   << OBJECTS_API_START_BIT)   |
     37         (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
     38         (( (Objects_Id) node )      << OBJECTS_NODE_START_BIT)  |
     39         (( (Objects_Id) index )     << OBJECTS_INDEX_START_BIT);
     40}
     41
     42/*PAGE
     43 *
     44 *  _Objects_Get_API
     45 *
     46 *  DESCRIPTION:
     47 *
     48 *  This function returns the API portion of the ID.
     49 */
     50
     51RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API(
     52  Objects_Id id
     53)
     54{
     55  return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS);
    3856}
    3957
     
    4765 */
    4866 
    49 RTEMS_INLINE_ROUTINE Objects_Classes _Objects_Get_class(
    50   Objects_Id id
    51 )
    52 {
    53   return (Objects_Classes)
     67RTEMS_INLINE_ROUTINE unsigned32 _Objects_Get_class(
     68  Objects_Id id
     69)
     70{
     71  return (unsigned32)
    5472    ((id >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS);
    5573}
    5674 
    57 
    5875/*PAGE
    5976 *
     
    98115 
    99116RTEMS_INLINE_ROUTINE boolean _Objects_Is_class_valid(
    100   Objects_Classes the_class
    101 )
    102 {
    103   return the_class && the_class <= OBJECTS_CLASSES_LAST;
     117  unsigned32 the_class
     118)
     119{
     120  /* XXX how do we determine this now? */
     121  return TRUE; /* the_class && the_class <= OBJECTS_CLASSES_LAST; */
    104122}
    105123
     
    211229)
    212230{
    213   Objects_Classes  the_class;
     231  Objects_APIs  the_api;
     232  unsigned32    the_class;
     233
    214234
    215235  the_class = _Objects_Get_class( id );
     
    218238    return NULL;
    219239
    220   return _Objects_Information_table[ the_class ];
     240  the_api = _Objects_Get_API( id );
     241  return _Objects_Information_table[ the_api ][ the_class ];
    221242}
    222243
     
    246267    the_object->name = name;
    247268  else
    248     _Objects_Copy_name_raw( name, the_object->name, information->name_length );
     269    /* _Objects_Copy_name_raw( name, the_object->name, information->name_length ); */
     270    the_object->name = name;
    249271}
    250272
  • cpukit/score/inline/rtems/score/thread.inl

    r3a05d15 ref9505a9  
    310310)
    311311{
    312   Objects_Classes      the_class;
     312  unsigned32           the_api;
     313  unsigned32           the_class;
    313314  Objects_Information *information;
    314315  Thread_Control      *tp = (Thread_Control *) 0;
     
    321322  }
    322323 
    323   the_class = _Objects_Get_class( id );
    324  
    325   if ( the_class > OBJECTS_CLASSES_LAST ) {
     324  the_api = _Objects_Get_API( id );
     325  if ( the_api && the_api > OBJECTS_APIS_LAST ) {
    326326    *location = OBJECTS_ERROR;
    327327    goto done;
    328328  }
    329  
    330   information = _Objects_Information_table[ the_class ];
    331  
    332   if ( !information || !information->is_thread ) {
     329 
     330  the_class = _Objects_Get_class( id );
     331  if ( the_class != 1 ) {       /* threads are always first class :) */
    333332    *location = OBJECTS_ERROR;
    334333    goto done;
    335334  }
    336335 
     336  information = _Objects_Information_table[ the_api ][ the_class ];
     337 
     338  if ( !information ) {
     339    *location = OBJECTS_ERROR;
     340    goto done;
     341  }
     342 
    337343  tp = (Thread_Control *) _Objects_Get( information, id, location );
    338344 
Note: See TracChangeset for help on using the changeset viewer.