Changeset ef9505a in rtems


Ignore:
Timestamp:
Jul 1, 2002, 10:30:12 PM (17 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.
Files:
4 added
48 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/ChangeLog

    r3a05d15 ref9505a  
     12002-07-01    Joel Sherrill <joel@OARcorp.com>
     2
     3        * Mega patch merge to change the format of the object IDs to
     4        loosen the dependency between the SCORE and the various APIs.
     5        There was considerable work to simplify the object name management
     6        and it appears that the name_table field is no longer needed.
     7        This patch also includes the addition of the internal mutex
     8        which is currently only used to protect some types of allocation
     9        and deallocation.  This significantly can reduce context
     10        switch latency under certain circumstances.  In particular,
     11        some heap/region operations were O(n) and had dispatching
     12        disabled.  This should help enormously.  With this merge,
     13        the patch is not as clean as it should be.  In particular,
     14        the documentation has not been modified to reflect the new object
     15        ID layout, the IDs in the test screens are not updated, and
     16        _Objects_Get_information needs to be a real routine not inlined.
     17        As part of this patch a lot of MP code for thread/proxy blocking
     18        was made conditional and cleaned up.
     19        * include/Makefile.am, include/rtems/score/coremsg.h,
     20        include/rtems/score/coremutex.h, include/rtems/score/coresem.h,
     21        include/rtems/score/object.h, include/rtems/score/threadq.h,
     22        inline/rtems/score/object.inl, inline/rtems/score/thread.inl,
     23        macros/rtems/score/object.inl, src/Makefile.am, src/coremsg.c,
     24        src/coremutex.c, src/coresem.c, src/mpci.c,
     25        src/objectcomparenameraw.c, src/objectextendinformation.c,
     26        src/objectinitializeinformation.c, src/objectnametoid.c,
     27        src/thread.c, src/threadclose.c, src/threadget.c, src/threadq.c,
     28        src/threadqextractwithproxy.c: Modified as part of above.
     29        * include/rtems/score/apimutex.h, src/objectgetnoprotection.c: New
     30        files.
     31
    1322001-05-17      Joel Sherrill <joel@OARcorp.com>
    233
  • c/src/exec/score/include/Makefile.am

    r3a05d15 ref9505a  
    2828# H_FILES that get installed in the rtems/score subdirectoy
    2929STD_H_FILES = rtems/score/address.h rtems/score/apiext.h \
     30    rtems/score/apimutex.h \
    3031    rtems/score/bitfield.h rtems/score/chain.h rtems/score/context.h \
    3132    rtems/score/copyrt.h rtems/score/coremsg.h rtems/score/coremutex.h \
  • c/src/exec/score/include/rtems/score/coremsg.h

    r3a05d15 ref9505a  
    145145boolean _CORE_message_queue_Initialize(
    146146  CORE_message_queue_Control    *the_message_queue,
    147   Objects_Classes                the_class,
    148147  CORE_message_queue_Attributes *the_message_queue_attributes,
    149148  unsigned32                     maximum_pending_messages,
    150   unsigned32                     maximum_message_size,
    151   Thread_queue_Extract_callout   proxy_extract_callout
     149  unsigned32                     maximum_message_size
    152150);
    153151 
  • c/src/exec/score/include/rtems/score/coremutex.h

    r3a05d15 ref9505a  
    135135void _CORE_mutex_Initialize(
    136136  CORE_mutex_Control           *the_mutex,
    137   Objects_Classes               the_class,
    138137  CORE_mutex_Attributes        *the_mutex_attributes,
    139   unsigned32                    initial_lock,
    140   Thread_queue_Extract_callout  proxy_extract_callout
     138  unsigned32                    initial_lock
    141139);
    142140 
  • c/src/exec/score/include/rtems/score/coresem.h

    r3a05d15 ref9505a  
    9090void _CORE_semaphore_Initialize(
    9191  CORE_semaphore_Control       *the_semaphore,
    92   Objects_Classes               the_class,
    9392  CORE_semaphore_Attributes    *the_semaphore_attributes,
    94   unsigned32                    initial_value,
    95   Thread_queue_Extract_callout  proxy_extract_callout
     93  unsigned32                    initial_value
    9694);
    9795 
  • c/src/exec/score/include/rtems/score/object.h

    r3a05d15 ref9505a  
    2727
    2828/*
    29  *  Mask to enable unlimited objects
     29 *  Mask to enable unlimited objects.  This is used in the configuration
     30 *  table when specifying the number of configured objects.
    3031 */
    3132
     
    6162 *  object IDs.  The format is as follows (0=LSB):
    6263 *
    63  *     Bits  0 .. 15    = index
    64  *     Bits 16 .. 25    = node
    65  *     Bits 26 .. 31    = class
     64 *     Bits  0 .. 15    = index  (up to 65535 objects of a type)
     65 *     Bits 16 .. 23    = node   (up to 255 nodes)
     66 *     Bits 24 .. 26    = API    (up to 7 API classes)
     67 *     Bits 27 .. 31    = class  (up to 31 object types per API)
    6668 */
    6769
     
    7072#define OBJECTS_INDEX_START_BIT  0
    7173#define OBJECTS_NODE_START_BIT  16
    72 #define OBJECTS_CLASS_START_BIT 26
     74#define OBJECTS_API_START_BIT   24
     75#define OBJECTS_CLASS_START_BIT 27
    7376
    7477#define OBJECTS_INDEX_MASK      0x0000ffff
    75 #define OBJECTS_NODE_MASK       0x03ff0000
    76 #define OBJECTS_CLASS_MASK      0xfc000000
     78#define OBJECTS_NODE_MASK       0x00ff0000
     79#define OBJECTS_API_MASK        0x07000000
     80#define OBJECTS_CLASS_MASK      0xf8000000
    7781
    7882#define OBJECTS_INDEX_VALID_BITS  0x0000ffff
    79 #define OBJECTS_NODE_VALID_BITS   0x000003ff
    80 #define OBJECTS_CLASS_VALID_BITS  0x000000cf
     83#define OBJECTS_NODE_VALID_BITS   0x000000ff
     84#define OBJECTS_API_VALID_BITS    0x00000007
     85#define OBJECTS_CLASS_VALID_BITS  0x0000001f
    8186
    8287/*
     
    8489 */
    8590
    86 typedef enum {
    87   OBJECTS_NO_CLASS                    =  0,
    88   OBJECTS_INTERNAL_THREADS            =  1,
    89   OBJECTS_RTEMS_TASKS                 =  2,
    90   OBJECTS_POSIX_THREADS               =  3,
    91   OBJECTS_ITRON_TASKS                 =  4,
    92   OBJECTS_RTEMS_TIMERS                =  5,
    93   OBJECTS_RTEMS_SEMAPHORES            =  6,
    94   OBJECTS_RTEMS_MESSAGE_QUEUES        =  7,
    95   OBJECTS_RTEMS_PARTITIONS            =  8,
    96   OBJECTS_RTEMS_REGIONS               =  9,
    97   OBJECTS_RTEMS_PORTS                 = 10,
    98   OBJECTS_RTEMS_PERIODS               = 11,
    99   OBJECTS_RTEMS_EXTENSIONS            = 12,
    100   OBJECTS_POSIX_KEYS                  = 13,
    101   OBJECTS_POSIX_INTERRUPTS            = 14,
    102   OBJECTS_POSIX_MESSAGE_QUEUE_FDS     = 15,
    103   OBJECTS_POSIX_MESSAGE_QUEUES        = 16,
    104   OBJECTS_POSIX_MUTEXES               = 17,
    105   OBJECTS_POSIX_SEMAPHORES            = 18,
    106   OBJECTS_POSIX_CONDITION_VARIABLES   = 19,
    107   OBJECTS_ITRON_EVENTFLAGS            = 10,
    108   OBJECTS_ITRON_MAILBOXES             = 21,
    109   OBJECTS_ITRON_MESSAGE_BUFFERS       = 22,
    110   OBJECTS_ITRON_PORTS                 = 23,
    111   OBJECTS_ITRON_SEMAPHORES            = 24,
    112   OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 25,
    113   OBJECTS_ITRON_FIXED_MEMORY_POOLS    = 26
    114 } Objects_Classes;
    115  
    116 #define OBJECTS_CLASSES_FIRST               OBJECTS_NO_CLASS
    117 #define OBJECTS_CLASSES_LAST                OBJECTS_ITRON_FIXED_MEMORY_POOLS
    118 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_INTERNAL_THREADS
    119 #define OBJECTS_CLASSES_LAST_THREAD_CLASS   OBJECTS_ITRON_TASKS
     91#define OBJECTS_NO_CLASS 0
     92
     93typedef enum {
     94  OBJECTS_NO_API       = 0,
     95  OBJECTS_INTERNAL_API = 1,
     96  OBJECTS_CLASSIC_API  = 2,
     97  OBJECTS_POSIX_API    = 3,
     98  OBJECTS_ITRON_API    = 4
     99} Objects_APIs;
     100
     101#define OBJECTS_APIS_LAST OBJECTS_ITRON_API
     102
     103typedef enum {
     104  OBJECTS_INTERNAL_NO_CLASS =  0,
     105  OBJECTS_INTERNAL_THREADS  =  1,
     106  OBJECTS_INTERNAL_MUTEXES  =  2
     107} Objects_Internal_API;
     108
     109#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_MUTEXES
     110
     111typedef enum {
     112  OBJECTS_CLASSIC_NO_CLASS     = 0,
     113  OBJECTS_RTEMS_TASKS          = 1,
     114  OBJECTS_RTEMS_TIMERS         = 2,
     115  OBJECTS_RTEMS_SEMAPHORES     = 3,
     116  OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
     117  OBJECTS_RTEMS_PARTITIONS     = 5,
     118  OBJECTS_RTEMS_REGIONS        = 6,
     119  OBJECTS_RTEMS_PORTS          = 7,
     120  OBJECTS_RTEMS_PERIODS        = 8,
     121  OBJECTS_RTEMS_EXTENSIONS     = 9
     122} Objects_Classic_API;
     123
     124#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_EXTENSIONS
     125
     126typedef enum {
     127  OBJECTS_POSIX_NO_CLASS            = 0,
     128  OBJECTS_POSIX_THREADS             = 1,
     129  OBJECTS_POSIX_KEYS                = 2,
     130  OBJECTS_POSIX_INTERRUPTS          = 3,
     131  OBJECTS_POSIX_MESSAGE_QUEUE_FDS   = 4,
     132  OBJECTS_POSIX_MESSAGE_QUEUES      = 5,
     133  OBJECTS_POSIX_MUTEXES             = 6,
     134  OBJECTS_POSIX_SEMAPHORES          = 7,
     135  OBJECTS_POSIX_CONDITION_VARIABLES = 8
     136} Objects_POSIX_API;
     137
     138#define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES
     139
     140typedef enum {
     141  OBJECTS_ITRON_NO_CLASS              = 0,
     142  OBJECTS_ITRON_TASKS                 = 1,
     143  OBJECTS_ITRON_EVENTFLAGS            = 2,
     144  OBJECTS_ITRON_MAILBOXES             = 3,
     145  OBJECTS_ITRON_MESSAGE_BUFFERS       = 4,
     146  OBJECTS_ITRON_PORTS                 = 5,
     147  OBJECTS_ITRON_SEMAPHORES            = 6,
     148  OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 7,
     149  OBJECTS_ITRON_FIXED_MEMORY_POOLS    = 8
     150} Objects_ITRON_API;
     151
     152#define OBJECTS_ITRON_CLASSES_LAST OBJECTS_ITRON_FIXED_MEMORY_POOLS
    120153
    121154/*
     
    130163  OBJECTS_ERROR  = 2          /* id was invalid */
    131164}  Objects_Locations;
     165
     166/*
     167 *  The following type defines the callout used when a local task
     168 *  is extracted from a remote thread queue (i.e. it's proxy must
     169 *  extracted from the remote queue).
     170 */
     171
     172typedef void ( *Objects_Thread_queue_Extract_callout )( void * );
     173
    132174
    133175/*
     
    148190
    149191typedef struct {
    150   Objects_Classes   the_class;          /* Class of this object */
     192  Objects_APIs      the_api;            /* API of this object */
     193  unsigned32        the_class;          /* class of this object */
    151194  Objects_Id        minimum_id;         /* minimum valid id of this type */
    152195  Objects_Id        maximum_id;         /* maximum valid id of this type */
     
    157200  Objects_Control **local_table;
    158201  Objects_Name     *name_table;
    159   Chain_Control    *global_table;       /* pointer to global table */
    160202  Chain_Control     Inactive;           /* chain of inactive ctl blocks */
    161203  unsigned32        inactive;           /* number of objects on the InActive list */
     
    164206  boolean           is_string;          /* TRUE if names are strings */
    165207  unsigned32        name_length;        /* maximum length of names */
    166   boolean           is_thread;          /* TRUE if these are threads */
    167                                         /*   irregardless of API */
     208  Objects_Thread_queue_Extract_callout *extract;
     209#if defined(RTEMS_MULTIPROCESSING)
     210  Chain_Control    *global_table;       /* pointer to global table */
     211#endif
    168212}   Objects_Information;
    169213
     
    177221
    178222/*
    179  *  The following is the list of information blocks for each object
     223 *  The following is the list of information blocks per API for each object
    180224 *  class.  From the ID, we can go to one of these information blocks,
    181225 *  and obtain a pointer to the appropriate object control block.
    182226 */
    183227
    184 SCORE_EXTERN Objects_Information 
    185     *_Objects_Information_table[OBJECTS_CLASSES_LAST + 1];
     228SCORE_EXTERN Objects_Information
     229    **_Objects_Information_table[OBJECTS_APIS_LAST + 1];
    186230
    187231/*
     
    209253#define OBJECTS_ID_FINAL_INDEX     (0xffff)
    210254
    211 #define OBJECTS_ID_INITIAL(_class, _node) \
    212   _Objects_Build_id( (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
     255#define OBJECTS_ID_INITIAL(_api, _class, _node) \
     256  _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
    213257
    214258#define OBJECTS_ID_FINAL           ((Objects_Id)~0)
     
    269313void _Objects_Initialize_information (
    270314  Objects_Information *information,
    271   Objects_Classes      the_class,
    272   boolean              supports_global,
     315  Objects_APIs         the_api,
     316  unsigned32           the_class,
    273317  unsigned32           maximum,
    274318  unsigned32           size,
    275319  boolean              is_string,
    276   unsigned32           maximum_name_length,
    277   boolean              is_task
     320  unsigned32           maximum_name_length
     321#if defined(RTEMS_MULTIPROCESSING)
     322  ,
     323  boolean              supports_global,
     324  Objects_Thread_queue_Extract_callout *extract
     325#endif
    278326);
    279327
     
    461509  Objects_Locations   *location
    462510);
     511
     512Objects_Control *_Objects_Get_no_protection(
     513  Objects_Information *information,
     514  Objects_Id           id,
     515  Objects_Locations   *location
     516);
     517
    463518/*
    464519 *  _Objects_Get_next
  • c/src/exec/score/include/rtems/score/threadq.h

    r3a05d15 ref9505a  
    4848 */
    4949 
     50#if 0
    5051typedef void ( *Thread_queue_Extract_callout )(
    5152                 Thread_Control *
     
    5455SCORE_EXTERN Thread_queue_Extract_callout 
    5556  _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
     57#endif
    5658
    5759/*
     
    104106 *
    105107 *  This routine extracts the_thread from the_thread_queue
    106  *  and insures that if there is a proxy for this task on
     108 *  and ensures that if there is a proxy for this task on
    107109 *  another node, it is also dealt with.
    108110 */
     
    153155void _Thread_queue_Initialize(
    154156  Thread_queue_Control         *the_thread_queue,
    155   Objects_Classes               the_class,
    156157  Thread_queue_Disciplines      the_discipline,
    157158  States_Control                state,
    158   Thread_queue_Extract_callout  proxy_extract_callout,
    159159  unsigned32                    timeout_status
    160160);
  • c/src/exec/score/inline/rtems/score/object.inl

    r3a05d15 ref9505a  
    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
  • c/src/exec/score/inline/rtems/score/thread.inl

    r3a05d15 ref9505a  
    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 
  • c/src/exec/score/macros/rtems/score/object.inl

    r3a05d15 ref9505a  
    2323 */
    2424
    25 #define _Objects_Build_id( _the_class, _node, _index ) \
    26   ( (( (Objects_Id) (_the_class) ) << OBJECTS_CLASS_START_BIT) | \
    27     (( (Objects_Id) (_node) ) << OBJECTS_NODE_START_BIT)       | \
    28     (( (Objects_Id) (_index) ) << OBJECTS_INDEX_START_BIT) )
     25#define _Objects_Build_id( _the_api, _the_class, _node, _index ) \
     26  ( (( (Objects_Id) _the_api ) << OBJECTS_API_START_BIT) | \
     27    (( (Objects_Id) _the_class ) << OBJECTS_CLASS_START_BIT) | \
     28    (( (Objects_Id) _node ) << OBJECTS_NODE_START_BIT)       | \
     29    (( (Objects_Id) _index ) << OBJECTS_INDEX_START_BIT) )
     30
     31/*PAGE
     32 *
     33 *  _Objects_Get_API
     34 */
     35 
     36#define _Objects_Get_API( _id ) \
     37  (Objects_APIs) \
     38    (((_id) >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS)
    2939
    3040/*PAGE
     
    3444 
    3545#define _Objects_Get_class( _id ) \
    36   (Objects_Classes) \
     46  (unsigned32) \
    3747    (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
    3848
     
    6272 
    6373#define _Objects_Is_class_valid( _the_class ) \
    64   ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
     74  ( (_the_class) /* XXX && (_the_class) <= OBJECTS_CLASSES_LAST */ )
    6575
    6676/*PAGE
     
    124134   ( !_Objects_Is_class_valid( _Objects_Get_class( id ) ) ) ? \
    125135     NULL : \
    126      _Objects_Information_table[ _Objects_Get_class( id ) ] \
     136     _Objects_Information_table[ _Objects_Get_API( id ) ] \
     137       [ _Objects_Get_class( id ) ] \
    127138 )
    128139
  • c/src/exec/score/src/Makefile.am

    r3a05d15 ref9505a  
    2929    objectfree.c objectget.c objectgetisr.c objectgetbyindex.c \
    3030    objectgetnext.c objectinitializeinformation.c objectnametoid.c \
    31     objectshrinkinformation.c
     31    objectshrinkinformation.c objectgetnoprotection.c
    3232
    3333THREAD_C_FILES = thread.c threadchangepriority.c threadclearstate.c \
     
    4545    threadqenqueuepriority.c threadqextract.c threadqextractfifo.c \
    4646    threadqextractpriority.c threadqextractwithproxy.c threadqfirst.c \
    47     threadqfirstfifo.c threadqfirstpriority.c threadqflush.c \
    48     threadqtimeout.c
     47    threadqfirstfifo.c threadqfirstpriority.c threadqflush.c threadqtimeout.c
    4948
    5049TOD_C_FILES = coretod.c coretodset.c coretodtickle.c coretodtoseconds.c \
  • c/src/exec/score/src/coremsg.c

    r3a05d15 ref9505a  
    4343 *    maximum_pending_messages     - maximum message and reserved buffer count
    4444 *    maximum_message_size         - maximum size of each message
    45  *    proxy_extract_callout        - remote extract support
    4645 *
    4746 *  Output parameters:
     
    5251boolean _CORE_message_queue_Initialize(
    5352  CORE_message_queue_Control    *the_message_queue,
    54   Objects_Classes                the_class,
    5553  CORE_message_queue_Attributes *the_message_queue_attributes,
    5654  unsigned32                     maximum_pending_messages,
    57   unsigned32                     maximum_message_size,
    58   Thread_queue_Extract_callout   proxy_extract_callout
     55  unsigned32                     maximum_message_size
    5956)
    6057{
     
    9794  _Thread_queue_Initialize(
    9895    &the_message_queue->Wait_queue,
    99     the_class,
    10096    _CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
    10197       THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
    10298    STATES_WAITING_FOR_MESSAGE,
    103     proxy_extract_callout,
    10499    CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
    105100  );
  • c/src/exec/score/src/coremutex.c

    r3a05d15 ref9505a  
    3333 *  Input parameters:
    3434 *    the_mutex             - the mutex control block to initialize
    35  *    the_class             - the API class of the object
    3635 *    the_mutex_attributes  - the mutex attributes specified at create time
    3736 *    initial_lock          - mutex initial lock or unlocked status
    38  *    proxy_extract_callout - MP specific extract callout
    3937 *
    4038 *  Output parameters:  NONE
     
    4341void _CORE_mutex_Initialize(
    4442  CORE_mutex_Control           *the_mutex,
    45   Objects_Classes               the_class,
    4643  CORE_mutex_Attributes        *the_mutex_attributes,
    47   unsigned32                    initial_lock,
    48   Thread_queue_Extract_callout  proxy_extract_callout
     44  unsigned32                    initial_lock
    4945)
    5046{
     
    8581  _Thread_queue_Initialize(
    8682    &the_mutex->Wait_queue,
    87     the_class,
    8883    _CORE_mutex_Is_fifo( the_mutex_attributes ) ?
    8984      THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
    9085    STATES_WAITING_FOR_MUTEX,
    91     proxy_extract_callout,
    9286    CORE_MUTEX_TIMEOUT
    9387  );
  • c/src/exec/score/src/coresem.c

    r3a05d15 ref9505a  
    3737 *  Input parameters:
    3838 *    the_semaphore            - the semaphore control block to initialize
    39  *    the_class                - the API class of the object
    4039 *    the_semaphore_attributes - the attributes specified at create time
    4140 *    initial_value            - semaphore's initial value
    42  *    proxy_extract_callout    - MP specific extract callout
    4341 *
    4442 *  Output parameters:  NONE
     
    4745void _CORE_semaphore_Initialize(
    4846  CORE_semaphore_Control       *the_semaphore,
    49   Objects_Classes               the_class,
    5047  CORE_semaphore_Attributes    *the_semaphore_attributes,
    51   unsigned32                    initial_value,
    52   Thread_queue_Extract_callout  proxy_extract_callout
     48  unsigned32                    initial_value
    5349)
    5450{
     
    5955  _Thread_queue_Initialize(
    6056    &the_semaphore->Wait_queue,
    61     the_class,
    6257    _CORE_semaphore_Is_priority( the_semaphore_attributes ) ?
    6358              THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
    6459    STATES_WAITING_FOR_SEMAPHORE,
    65     proxy_extract_callout,
    6660    CORE_SEMAPHORE_TIMEOUT
    6761  );
  • c/src/exec/score/src/mpci.c

    r3a05d15 ref9505a  
    7272  _CORE_semaphore_Initialize(
    7373    &_MPCI_Semaphore,
    74     OBJECTS_NO_CLASS,         /* free floating semaphore */
    7574    &attributes,              /* the_semaphore_attributes */
    76     0,                        /* initial_value */
    77     NULL                      /* proxy_extract_callout */
     75    0                         /* initial_value */
    7876  );
    7977
    8078  _Thread_queue_Initialize(
    8179    &_MPCI_Remote_blocked_threads,
    82     OBJECTS_NO_CLASS,
    8380    THREAD_QUEUE_DISCIPLINE_FIFO,
    8481    STATES_WAITING_FOR_RPC_REPLY,
    85     NULL,
    8682    timeout_status
    8783  );
  • c/src/exec/score/src/objectcomparenameraw.c

    r3a05d15 ref9505a  
    3838)
    3939{
     40#if 0
    4041  unsigned32 *name_1_p = (unsigned32 *) name_1;
    4142  unsigned32 *name_2_p = (unsigned32 *) name_2;
    4243  unsigned32  tmp_length = length / OBJECTS_NAME_ALIGNMENT;
     44#endif
    4345 
     46  if ( name_1 == name_2 )
     47    return TRUE;
     48  return FALSE;
     49
     50#if 0
    4451  while ( tmp_length-- )
    4552    if ( *name_1_p++ != *name_2_p++ )
     
    4754
    4855  return TRUE;
     56#endif
    4957}
  • c/src/exec/score/src/objectextendinformation.c

    r3a05d15 ref9505a  
    209209    information->local_table = local_table;
    210210    information->maximum = maximum;
    211     information->maximum_id =
    212       _Objects_Build_id(
    213         information->the_class, _Objects_Local_node, information->maximum
     211    information->maximum_id = _Objects_Build_id(
     212        information->the_api,
     213        information->the_class,
     214        _Objects_Local_node,
     215        information->maximum
    214216      );
    215217
     
    269271  while ( (the_object = (Objects_Control *) _Chain_Get( &Inactive ) ) != NULL ) {
    270272   
    271     the_object->id =
    272       _Objects_Build_id(
    273         information->the_class, _Objects_Local_node, index
     273    the_object->id = _Objects_Build_id(
     274        information->the_api,
     275        information->the_class,
     276        _Objects_Local_node,
     277        index
    274278      );
    275279     
  • c/src/exec/score/src/objectinitializeinformation.c

    r3a05d15 ref9505a  
    3333 *  Input parameters:
    3434 *    information         - object information table
    35  *    the_class           - object class
    36  *    supports_global     - TRUE if this is a global object class
    3735 *    maximum             - maximum objects of this class
    3836 *    size                - size of this object's control block
    3937 *    is_string           - TRUE if names for this object are strings
    4038 *    maximum_name_length - maximum length of each object's name
    41  *    is_thread           - TRUE if this class is threads
     39 *    When multiprocessing is configured,
     40 *      supports_global     - TRUE if this is a global object class
     41 *      extract_callout     - pointer to threadq extract callout if MP
    4242 *
    4343 *  Output parameters:  NONE
     
    4646void _Objects_Initialize_information(
    4747  Objects_Information *information,
    48   Objects_Classes      the_class,
    49   boolean              supports_global,
     48  Objects_APIs         the_api,
     49  unsigned32           the_class,
    5050  unsigned32           maximum,
    5151  unsigned32           size,
    5252  boolean              is_string,
    53   unsigned32           maximum_name_length,
    54   boolean              is_thread
     53  unsigned32           maximum_name_length
     54#if defined(RTEMS_MULTIPROCESSING)
     55  ,
     56  boolean              supports_global,
     57  Objects_Thread_queue_Extract_callout *extract
     58#endif
    5559)
    5660{
    5761  static Objects_Control *null_local_table = NULL;
    58  
    5962  unsigned32       minimum_index;
     63  unsigned32       name_length;
     64#if defined(RTEMS_MULTIPROCESSING)
    6065  unsigned32       index;
    61   unsigned32       name_length;
     66#endif
    6267
     68  information->the_api            = the_api;
    6369  information->the_class          = the_class;
    6470  information->is_string          = is_string;
    65   information->is_thread          = is_thread;
    6671 
    6772  information->local_table        = 0;
     
    7681   */
    7782
    78   _Objects_Information_table[ the_class ] = information;
     83  _Objects_Information_table[ the_api ][ the_class ] = information;
    7984
    8085  /*
     
    111116
    112117  information->minimum_id =
    113     _Objects_Build_id( the_class, _Objects_Local_node, minimum_index );
     118    _Objects_Build_id( the_api, the_class, _Objects_Local_node, minimum_index );
    114119
    115120  /*
     
    154159   */
    155160
     161#if defined(RTEMS_MULTIPROCESSING)
     162  information->extract = extract;
     163
    156164  if ( supports_global == TRUE && _System_state_Is_multiprocessing ) {
    157165
     
    166174   else
    167175     information->global_table = NULL;
     176#endif
    168177}
  • c/src/exec/score/src/objectnametoid.c

    r3a05d15 ref9505a  
    7474
    7575    for ( index = 1; index <= information->maximum; index++ ) {
    76 
    7776      the_object = information->local_table[ index ];
    78 
    7977      if ( !the_object || !the_object->name )
    8078        continue;
  • c/src/exec/score/src/thread.c

    r3a05d15 ref9505a  
    9191  _Objects_Initialize_information(
    9292    &_Thread_Internal_information,
     93    OBJECTS_INTERNAL_API,
    9394    OBJECTS_INTERNAL_THREADS,
    94     FALSE,
    9595    ( _System_state_Is_multiprocessing ) ?  2 : 1,
    9696    sizeof( Thread_Control ),
    97     TRUE,
    98     8,
    99     TRUE
     97                                /* size of this object's control block */
     98    TRUE,                       /* TRUE if names for this object are strings */
     99    8                           /* maximum length of each object's name */
     100#if defined(RTEMS_MULTIPROCESSING)
     101    ,
     102    FALSE,                      /* TRUE if this is a global object class */
     103    NULL                        /* Proxy extraction support callout */
     104#endif
    100105  );
    101106
  • c/src/exec/score/src/threadclose.c

    r3a05d15 ref9505a  
    4747 
    4848  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
    49  
    5049    if ( _Watchdog_Is_active( &the_thread->Timer ) )
    5150      (void) _Watchdog_Remove( &the_thread->Timer );
  • c/src/exec/score/src/threadget.c

    r3a05d15 ref9505a  
    4444)
    4545{
    46   Objects_Classes      the_class;
     46  unsigned32           the_api;
     47  unsigned32           the_class;
    4748  Objects_Information *information;
     49  Thread_Control      *tp = (Thread_Control *) 0;
    4850 
    4951  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
    5052    _Thread_Disable_dispatch();
    5153    *location = OBJECTS_LOCAL;
    52     return( _Thread_Executing );
     54    tp = _Thread_Executing;
     55    goto done;
    5356  }
    5457 
     58  the_api = _Objects_Get_API( id );
     59  if ( the_api && the_api > OBJECTS_APIS_LAST ) {
     60    *location = OBJECTS_ERROR;
     61    goto done;
     62  }
     63 
    5564  the_class = _Objects_Get_class( id );
    56  
    57   if ( the_class > OBJECTS_CLASSES_LAST ) {
     65  if ( the_class != 1 ) {       /* threads are always first class :) */
    5866    *location = OBJECTS_ERROR;
    59     return (Thread_Control *) 0;
    60   }
    61  
    62   information = _Objects_Information_table[ the_class ];
    63  
    64   if ( !information || !information->is_thread ) {
    65     *location = OBJECTS_ERROR;
    66     return (Thread_Control *) 0;
     67    goto done;
    6768  }
    6869 
    69   return (Thread_Control *) _Objects_Get( information, id, location );
     70  information = _Objects_Information_table[ the_api ][ the_class ];
     71 
     72  if ( !information ) {
     73    *location = OBJECTS_ERROR;
     74    goto done;
     75  }
     76 
     77  tp = (Thread_Control *) _Objects_Get( information, id, location );
     78 
     79done:
     80  return tp;
    7081}
    7182
  • c/src/exec/score/src/threadq.c

    r3a05d15 ref9505a  
    3030 *  Input parameters:
    3131 *    the_thread_queue      - pointer to a threadq header
    32  *    the_class             - class of the object to which this belongs
    3332 *    discipline            - queueing discipline
    3433 *    state                 - state of waiting threads
    35  *    proxy_extract_callout - MP specific callout
    3634 *    timeout_status        - return on a timeout
    3735 *
     
    4139void _Thread_queue_Initialize(
    4240  Thread_queue_Control         *the_thread_queue,
    43   Objects_Classes               the_class,
    4441  Thread_queue_Disciplines      the_discipline,
    4542  States_Control                state,
    46   Thread_queue_Extract_callout  proxy_extract_callout,
    4743  unsigned32                    timeout_status
    4844)
    4945{
    5046  unsigned32 index;
    51 
    52   _Thread_queue_Extract_table[ the_class ] = proxy_extract_callout;
    5347
    5448  the_thread_queue->state          = state;
  • c/src/exec/score/src/threadqextractwithproxy.c

    r3a05d15 ref9505a  
    2727 *
    2828 *  This routine extracts the_thread from the_thread_queue
    29  *  and insures that if there is a proxy for this task on
     29 *  and ensures that if there is a proxy for this task on
    3030 *  another node, it is also dealt with.
    3131 *
     
    3838{
    3939  States_Control                state;
    40   Objects_Classes               the_class;
    41   Thread_queue_Extract_callout  proxy_extract_callout;
     40  Objects_Information          *the_information;
     41  Objects_Thread_queue_Extract_callout  proxy_extract_callout;
    4242
    4343  state = the_thread->current_state;
     
    4747         _States_Is_locally_blocked( state ) ) {
    4848
    49       the_class = _Objects_Get_class( the_thread->Wait.id );
     49      the_information = _Objects_Get_information( the_thread->Wait.id );
    5050
    51       proxy_extract_callout = _Thread_queue_Extract_table[ the_class ];
     51      proxy_extract_callout =
     52        (Objects_Thread_queue_Extract_callout) the_information->extract;
    5253
    5354      if ( proxy_extract_callout )
  • cpukit/score/ChangeLog

    r3a05d15 ref9505a  
     12002-07-01    Joel Sherrill <joel@OARcorp.com>
     2
     3        * Mega patch merge to change the format of the object IDs to
     4        loosen the dependency between the SCORE and the various APIs.
     5        There was considerable work to simplify the object name management
     6        and it appears that the name_table field is no longer needed.
     7        This patch also includes the addition of the internal mutex
     8        which is currently only used to protect some types of allocation
     9        and deallocation.  This significantly can reduce context
     10        switch latency under certain circumstances.  In particular,
     11        some heap/region operations were O(n) and had dispatching
     12        disabled.  This should help enormously.  With this merge,
     13        the patch is not as clean as it should be.  In particular,
     14        the documentation has not been modified to reflect the new object
     15        ID layout, the IDs in the test screens are not updated, and
     16        _Objects_Get_information needs to be a real routine not inlined.
     17        As part of this patch a lot of MP code for thread/proxy blocking
     18        was made conditional and cleaned up.
     19        * include/Makefile.am, include/rtems/score/coremsg.h,
     20        include/rtems/score/coremutex.h, include/rtems/score/coresem.h,
     21        include/rtems/score/object.h, include/rtems/score/threadq.h,
     22        inline/rtems/score/object.inl, inline/rtems/score/thread.inl,
     23        macros/rtems/score/object.inl, src/Makefile.am, src/coremsg.c,
     24        src/coremutex.c, src/coresem.c, src/mpci.c,
     25        src/objectcomparenameraw.c, src/objectextendinformation.c,
     26        src/objectinitializeinformation.c, src/objectnametoid.c,
     27        src/thread.c, src/threadclose.c, src/threadget.c, src/threadq.c,
     28        src/threadqextractwithproxy.c: Modified as part of above.
     29        * include/rtems/score/apimutex.h, src/objectgetnoprotection.c: New
     30        files.
     31
    1322001-05-17      Joel Sherrill <joel@OARcorp.com>
    233
  • cpukit/score/include/Makefile.am

    r3a05d15 ref9505a  
    2828# H_FILES that get installed in the rtems/score subdirectoy
    2929STD_H_FILES = rtems/score/address.h rtems/score/apiext.h \
     30    rtems/score/apimutex.h \
    3031    rtems/score/bitfield.h rtems/score/chain.h rtems/score/context.h \
    3132    rtems/score/copyrt.h rtems/score/coremsg.h rtems/score/coremutex.h \
  • cpukit/score/include/rtems/score/coremsg.h

    r3a05d15 ref9505a  
    145145boolean _CORE_message_queue_Initialize(
    146146  CORE_message_queue_Control    *the_message_queue,
    147   Objects_Classes                the_class,
    148147  CORE_message_queue_Attributes *the_message_queue_attributes,
    149148  unsigned32                     maximum_pending_messages,
    150   unsigned32                     maximum_message_size,
    151   Thread_queue_Extract_callout   proxy_extract_callout
     149  unsigned32                     maximum_message_size
    152150);
    153151 
  • cpukit/score/include/rtems/score/coremutex.h

    r3a05d15 ref9505a  
    135135void _CORE_mutex_Initialize(
    136136  CORE_mutex_Control           *the_mutex,
    137   Objects_Classes               the_class,
    138137  CORE_mutex_Attributes        *the_mutex_attributes,
    139   unsigned32                    initial_lock,
    140   Thread_queue_Extract_callout  proxy_extract_callout
     138  unsigned32                    initial_lock
    141139);
    142140 
  • cpukit/score/include/rtems/score/coresem.h

    r3a05d15 ref9505a  
    9090void _CORE_semaphore_Initialize(
    9191  CORE_semaphore_Control       *the_semaphore,
    92   Objects_Classes               the_class,
    9392  CORE_semaphore_Attributes    *the_semaphore_attributes,
    94   unsigned32                    initial_value,
    95   Thread_queue_Extract_callout  proxy_extract_callout
     93  unsigned32                    initial_value
    9694);
    9795 
  • cpukit/score/include/rtems/score/object.h

    r3a05d15 ref9505a  
    2727
    2828/*
    29  *  Mask to enable unlimited objects
     29 *  Mask to enable unlimited objects.  This is used in the configuration
     30 *  table when specifying the number of configured objects.
    3031 */
    3132
     
    6162 *  object IDs.  The format is as follows (0=LSB):
    6263 *
    63  *     Bits  0 .. 15    = index
    64  *     Bits 16 .. 25    = node
    65  *     Bits 26 .. 31    = class
     64 *     Bits  0 .. 15    = index  (up to 65535 objects of a type)
     65 *     Bits 16 .. 23    = node   (up to 255 nodes)
     66 *     Bits 24 .. 26    = API    (up to 7 API classes)
     67 *     Bits 27 .. 31    = class  (up to 31 object types per API)
    6668 */
    6769
     
    7072#define OBJECTS_INDEX_START_BIT  0
    7173#define OBJECTS_NODE_START_BIT  16
    72 #define OBJECTS_CLASS_START_BIT 26
     74#define OBJECTS_API_START_BIT   24
     75#define OBJECTS_CLASS_START_BIT 27
    7376
    7477#define OBJECTS_INDEX_MASK      0x0000ffff
    75 #define OBJECTS_NODE_MASK       0x03ff0000
    76 #define OBJECTS_CLASS_MASK      0xfc000000
     78#define OBJECTS_NODE_MASK       0x00ff0000
     79#define OBJECTS_API_MASK        0x07000000
     80#define OBJECTS_CLASS_MASK      0xf8000000
    7781
    7882#define OBJECTS_INDEX_VALID_BITS  0x0000ffff
    79 #define OBJECTS_NODE_VALID_BITS   0x000003ff
    80 #define OBJECTS_CLASS_VALID_BITS  0x000000cf
     83#define OBJECTS_NODE_VALID_BITS   0x000000ff
     84#define OBJECTS_API_VALID_BITS    0x00000007
     85#define OBJECTS_CLASS_VALID_BITS  0x0000001f
    8186
    8287/*
     
    8489 */
    8590
    86 typedef enum {
    87   OBJECTS_NO_CLASS                    =  0,
    88   OBJECTS_INTERNAL_THREADS            =  1,
    89   OBJECTS_RTEMS_TASKS                 =  2,
    90   OBJECTS_POSIX_THREADS               =  3,
    91   OBJECTS_ITRON_TASKS                 =  4,
    92   OBJECTS_RTEMS_TIMERS                =  5,
    93   OBJECTS_RTEMS_SEMAPHORES            =  6,
    94   OBJECTS_RTEMS_MESSAGE_QUEUES        =  7,
    95   OBJECTS_RTEMS_PARTITIONS            =  8,
    96   OBJECTS_RTEMS_REGIONS               =  9,
    97   OBJECTS_RTEMS_PORTS                 = 10,
    98   OBJECTS_RTEMS_PERIODS               = 11,
    99   OBJECTS_RTEMS_EXTENSIONS            = 12,
    100   OBJECTS_POSIX_KEYS                  = 13,
    101   OBJECTS_POSIX_INTERRUPTS            = 14,
    102   OBJECTS_POSIX_MESSAGE_QUEUE_FDS     = 15,
    103   OBJECTS_POSIX_MESSAGE_QUEUES        = 16,
    104   OBJECTS_POSIX_MUTEXES               = 17,
    105   OBJECTS_POSIX_SEMAPHORES            = 18,
    106   OBJECTS_POSIX_CONDITION_VARIABLES   = 19,
    107   OBJECTS_ITRON_EVENTFLAGS            = 10,
    108   OBJECTS_ITRON_MAILBOXES             = 21,
    109   OBJECTS_ITRON_MESSAGE_BUFFERS       = 22,
    110   OBJECTS_ITRON_PORTS                 = 23,
    111   OBJECTS_ITRON_SEMAPHORES            = 24,
    112   OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 25,
    113   OBJECTS_ITRON_FIXED_MEMORY_POOLS    = 26
    114 } Objects_Classes;
    115  
    116 #define OBJECTS_CLASSES_FIRST               OBJECTS_NO_CLASS
    117 #define OBJECTS_CLASSES_LAST                OBJECTS_ITRON_FIXED_MEMORY_POOLS
    118 #define OBJECTS_CLASSES_FIRST_THREAD_CLASS  OBJECTS_INTERNAL_THREADS
    119 #define OBJECTS_CLASSES_LAST_THREAD_CLASS   OBJECTS_ITRON_TASKS
     91#define OBJECTS_NO_CLASS 0
     92
     93typedef enum {
     94  OBJECTS_NO_API       = 0,
     95  OBJECTS_INTERNAL_API = 1,
     96  OBJECTS_CLASSIC_API  = 2,
     97  OBJECTS_POSIX_API    = 3,
     98  OBJECTS_ITRON_API    = 4
     99} Objects_APIs;
     100
     101#define OBJECTS_APIS_LAST OBJECTS_ITRON_API
     102
     103typedef enum {
     104  OBJECTS_INTERNAL_NO_CLASS =  0,
     105  OBJECTS_INTERNAL_THREADS  =  1,
     106  OBJECTS_INTERNAL_MUTEXES  =  2
     107} Objects_Internal_API;
     108
     109#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_MUTEXES
     110
     111typedef enum {
     112  OBJECTS_CLASSIC_NO_CLASS     = 0,
     113  OBJECTS_RTEMS_TASKS          = 1,
     114  OBJECTS_RTEMS_TIMERS         = 2,
     115  OBJECTS_RTEMS_SEMAPHORES     = 3,
     116  OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
     117  OBJECTS_RTEMS_PARTITIONS     = 5,
     118  OBJECTS_RTEMS_REGIONS        = 6,
     119  OBJECTS_RTEMS_PORTS          = 7,
     120  OBJECTS_RTEMS_PERIODS        = 8,
     121  OBJECTS_RTEMS_EXTENSIONS     = 9
     122} Objects_Classic_API;
     123
     124#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_EXTENSIONS
     125
     126typedef enum {
     127  OBJECTS_POSIX_NO_CLASS            = 0,
     128  OBJECTS_POSIX_THREADS             = 1,
     129  OBJECTS_POSIX_KEYS                = 2,
     130  OBJECTS_POSIX_INTERRUPTS          = 3,
     131  OBJECTS_POSIX_MESSAGE_QUEUE_FDS   = 4,
     132  OBJECTS_POSIX_MESSAGE_QUEUES      = 5,
     133  OBJECTS_POSIX_MUTEXES             = 6,
     134  OBJECTS_POSIX_SEMAPHORES          = 7,
     135  OBJECTS_POSIX_CONDITION_VARIABLES = 8
     136} Objects_POSIX_API;
     137
     138#define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_CONDITION_VARIABLES
     139
     140typedef enum {
     141  OBJECTS_ITRON_NO_CLASS              = 0,
     142  OBJECTS_ITRON_TASKS                 = 1,
     143  OBJECTS_ITRON_EVENTFLAGS            = 2,
     144  OBJECTS_ITRON_MAILBOXES             = 3,
     145  OBJECTS_ITRON_MESSAGE_BUFFERS       = 4,
     146  OBJECTS_ITRON_PORTS                 = 5,
     147  OBJECTS_ITRON_SEMAPHORES            = 6,
     148  OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 7,
     149  OBJECTS_ITRON_FIXED_MEMORY_POOLS    = 8
     150} Objects_ITRON_API;
     151
     152#define OBJECTS_ITRON_CLASSES_LAST OBJECTS_ITRON_FIXED_MEMORY_POOLS
    120153
    121154/*
     
    130163  OBJECTS_ERROR  = 2          /* id was invalid */
    131164}  Objects_Locations;
     165
     166/*
     167 *  The following type defines the callout used when a local task
     168 *  is extracted from a remote thread queue (i.e. it's proxy must
     169 *  extracted from the remote queue).
     170 */
     171
     172typedef void ( *Objects_Thread_queue_Extract_callout )( void * );
     173
    132174
    133175/*
     
    148190
    149191typedef struct {
    150   Objects_Classes   the_class;          /* Class of this object */
     192  Objects_APIs      the_api;            /* API of this object */
     193  unsigned32        the_class;          /* class of this object */
    151194  Objects_Id        minimum_id;         /* minimum valid id of this type */
    152195  Objects_Id        maximum_id;         /* maximum valid id of this type */
     
    157200  Objects_Control **local_table;
    158201  Objects_Name     *name_table;
    159   Chain_Control    *global_table;       /* pointer to global table */
    160202  Chain_Control     Inactive;           /* chain of inactive ctl blocks */
    161203  unsigned32        inactive;           /* number of objects on the InActive list */
     
    164206  boolean           is_string;          /* TRUE if names are strings */
    165207  unsigned32        name_length;        /* maximum length of names */
    166   boolean           is_thread;          /* TRUE if these are threads */
    167                                         /*   irregardless of API */
     208  Objects_Thread_queue_Extract_callout *extract;
     209#if defined(RTEMS_MULTIPROCESSING)
     210  Chain_Control    *global_table;       /* pointer to global table */
     211#endif
    168212}   Objects_Information;
    169213
     
    177221
    178222/*
    179  *  The following is the list of information blocks for each object
     223 *  The following is the list of information blocks per API for each object
    180224 *  class.  From the ID, we can go to one of these information blocks,
    181225 *  and obtain a pointer to the appropriate object control block.
    182226 */
    183227
    184 SCORE_EXTERN Objects_Information 
    185     *_Objects_Information_table[OBJECTS_CLASSES_LAST + 1];
     228SCORE_EXTERN Objects_Information
     229    **_Objects_Information_table[OBJECTS_APIS_LAST + 1];
    186230
    187231/*
     
    209253#define OBJECTS_ID_FINAL_INDEX     (0xffff)
    210254
    211 #define OBJECTS_ID_INITIAL(_class, _node) \
    212   _Objects_Build_id( (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
     255#define OBJECTS_ID_INITIAL(_api, _class, _node) \
     256  _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
    213257
    214258#define OBJECTS_ID_FINAL           ((Objects_Id)~0)
     
    269313void _Objects_Initialize_information (
    270314  Objects_Information *information,
    271   Objects_Classes      the_class,
    272   boolean              supports_global,
     315  Objects_APIs         the_api,
     316  unsigned32           the_class,
    273317  unsigned32           maximum,
    274318  unsigned32           size,
    275319  boolean              is_string,
    276   unsigned32           maximum_name_length,
    277   boolean              is_task
     320  unsigned32           maximum_name_length
     321#if defined(RTEMS_MULTIPROCESSING)
     322  ,
     323  boolean              supports_global,
     324  Objects_Thread_queue_Extract_callout *extract
     325#endif
    278326);
    279327
     
    461509  Objects_Locations   *location
    462510);
     511
     512Objects_Control *_Objects_Get_no_protection(
     513  Objects_Information *information,
     514  Objects_Id           id,
     515  Objects_Locations   *location
     516);
     517
    463518/*
    464519 *  _Objects_Get_next
  • cpukit/score/include/rtems/score/threadq.h

    r3a05d15 ref9505a  
    4848 */
    4949 
     50#if 0
    5051typedef void ( *Thread_queue_Extract_callout )(
    5152                 Thread_Control *
     
    5455SCORE_EXTERN Thread_queue_Extract_callout 
    5556  _Thread_queue_Extract_table[ OBJECTS_CLASSES_LAST + 1 ];
     57#endif
    5658
    5759/*
     
    104106 *
    105107 *  This routine extracts the_thread from the_thread_queue
    106  *  and insures that if there is a proxy for this task on
     108 *  and ensures that if there is a proxy for this task on
    107109 *  another node, it is also dealt with.
    108110 */
     
    153155void _Thread_queue_Initialize(
    154156  Thread_queue_Control         *the_thread_queue,
    155   Objects_Classes               the_class,
    156157  Thread_queue_Disciplines      the_discipline,
    157158  States_Control                state,
    158   Thread_queue_Extract_callout  proxy_extract_callout,
    159159  unsigned32                    timeout_status
    160160);
  • cpukit/score/inline/rtems/score/object.inl

    r3a05d15 ref9505a  
    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 ref9505a  
    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 
  • cpukit/score/macros/rtems/score/object.inl

    r3a05d15 ref9505a  
    2323 */
    2424
    25 #define _Objects_Build_id( _the_class, _node, _index ) \
    26   ( (( (Objects_Id) (_the_class) ) << OBJECTS_CLASS_START_BIT) | \
    27     (( (Objects_Id) (_node) ) << OBJECTS_NODE_START_BIT)       | \
    28     (( (Objects_Id) (_index) ) << OBJECTS_INDEX_START_BIT) )
     25#define _Objects_Build_id( _the_api, _the_class, _node, _index ) \
     26  ( (( (Objects_Id) _the_api ) << OBJECTS_API_START_BIT) | \
     27    (( (Objects_Id) _the_class ) << OBJECTS_CLASS_START_BIT) | \
     28    (( (Objects_Id) _node ) << OBJECTS_NODE_START_BIT)       | \
     29    (( (Objects_Id) _index ) << OBJECTS_INDEX_START_BIT) )
     30
     31/*PAGE
     32 *
     33 *  _Objects_Get_API
     34 */
     35 
     36#define _Objects_Get_API( _id ) \
     37  (Objects_APIs) \
     38    (((_id) >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS)
    2939
    3040/*PAGE
     
    3444 
    3545#define _Objects_Get_class( _id ) \
    36   (Objects_Classes) \
     46  (unsigned32) \
    3747    (((_id) >> OBJECTS_CLASS_START_BIT) & OBJECTS_CLASS_VALID_BITS)
    3848
     
    6272 
    6373#define _Objects_Is_class_valid( _the_class ) \
    64   ( (_the_class) && (_the_class) <= OBJECTS_CLASSES_LAST )
     74  ( (_the_class) /* XXX && (_the_class) <= OBJECTS_CLASSES_LAST */ )
    6575
    6676/*PAGE
     
    124134   ( !_Objects_Is_class_valid( _Objects_Get_class( id ) ) ) ? \
    125135     NULL : \
    126      _Objects_Information_table[ _Objects_Get_class( id ) ] \
     136     _Objects_Information_table[ _Objects_Get_API( id ) ] \
     137       [ _Objects_Get_class( id ) ] \
    127138 )
    128139
  • cpukit/score/src/Makefile.am

    r3a05d15 ref9505a  
    2929    objectfree.c objectget.c objectgetisr.c objectgetbyindex.c \
    3030    objectgetnext.c objectinitializeinformation.c objectnametoid.c \
    31     objectshrinkinformation.c
     31    objectshrinkinformation.c objectgetnoprotection.c
    3232
    3333THREAD_C_FILES = thread.c threadchangepriority.c threadclearstate.c \
     
    4545    threadqenqueuepriority.c threadqextract.c threadqextractfifo.c \
    4646    threadqextractpriority.c threadqextractwithproxy.c threadqfirst.c \
    47     threadqfirstfifo.c threadqfirstpriority.c threadqflush.c \
    48     threadqtimeout.c
     47    threadqfirstfifo.c threadqfirstpriority.c threadqflush.c threadqtimeout.c
    4948
    5049TOD_C_FILES = coretod.c coretodset.c coretodtickle.c coretodtoseconds.c \
  • cpukit/score/src/coremsg.c

    r3a05d15 ref9505a  
    4343 *    maximum_pending_messages     - maximum message and reserved buffer count
    4444 *    maximum_message_size         - maximum size of each message
    45  *    proxy_extract_callout        - remote extract support
    4645 *
    4746 *  Output parameters:
     
    5251boolean _CORE_message_queue_Initialize(
    5352  CORE_message_queue_Control    *the_message_queue,
    54   Objects_Classes                the_class,
    5553  CORE_message_queue_Attributes *the_message_queue_attributes,
    5654  unsigned32                     maximum_pending_messages,
    57   unsigned32                     maximum_message_size,
    58   Thread_queue_Extract_callout   proxy_extract_callout
     55  unsigned32                     maximum_message_size
    5956)
    6057{
     
    9794  _Thread_queue_Initialize(
    9895    &the_message_queue->Wait_queue,
    99     the_class,
    10096    _CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
    10197       THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
    10298    STATES_WAITING_FOR_MESSAGE,
    103     proxy_extract_callout,
    10499    CORE_MESSAGE_QUEUE_STATUS_TIMEOUT
    105100  );
  • cpukit/score/src/coremutex.c

    r3a05d15 ref9505a  
    3333 *  Input parameters:
    3434 *    the_mutex             - the mutex control block to initialize
    35  *    the_class             - the API class of the object
    3635 *    the_mutex_attributes  - the mutex attributes specified at create time
    3736 *    initial_lock          - mutex initial lock or unlocked status
    38  *    proxy_extract_callout - MP specific extract callout
    3937 *
    4038 *  Output parameters:  NONE
     
    4341void _CORE_mutex_Initialize(
    4442  CORE_mutex_Control           *the_mutex,
    45   Objects_Classes               the_class,
    4643  CORE_mutex_Attributes        *the_mutex_attributes,
    47   unsigned32                    initial_lock,
    48   Thread_queue_Extract_callout  proxy_extract_callout
     44  unsigned32                    initial_lock
    4945)
    5046{
     
    8581  _Thread_queue_Initialize(
    8682    &the_mutex->Wait_queue,
    87     the_class,
    8883    _CORE_mutex_Is_fifo( the_mutex_attributes ) ?
    8984      THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY,
    9085    STATES_WAITING_FOR_MUTEX,
    91     proxy_extract_callout,
    9286    CORE_MUTEX_TIMEOUT
    9387  );
  • cpukit/score/src/coresem.c

    r3a05d15 ref9505a  
    3737 *  Input parameters:
    3838 *    the_semaphore            - the semaphore control block to initialize
    39  *    the_class                - the API class of the object
    4039 *    the_semaphore_attributes - the attributes specified at create time
    4140 *    initial_value            - semaphore's initial value
    42  *    proxy_extract_callout    - MP specific extract callout
    4341 *
    4442 *  Output parameters:  NONE
     
    4745void _CORE_semaphore_Initialize(
    4846  CORE_semaphore_Control       *the_semaphore,
    49   Objects_Classes               the_class,
    5047  CORE_semaphore_Attributes    *the_semaphore_attributes,
    51   unsigned32                    initial_value,
    52   Thread_queue_Extract_callout  proxy_extract_callout
     48  unsigned32                    initial_value
    5349)
    5450{
     
    5955  _Thread_queue_Initialize(
    6056    &the_semaphore->Wait_queue,
    61     the_class,
    6257    _CORE_semaphore_Is_priority( the_semaphore_attributes ) ?
    6358              THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
    6459    STATES_WAITING_FOR_SEMAPHORE,
    65     proxy_extract_callout,
    6660    CORE_SEMAPHORE_TIMEOUT
    6761  );
  • cpukit/score/src/mpci.c

    r3a05d15 ref9505a  
    7272  _CORE_semaphore_Initialize(
    7373    &_MPCI_Semaphore,
    74     OBJECTS_NO_CLASS,         /* free floating semaphore */
    7574    &attributes,              /* the_semaphore_attributes */
    76     0,                        /* initial_value */
    77     NULL                      /* proxy_extract_callout */
     75    0                         /* initial_value */
    7876  );
    7977
    8078  _Thread_queue_Initialize(
    8179    &_MPCI_Remote_blocked_threads,
    82     OBJECTS_NO_CLASS,
    8380    THREAD_QUEUE_DISCIPLINE_FIFO,
    8481    STATES_WAITING_FOR_RPC_REPLY,
    85     NULL,
    8682    timeout_status
    8783  );
  • cpukit/score/src/objectcomparenameraw.c

    r3a05d15 ref9505a  
    3838)
    3939{
     40#if 0
    4041  unsigned32 *name_1_p = (unsigned32 *) name_1;
    4142  unsigned32 *name_2_p = (unsigned32 *) name_2;
    4243  unsigned32  tmp_length = length / OBJECTS_NAME_ALIGNMENT;
     44#endif
    4345 
     46  if ( name_1 == name_2 )
     47    return TRUE;
     48  return FALSE;
     49
     50#if 0
    4451  while ( tmp_length-- )
    4552    if ( *name_1_p++ != *name_2_p++ )
     
    4754
    4855  return TRUE;
     56#endif
    4957}
  • cpukit/score/src/objectextendinformation.c

    r3a05d15 ref9505a  
    209209    information->local_table = local_table;
    210210    information->maximum = maximum;
    211     information->maximum_id =
    212       _Objects_Build_id(
    213         information->the_class, _Objects_Local_node, information->maximum
     211    information->maximum_id = _Objects_Build_id(
     212        information->the_api,
     213        information->the_class,
     214        _Objects_Local_node,
     215        information->maximum
    214216      );
    215217
     
    269271  while ( (the_object = (Objects_Control *) _Chain_Get( &Inactive ) ) != NULL ) {
    270272   
    271     the_object->id =
    272       _Objects_Build_id(
    273         information->the_class, _Objects_Local_node, index
     273    the_object->id = _Objects_Build_id(
     274        information->the_api,
     275        information->the_class,
     276        _Objects_Local_node,
     277        index
    274278      );
    275279     
  • cpukit/score/src/objectinitializeinformation.c

    r3a05d15 ref9505a  
    3333 *  Input parameters:
    3434 *    information         - object information table
    35  *    the_class           - object class
    36  *    supports_global     - TRUE if this is a global object class
    3735 *    maximum             - maximum objects of this class
    3836 *    size                - size of this object's control block
    3937 *    is_string           - TRUE if names for this object are strings
    4038 *    maximum_name_length - maximum length of each object's name
    41  *    is_thread           - TRUE if this class is threads
     39 *    When multiprocessing is configured,
     40 *      supports_global     - TRUE if this is a global object class
     41 *      extract_callout     - pointer to threadq extract callout if MP
    4242 *
    4343 *  Output parameters:  NONE
     
    4646void _Objects_Initialize_information(
    4747  Objects_Information *information,
    48   Objects_Classes      the_class,
    49   boolean              supports_global,
     48  Objects_APIs         the_api,
     49  unsigned32           the_class,
    5050  unsigned32           maximum,
    5151  unsigned32           size,
    5252  boolean              is_string,
    53   unsigned32           maximum_name_length,
    54   boolean              is_thread
     53  unsigned32           maximum_name_length
     54#if defined(RTEMS_MULTIPROCESSING)
     55  ,
     56  boolean              supports_global,
     57  Objects_Thread_queue_Extract_callout *extract
     58#endif
    5559)
    5660{
    5761  static Objects_Control *null_local_table = NULL;
    58  
    5962  unsigned32       minimum_index;
     63  unsigned32       name_length;
     64#if defined(RTEMS_MULTIPROCESSING)
    6065  unsigned32       index;
    61   unsigned32       name_length;
     66#endif
    6267
     68  information->the_api            = the_api;
    6369  information->the_class          = the_class;
    6470  information->is_string          = is_string;
    65   information->is_thread          = is_thread;
    6671 
    6772  information->local_table        = 0;
     
    7681   */
    7782
    78   _Objects_Information_table[ the_class ] = information;
     83  _Objects_Information_table[ the_api ][ the_class ] = information;
    7984
    8085  /*
     
    111116
    112117  information->minimum_id =
    113     _Objects_Build_id( the_class, _Objects_Local_node, minimum_index );
     118    _Objects_Build_id( the_api, the_class, _Objects_Local_node, minimum_index );
    114119
    115120  /*
     
    154159   */
    155160
     161#if defined(RTEMS_MULTIPROCESSING)
     162  information->extract = extract;
     163
    156164  if ( supports_global == TRUE && _System_state_Is_multiprocessing ) {
    157165
     
    166174   else
    167175     information->global_table = NULL;
     176#endif
    168177}
  • cpukit/score/src/objectnametoid.c

    r3a05d15 ref9505a  
    7474
    7575    for ( index = 1; index <= information->maximum; index++ ) {
    76 
    7776      the_object = information->local_table[ index ];
    78 
    7977      if ( !the_object || !the_object->name )
    8078        continue;
  • cpukit/score/src/thread.c

    r3a05d15 ref9505a  
    9191  _Objects_Initialize_information(
    9292    &_Thread_Internal_information,
     93    OBJECTS_INTERNAL_API,
    9394    OBJECTS_INTERNAL_THREADS,
    94     FALSE,
    9595    ( _System_state_Is_multiprocessing ) ?  2 : 1,
    9696    sizeof( Thread_Control ),
    97     TRUE,
    98     8,
    99     TRUE
     97                                /* size of this object's control block */
     98    TRUE,                       /* TRUE if names for this object are strings */
     99    8                           /* maximum length of each object's name */
     100#if defined(RTEMS_MULTIPROCESSING)
     101    ,
     102    FALSE,                      /* TRUE if this is a global object class */
     103    NULL                        /* Proxy extraction support callout */
     104#endif
    100105  );
    101106
  • cpukit/score/src/threadclose.c

    r3a05d15 ref9505a  
    4747 
    4848  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
    49  
    5049    if ( _Watchdog_Is_active( &the_thread->Timer ) )
    5150      (void) _Watchdog_Remove( &the_thread->Timer );
  • cpukit/score/src/threadget.c

    r3a05d15 ref9505a  
    4444)
    4545{
    46   Objects_Classes      the_class;
     46  unsigned32           the_api;
     47  unsigned32           the_class;
    4748  Objects_Information *information;
     49  Thread_Control      *tp = (Thread_Control *) 0;
    4850 
    4951  if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
    5052    _Thread_Disable_dispatch();
    5153    *location = OBJECTS_LOCAL;
    52     return( _Thread_Executing );
     54    tp = _Thread_Executing;
     55    goto done;
    5356  }
    5457 
     58  the_api = _Objects_Get_API( id );
     59  if ( the_api && the_api > OBJECTS_APIS_LAST ) {
     60    *location = OBJECTS_ERROR;
     61    goto done;
     62  }
     63 
    5564  the_class = _Objects_Get_class( id );
    56  
    57   if ( the_class > OBJECTS_CLASSES_LAST ) {
     65  if ( the_class != 1 ) {       /* threads are always first class :) */
    5866    *location = OBJECTS_ERROR;
    59     return (Thread_Control *) 0;
    60   }
    61  
    62   information = _Objects_Information_table[ the_class ];
    63  
    64   if ( !information || !information->is_thread ) {
    65     *location = OBJECTS_ERROR;
    66     return (Thread_Control *) 0;
     67    goto done;
    6768  }
    6869 
    69   return (Thread_Control *) _Objects_Get( information, id, location );
     70  information = _Objects_Information_table[ the_api ][ the_class ];
     71 
     72  if ( !information ) {
     73    *location = OBJECTS_ERROR;
     74    goto done;
     75  }
     76 
     77  tp = (Thread_Control *) _Objects_Get( information, id, location );
     78 
     79done:
     80  return tp;
    7081}
    7182
  • cpukit/score/src/threadq.c

    r3a05d15 ref9505a  
    3030 *  Input parameters:
    3131 *    the_thread_queue      - pointer to a threadq header
    32  *    the_class             - class of the object to which this belongs
    3332 *    discipline            - queueing discipline
    3433 *    state                 - state of waiting threads
    35  *    proxy_extract_callout - MP specific callout
    3634 *    timeout_status        - return on a timeout
    3735 *
     
    4139void _Thread_queue_Initialize(
    4240  Thread_queue_Control         *the_thread_queue,
    43   Objects_Classes               the_class,
    4441  Thread_queue_Disciplines      the_discipline,
    4542  States_Control                state,
    46   Thread_queue_Extract_callout  proxy_extract_callout,
    4743  unsigned32                    timeout_status
    4844)
    4945{
    5046  unsigned32 index;
    51 
    52   _Thread_queue_Extract_table[ the_class ] = proxy_extract_callout;
    5347
    5448  the_thread_queue->state          = state;
  • cpukit/score/src/threadqextractwithproxy.c

    r3a05d15 ref9505a  
    2727 *
    2828 *  This routine extracts the_thread from the_thread_queue
    29  *  and insures that if there is a proxy for this task on
     29 *  and ensures that if there is a proxy for this task on
    3030 *  another node, it is also dealt with.
    3131 *
     
    3838{
    3939  States_Control                state;
    40   Objects_Classes               the_class;
    41   Thread_queue_Extract_callout  proxy_extract_callout;
     40  Objects_Information          *the_information;
     41  Objects_Thread_queue_Extract_callout  proxy_extract_callout;
    4242
    4343  state = the_thread->current_state;
     
    4747         _States_Is_locally_blocked( state ) ) {
    4848
    49       the_class = _Objects_Get_class( the_thread->Wait.id );
     49      the_information = _Objects_Get_information( the_thread->Wait.id );
    5050
    51       proxy_extract_callout = _Thread_queue_Extract_table[ the_class ];
     51      proxy_extract_callout =
     52        (Objects_Thread_queue_Extract_callout) the_information->extract;
    5253
    5354      if ( proxy_extract_callout )
Note: See TracChangeset for help on using the changeset viewer.