Changeset ef9505a9 in rtems for cpukit/score/include


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, 5, 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/include
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/Makefile.am

    r3a05d15 ref9505a9  
    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 ref9505a9  
    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 ref9505a9  
    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 ref9505a9  
    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 ref9505a9  
    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 ref9505a9  
    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);
Note: See TracChangeset for help on using the changeset viewer.