Changeset 85b7605 in rtems


Ignore:
Timestamp:
Nov 1, 2004, 1:15:40 PM (15 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
7ce11b2
Parents:
cbd849c
Message:

2004-11-01 Joel Sherrill <joel@…>

  • score/include/rtems/score/object.h, score/inline/rtems/score/object.inl, score/macros/rtems/score/object.inl: Add first cut of optional 16 bit object Id as space reduction for small systems (TinyRTEMS).
Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rcbd849c r85b7605  
     12004-11-01      Joel Sherrill <joel@oarcorp.com>
     2
     3        * score/include/rtems/score/object.h,
     4        score/inline/rtems/score/object.inl,
     5        score/macros/rtems/score/object.inl: Add first cut of optional
     6        16 bit object Id as space reduction for small systems (TinyRTEMS).
     7
    182004-11-01      Ralf Corsepius <ralf_corsepius@rtems.org>
    29
  • cpukit/score/include/rtems/score/object.h

    rcbd849c r85b7605  
    66 *  ids.
    77 *
    8  *  COPYRIGHT (c) 1989-2002.
     8 *  COPYRIGHT (c) 1989-2004.
    99 *  On-Line Applications Research Corporation (OAR).
    1010 *
     
    5858);
    5959
     60#if defined(RTEMS_USE_16_BIT_OBJECT)
     61/*
     62 *  The following type defines the control block used to manage
     63 *  object IDs.  The format is as follows (0=LSB):
     64 *
     65 *     Bits  0 ..  7    = index  (up to 254 objects of a type)
     66 *     Bits  8 .. 10    = API    (up to 7 API classes)
     67 *     Bits 11 .. 15    = class  (up to 31 object types per API)
     68 */
     69
     70typedef uint16_t   Objects_Id;
     71typedef uint8_t    Objects_Maximum;
     72
     73#define OBJECTS_INDEX_START_BIT  0
     74#define OBJECTS_API_START_BIT    8
     75#define OBJECTS_CLASS_START_BIT 11
     76
     77#define OBJECTS_INDEX_MASK      (Objects_Id)0x000000ff
     78#define OBJECTS_API_MASK        (Objects_Id)0x00000700
     79#define OBJECTS_CLASS_MASK      (Objects_Id)0x0000F800
     80
     81#else
    6082/*
    6183 *  The following type defines the control block used to manage
     
    6991
    7092typedef uint32_t   Objects_Id;
     93typedef uint16_t   Objects_Maximum;
    7194
    7295#define OBJECTS_INDEX_START_BIT  0
     
    84107#define OBJECTS_API_VALID_BITS    (Objects_Id)0x00000007
    85108#define OBJECTS_CLASS_VALID_BITS  (Objects_Id)0x0000001f
     109#endif
    86110
    87111/*
     
    162186  OBJECTS_REMOTE = 1,         /* object is remote */
    163187  OBJECTS_ERROR  = 2          /* id was invalid */
    164 }  Objects_Locations;
     188} Objects_Locations;
    165189
    166190/*
     
    171195
    172196typedef void ( *Objects_Thread_queue_Extract_callout )( void * );
    173 
    174197
    175198/*
     
    182205  Objects_Id     id;
    183206  Objects_Name   name;
    184 }   Objects_Control;
     207} Objects_Control;
    185208
    186209/*
     
    191214typedef struct {
    192215  Objects_APIs      the_api;            /* API of this object */
    193   uint32_t          the_class;          /* class of this object */
     216  uint16_t          the_class;          /* class of this object */
    194217  Objects_Id        minimum_id;         /* minimum valid id of this type */
    195218  Objects_Id        maximum_id;         /* maximum valid id of this type */
    196   uint32_t          maximum;            /* maximum number of objects */
     219  Objects_Maximum   maximum;            /* maximum number of objects */
    197220  boolean           auto_extend;        /* TRUE if unlimited objects */
    198221  uint32_t          allocation_size;    /* number of objects in a block */
     
    201224  Objects_Name     *name_table;
    202225  Chain_Control     Inactive;           /* chain of inactive ctl blocks */
    203   uint32_t          inactive;           /* number of objects on the InActive list */
     226  Objects_Maximum   inactive;           /* number of objects on the InActive list */
    204227  uint32_t         *inactive_per_block; /* used to release a block */
    205228  void            **object_blocks;      /* the object memory to remove */
    206229  boolean           is_string;          /* TRUE if names are strings */
    207   uint32_t          name_length;        /* maximum length of names */
     230  uint16_t          name_length;        /* maximum length of names */
    208231  Objects_Thread_queue_Extract_callout *extract;
    209232#if defined(RTEMS_MULTIPROCESSING)
     
    217240 */
    218241
     242#if defined(RTEMS_MULTIPROCESSING)
    219243SCORE_EXTERN uint32_t    _Objects_Local_node;
    220244SCORE_EXTERN uint32_t    _Objects_Maximum_nodes;
     245#else
     246#define _Objects_Local_node    1
     247#define _Objects_Maximum_nodes 1
     248#endif
    221249
    222250/*
     
    255283#define OBJECTS_ID_INITIAL(_api, _class, _node) \
    256284  _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
    257 
    258285#define OBJECTS_ID_FINAL           ((Objects_Id)~0)
    259286
     
    315342  Objects_APIs         the_api,
    316343  uint32_t             the_class,
    317   uint32_t             maximum,
    318   uint32_t             size,
     344  Objects_Maximum      maximum,
     345  uint16_t             size,
    319346  boolean              is_string,
    320347  uint32_t             maximum_name_length
     
    352379Objects_Control *_Objects_Allocate_by_index(
    353380  Objects_Information *information,
    354   uint32_t             index,
    355   uint32_t             sizeof_control
     381  uint16_t             index,
     382  uint16_t             sizeof_control
    356383);
    357384
     
    408435  void       *source,
    409436  void       *destination,
    410   uint32_t    length
     437  uint16_t    length
    411438);
    412439
     
    422449  void       *name_1,
    423450  void       *name_2,
    424   uint32_t    length
     451  uint16_t    length
    425452);
    426453
     
    436463  void       *name_1,
    437464  void       *name_2,
    438   uint32_t    length
     465  uint16_t    length
    439466);
    440467
  • cpukit/score/inline/rtems/score/object.inl

    rcbd849c r85b7605  
    132132 */
    133133
     134#if defined(RTEMS_MULTIPROCESSING)
    134135RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_node(
    135136  uint32_t   node
     
    138139  return ( node == _Objects_Local_node );
    139140}
     141#endif
    140142
    141143/*PAGE
     
    149151 */
    150152
     153#if defined(RTEMS_MULTIPROCESSING)
    151154RTEMS_INLINE_ROUTINE boolean _Objects_Is_local_id(
    152155  Objects_Id id
     
    155158  return _Objects_Is_local_node( _Objects_Get_node(id) );
    156159}
     160#endif
    157161
    158162/*PAGE
     
    186190RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Get_local_object(
    187191  Objects_Information *information,
    188   uint32_t             index
     192  uint16_t             index
    189193)
    190194{
     
    206210RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
    207211  Objects_Information *information,
    208   uint32_t             index,
     212  uint16_t             index,
    209213  Objects_Control     *the_object
    210214)
     
    230234{
    231235  Objects_APIs  the_api;
    232   uint32_t      the_class;
     236  uint16_t      the_class;
    233237
    234238
  • cpukit/score/macros/rtems/score/object.inl

    rcbd849c r85b7605  
    8080 */
    8181
     82#if defined(RTEMS_MULTIPROCESSING)
    8283#define _Objects_Is_local_node( _node ) \
    8384  ( (_node) == _Objects_Local_node )
     85#endif
    8486
    8587/*PAGE
     
    8991 */
    9092
     93#if defined(RTEMS_MULTIPROCESSING)
    9194#define _Objects_Is_local_id( _id ) \
    9295  _Objects_Is_local_node( _Objects_Get_node(_id) )
     96#endif
    9397
    9498/*PAGE
Note: See TracChangeset for help on using the changeset viewer.