source: rtems/cpukit/score/include/rtems/score/object.h @ 0243b0d

4.104.114.84.95
Last change on this file since 0243b0d was 0243b0d, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 8, 2006 at 8:47:48 PM

2006-06-08 Joel Sherrill <joel@…>

  • posix/Makefile.am, posix/preinstall.am, posix/include/rtems/posix/timer.h, posix/src/ptimer.c, posix/src/ptimer1.c, sapi/src/posixapi.c, score/include/rtems/score/object.h:
  • Property mode set to 100644
File size: 25.8 KB
Line 
1/**
2 * @file  rtems/score/object.h
3 */
4 
5/*
6 *  This include file contains all the constants and structures associated
7 *  with the Object Handler.  This Handler provides mechanisms which
8 *  can be used to initialize and manipulate all objects which have
9 *  ids.
10 *
11 *  COPYRIGHT (c) 1989-2006.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifndef _RTEMS_SCORE_OBJECT_H
22#define _RTEMS_SCORE_OBJECT_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <rtems/score/chain.h>
29#include <rtems/score/isr.h>
30
31/**
32 *  The following type defines the control block used to manage
33 *  object names.
34 */
35typedef void * Objects_Name;
36
37/**
38 *  Space for object names is allocated in multiples of this.
39 *
40 *  NOTE:  Must be a power of 2.  Matches the name manipulation routines.
41 */
42#define OBJECTS_NAME_ALIGNMENT     sizeof( uint32_t )
43
44/**
45 *  Functions which compare names are prototyped like this.
46 */
47typedef boolean (*Objects_Name_comparators)(
48  void       * /* name_1 */,
49  void       * /* name_2 */,
50  uint16_t     /* length */
51);
52
53#if defined(RTEMS_USE_16_BIT_OBJECT)
54/**
55 *  The following type defines the control block used to manage
56 *  object IDs.  The format is as follows (0=LSB):
57 *
58 *     Bits  0 ..  7    = index  (up to 254 objects of a type)
59 *     Bits  8 .. 10    = API    (up to 7 API classes)
60 *     Bits 11 .. 15    = class  (up to 31 object types per API)
61 */
62typedef uint16_t   Objects_Id;
63
64/**
65 * This type is used to store the maximum number of allowed objects
66 * of each type.
67 */
68typedef uint8_t    Objects_Maximum;
69
70#define OBJECTS_INDEX_START_BIT  0
71#define OBJECTS_API_START_BIT    8
72#define OBJECTS_CLASS_START_BIT 11
73
74#define OBJECTS_INDEX_MASK      (Objects_Id)0x00ff
75#define OBJECTS_API_MASK        (Objects_Id)0x0700
76#define OBJECTS_CLASS_MASK      (Objects_Id)0xF800
77
78#define OBJECTS_INDEX_VALID_BITS  (Objects_Id)0x00ff
79#define OBJECTS_API_VALID_BITS    (Objects_Id)0x0007
80/* OBJECTS_NODE_VALID_BITS should not be used with 16 bit Ids */
81#define OBJECTS_CLASS_VALID_BITS  (Objects_Id)0x001f
82
83#define OBJECTS_UNLIMITED_OBJECTS 0x8000
84
85#define OBJECTS_ID_INITIAL_INDEX  (0)
86#define OBJECTS_ID_FINAL_INDEX    (0xff)
87
88#else
89/**
90 *  The following type defines the control block used to manage
91 *  object IDs.  The format is as follows (0=LSB):
92 *
93 *     Bits  0 .. 15    = index  (up to 65535 objects of a type)
94 *     Bits 16 .. 23    = node   (up to 255 nodes)
95 *     Bits 24 .. 26    = API    (up to 7 API classes)
96 *     Bits 27 .. 31    = class  (up to 31 object types per API)
97 */
98typedef uint32_t   Objects_Id;
99
100/**
101 * This type is used to store the maximum number of allowed objects
102 * of each type.
103 */
104typedef uint16_t   Objects_Maximum;
105
106/**
107 *  This is the bit position of the starting bit of the index portion of
108 *  the object Id.
109 */
110#define OBJECTS_INDEX_START_BIT  0
111
112
113/**
114 *  This is the bit position of the starting bit of the node portion of
115 *  the object Id.
116 */
117#define OBJECTS_NODE_START_BIT  16
118
119/**
120 *  This is the bit position of the starting bit of the API portion of
121 *  the object Id.
122 */
123#define OBJECTS_API_START_BIT   24
124
125/**
126 *  This is the bit position of the starting bit of the class portion of
127 *  the object Id.
128 */
129#define OBJECTS_CLASS_START_BIT 27
130
131/**
132 *  This mask is used to extract the index portion of an object Id.
133 */
134#define OBJECTS_INDEX_MASK      (Objects_Id)0x0000ffff
135
136/**
137 *  This mask is used to extract the node portion of an object Id.
138 */
139#define OBJECTS_NODE_MASK       (Objects_Id)0x00ff0000
140
141/**
142 *  This mask is used to extract the API portion of an object Id.
143 */
144#define OBJECTS_API_MASK        (Objects_Id)0x07000000
145
146/**
147 *  This mask is used to extract the class portion of an object Id.
148 */
149#define OBJECTS_CLASS_MASK      (Objects_Id)0xf8000000
150
151/**
152 *  This mask represents the bits that is used to ensure no extra bits
153 *  are set after shifting to extract the index portion of an object Id.
154 */
155#define OBJECTS_INDEX_VALID_BITS  (Objects_Id)0x0000ffff
156
157/**
158 *  This mask represents the bits that is used to ensure no extra bits
159 *  are set after shifting to extract the node portion of an object Id.
160 */
161#define OBJECTS_NODE_VALID_BITS   (Objects_Id)0x000000ff
162
163/**
164 *  This mask represents the bits that is used to ensure no extra bits
165 *  are set after shifting to extract the API portion of an object Id.
166 */
167#define OBJECTS_API_VALID_BITS    (Objects_Id)0x00000007
168
169/**
170 *  This mask represents the bits that is used to ensure no extra bits
171 *  are set after shifting to extract the class portion of an object Id.
172 */
173#define OBJECTS_CLASS_VALID_BITS  (Objects_Id)0x0000001f
174
175/**
176 *  Mask to enable unlimited objects.  This is used in the configuration
177 *  table when specifying the number of configured objects.
178 */
179#define OBJECTS_UNLIMITED_OBJECTS 0x80000000
180
181/**
182 *  This is the lowest value for the index portion of an object Id.
183 */
184#define OBJECTS_ID_INITIAL_INDEX  (0)
185
186/**
187 *  This is the highest value for the index portion of an object Id.
188 */
189#define OBJECTS_ID_FINAL_INDEX    (0xff)
190#endif
191
192/**
193 *  This enumerated type is used in the class field of the object ID.
194 */
195typedef enum {
196  OBJECTS_NO_API       = 0,
197  OBJECTS_INTERNAL_API = 1,
198  OBJECTS_CLASSIC_API  = 2,
199  OBJECTS_POSIX_API    = 3,
200  OBJECTS_ITRON_API    = 4
201} Objects_APIs;
202
203/** This macro is used to generically specify the last API index. */
204#define OBJECTS_APIS_LAST OBJECTS_ITRON_API
205
206/**
207 *  This enumerated type is used in the class field of the object ID
208 *  for RTEMS internal object classes.
209 */
210typedef enum {
211  OBJECTS_INTERNAL_NO_CLASS =  0,
212  OBJECTS_INTERNAL_THREADS  =  1,
213  OBJECTS_INTERNAL_MUTEXES  =  2
214} Objects_Internal_API;
215
216/** This macro is used to generically specify the last API index. */
217#define OBJECTS_INTERNAL_CLASSES_LAST OBJECTS_INTERNAL_MUTEXES
218
219/**
220 *  This enumerated type is used in the class field of the object ID
221 *  for the RTEMS Classic API.
222 */
223typedef enum {
224  OBJECTS_CLASSIC_NO_CLASS     = 0,
225  OBJECTS_RTEMS_TASKS          = 1,
226  OBJECTS_RTEMS_TIMERS         = 2,
227  OBJECTS_RTEMS_SEMAPHORES     = 3,
228  OBJECTS_RTEMS_MESSAGE_QUEUES = 4,
229  OBJECTS_RTEMS_PARTITIONS     = 5,
230  OBJECTS_RTEMS_REGIONS        = 6,
231  OBJECTS_RTEMS_PORTS          = 7,
232  OBJECTS_RTEMS_PERIODS        = 8,
233  OBJECTS_RTEMS_EXTENSIONS     = 9
234} Objects_Classic_API;
235
236/** This macro is used to generically specify the last API index. */
237#define OBJECTS_RTEMS_CLASSES_LAST OBJECTS_RTEMS_EXTENSIONS
238
239/**
240 *  This enumerated type is used in the class field of the object ID
241 *  for the POSIX API.
242 */
243typedef enum {
244  OBJECTS_POSIX_NO_CLASS            = 0,
245  OBJECTS_POSIX_THREADS             = 1,
246  OBJECTS_POSIX_KEYS                = 2,
247  OBJECTS_POSIX_INTERRUPTS          = 3,
248  OBJECTS_POSIX_MESSAGE_QUEUE_FDS   = 4,
249  OBJECTS_POSIX_MESSAGE_QUEUES      = 5,
250  OBJECTS_POSIX_MUTEXES             = 6,
251  OBJECTS_POSIX_SEMAPHORES          = 7,
252  OBJECTS_POSIX_CONDITION_VARIABLES = 8,
253  OBJECTS_POSIX_TIMERS              = 9
254} Objects_POSIX_API;
255
256/** This macro is used to generically specify the last API index. */
257#define OBJECTS_POSIX_CLASSES_LAST OBJECTS_POSIX_TIMERS
258
259/**
260 *  This enumerated type is used in the class field of the object ID
261 *  for the ITRON API.
262 */
263typedef enum {
264  OBJECTS_ITRON_NO_CLASS              = 0,
265  OBJECTS_ITRON_TASKS                 = 1,
266  OBJECTS_ITRON_EVENTFLAGS            = 2,
267  OBJECTS_ITRON_MAILBOXES             = 3,
268  OBJECTS_ITRON_MESSAGE_BUFFERS       = 4,
269  OBJECTS_ITRON_PORTS                 = 5,
270  OBJECTS_ITRON_SEMAPHORES            = 6,
271  OBJECTS_ITRON_VARIABLE_MEMORY_POOLS = 7,
272  OBJECTS_ITRON_FIXED_MEMORY_POOLS    = 8
273} Objects_ITRON_API;
274
275/** This macro is used to generically specify the last API index. */
276#define OBJECTS_ITRON_CLASSES_LAST OBJECTS_ITRON_FIXED_MEMORY_POOLS
277
278/**
279 *  This enumerated type lists the locations which may be returned
280 *  by _Objects_Get.  These codes indicate the success of locating
281 *  an object with the specified ID.
282 */
283typedef enum {
284  OBJECTS_LOCAL  = 0,         /* object is local */
285  OBJECTS_REMOTE = 1,         /* object is remote */
286  OBJECTS_ERROR  = 2          /* id was invalid */
287} Objects_Locations;
288
289/**
290 *  The following type defines the callout used when a local task
291 *  is extracted from a remote thread queue (i.e. it's proxy must
292 *  extracted from the remote queue).
293 */
294typedef void ( *Objects_Thread_queue_Extract_callout )( void * );
295
296/**
297 *  The following defines the Object Control Block used to manage
298 *  each object local to this node.
299 */
300typedef struct {
301  /** This is the chain node portion of an object. */
302  Chain_Node     Node;
303  /** This is the object's ID. */
304  Objects_Id     id;
305  /** This is the object's name. */
306  Objects_Name   name;
307} Objects_Control;
308
309/**
310 *  The following defines the structure for the information used to
311 *  manage each class of objects.
312 */
313typedef struct {
314  /** This field indicates the API of this object class. */
315  Objects_APIs      the_api;
316  /** This is the class of this object set. */
317  uint16_t          the_class;
318  /** This is the minimum valid id of this object class. */
319  Objects_Id        minimum_id;
320  /** This is the maximum valid id of this object class. */
321  Objects_Id        maximum_id;
322  /** This is the maximum number of objects in this class. */
323  Objects_Maximum   maximum;
324  /** This is the TRUE if unlimited objects in this class. */
325  boolean           auto_extend;
326  /** This is the number of objects in a block. */
327  uint32_t          allocation_size;
328  /** This is the size in bytes of each object instance. */
329  uint32_t          size;
330  /** This points to the table of local objects. */
331  Objects_Control **local_table;
332  /** This points to the table of local object names. */
333  Objects_Name     *name_table;
334  /** This is the chain of inactive control blocks. */
335  Chain_Control     Inactive;
336  /** This is the number of objects on the Inactive list. */
337  Objects_Maximum   inactive;
338  /** This is the number of inactive objects per block. */
339  uint32_t         *inactive_per_block;
340  /** This is a table to the chain of inactive object memory blocks. */
341  void            **object_blocks;
342  /** This is the TRUE if names are strings. */
343  boolean           is_string;
344  /** This is the maximum length of names. */
345  uint16_t          name_length;
346  /** This is this object class' method called when extracting a thread. */
347  Objects_Thread_queue_Extract_callout extract;
348#if defined(RTEMS_MULTIPROCESSING)
349  /** This is this object class' pointer to the global name table */
350  Chain_Control    *global_table;
351#endif
352}   Objects_Information;
353
354/**
355 *  The following is referenced to the node number of the local node.
356 */
357#if defined(RTEMS_MULTIPROCESSING)
358SCORE_EXTERN uint16_t    _Objects_Local_node;
359#else
360#define _Objects_Local_node    1
361#endif
362
363/**
364 *  The following is referenced to the number of nodes in the system.
365 */
366#if defined(RTEMS_MULTIPROCESSING)
367SCORE_EXTERN uint16_t    _Objects_Maximum_nodes;
368#else
369#define _Objects_Maximum_nodes 1
370#endif
371
372/**
373 *  The following is the list of information blocks per API for each object
374 *  class.  From the ID, we can go to one of these information blocks,
375 *  and obtain a pointer to the appropriate object control block.
376 */
377SCORE_EXTERN Objects_Information
378    **_Objects_Information_table[OBJECTS_APIS_LAST + 1];
379
380/**
381 *  The following defines the constant which may be used
382 *  with _Objects_Get to manipulate the calling task.
383 */
384#define OBJECTS_ID_OF_SELF ((Objects_Id) 0)
385
386/**
387 *  The following constant is used to specify that a name to ID search
388 *  should search through all nodes.
389 */
390#define OBJECTS_SEARCH_ALL_NODES   0
391
392/**
393 *  The following constant is used to specify that a name to ID search
394 *  should search through all nodes except the current node.
395 */
396#define OBJECTS_SEARCH_OTHER_NODES 0x7FFFFFFE
397
398/**
399 *  The following constant is used to specify that a name to ID search
400 *  should search only on this node.
401 */
402#define OBJECTS_SEARCH_LOCAL_NODE  0x7FFFFFFF
403
404/**
405 *  The following constant is used to specify that a name to ID search
406 *  is being asked for the ID of the currently executing task.
407 */
408#define OBJECTS_WHO_AM_I           0
409
410/**
411 *  This macros calculates the lowest ID for the specified api, class,
412 *  and node.
413 */
414#define OBJECTS_ID_INITIAL(_api, _class, _node) \
415  _Objects_Build_id( (_api), (_class), (_node), OBJECTS_ID_INITIAL_INDEX )
416
417/**
418 *  This macro specifies the highest object ID value
419 */
420#define OBJECTS_ID_FINAL           ((Objects_Id)~0)
421
422/**
423 *  This function performs the initialization necessary for this handler.
424 *
425 *  @param[in] node indicates the identifying number of this node.
426 *  @param[in] maximum_nodes is the maximum number of nodes in this system.
427 *  @param[in] maximum_global_objects is maximum number of global objects
428 *             concurrently offered in the system.
429 */
430void _Objects_Handler_initialization(
431  uint32_t   node,
432  uint32_t   maximum_nodes,
433  uint32_t   maximum_global_objects
434);
435
436/**
437 *  This function extends an object class information record.
438 *
439 *  @param[in] information points to an object class information block.
440 */
441void _Objects_Extend_information(
442  Objects_Information *information
443);
444
445/**
446 *  This function shrink an object class information record.
447 *
448 *  @param[in] information points to an object class information block.
449 */
450void _Objects_Shrink_information(
451  Objects_Information *information
452);
453
454/**
455 *  This function initializes an object class information record.
456 *  SUPPORTS_GLOBAL is TRUE if the object class supports global
457 *  objects, and FALSE otherwise.  Maximum indicates the number
458 *  of objects required in this class and size indicates the size
459 *  in bytes of each control block for this object class.  The
460 *  name length and string designator are also set.  In addition,
461 *  the class may be a task, therefore this information is also included.
462 *
463 *  @param[in] information points to an object class information block.
464 *  @param[in] the_api indicates the API associated with this information block.
465 *  @param[in] the_class indicates the class of object being managed
466 *             by this information block.  It is specific to @a the_api.
467 *  @param[in] maximum is the maximum number of instances of this object
468 *             class which may be concurrently active.
469 *  @param[in] size is the size of the data structure for this class.
470 *  @param[in] is_string is TRUE if this object uses string style names.
471 *  @param[in] maximum_name_length is the maximum length of object names.
472 */
473void _Objects_Initialize_information (
474  Objects_Information *information,
475  Objects_APIs         the_api,
476  uint32_t             the_class,
477  uint32_t             maximum,
478  uint16_t             size,
479  boolean              is_string,
480  uint32_t             maximum_name_length
481#if defined(RTEMS_MULTIPROCESSING)
482  ,
483  boolean              supports_global,
484  Objects_Thread_queue_Extract_callout extract
485#endif
486);
487
488/**
489 *  This function allocates a object control block from
490 *  the inactive chain of free object control blocks.
491 *
492 *  @param[in] information points to an object class information block.
493 */
494Objects_Control *_Objects_Allocate(
495  Objects_Information *information
496);
497
498/**
499 *  This function allocates the object control block
500 *  specified by the index from the inactive chain of
501 *  free object control blocks.
502 *
503 *  @param[in] information points to an object class information block.
504 *  @param[in] index is the index of the object to allocate.
505 *  @param[in] sizeof_control is the size of the object control block.
506 */
507Objects_Control *_Objects_Allocate_by_index(
508  Objects_Information *information,
509  uint16_t             index,
510  uint16_t             sizeof_control
511);
512
513/**
514 *
515 *  This function frees a object control block to the
516 *  inactive chain of free object control blocks.
517 *
518 *  @param[in] information points to an object class information block.
519 *  @param[in] the_object points to the object to deallocate.
520 */
521void _Objects_Free(
522  Objects_Information *information,
523  Objects_Control     *the_object
524);
525
526/**
527 *  This method zeroes out the name.
528 *
529 *  @param[in] name points to the name to be zeroed out.
530 *  @param[in] length is the length of the object name field.
531 */
532void _Objects_Clear_name(
533  void       *name,
534  uint16_t    length
535);
536
537/**
538 *  This method copies a string style object name from source to destination.
539 *
540 *  @param[in] source is the source name to copy.
541 *  @param[in] destination is the destination of the copy.
542 *  @param[in] length is the number of bytes to copy.
543 */
544void _Objects_Copy_name_string(
545  void       *source,
546  void       *destination,
547  uint16_t    length
548);
549
550/**
551 *  This method copies a raw style object name from source to destination.
552 *
553 *  @param[in] source is the source name to copy.
554 *  @param[in] destination is the destination of the copy.
555 *  @param[in] length is the number of bytes to copy.
556 */
557void _Objects_Copy_name_raw(
558  void       *source,
559  void       *destination,
560  uint16_t    length
561);
562
563/**
564 *  This method compares two string style object names.
565 *
566 *  @param[in] name_1 is the left hand name to compare.
567 *  @param[in] name_2 is the right hand name to compare.
568 *  @param[in] length is the length of the names to compare.
569 */
570boolean _Objects_Compare_name_string(
571  void       *name_1,
572  void       *name_2,
573  uint16_t    length
574);
575
576/**
577 *  This method compares two raw style object names.
578 *
579 *  @param[in] name_1 is the left hand name to compare.
580 *  @param[in] name_2 is the right hand name to compare.
581 *  @param[in] length is the length of the names to compare.
582 */
583boolean _Objects_Compare_name_raw(
584  void       *name_1,
585  void       *name_2,
586  uint16_t    length
587);
588
589/**
590 *  This function implements the common portion of the object
591 *  identification directives.  This directive returns the object
592 *  id associated with name.  If more than one object of this class
593 *  is named name, then the object to which the id belongs is
594 *  arbitrary.  Node indicates the extent of the search for the
595 *  id of the object named name.  If the object class supports global
596 *  objects, then the search can be limited to a particular node
597 *  or allowed to encompass all nodes.
598 */
599typedef enum {
600  OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL,
601  OBJECTS_INVALID_NAME,
602  OBJECTS_INVALID_ADDRESS,
603  OBJECTS_INVALID_ID,
604  OBJECTS_INVALID_NODE
605} Objects_Name_or_id_lookup_errors;
606
607/** This macro defines the first entry in the
608 *  @ref Objects_Name_or_id_lookup_errors enumerated list.
609 */
610#define OBJECTS_NAME_ERRORS_FIRST OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL
611
612/** This macro defines the last entry in the
613 *  @ref Objects_Name_or_id_lookup_errors enumerated list.
614 */
615#define OBJECTS_NAME_ERRORS_LAST  OBJECTS_INVALID_NODE
616
617/**
618 *  This method converts an object name to an Id.  It performs a look up
619 *  using the object information block for this object class.
620 *
621 *  @param[in] information points to an object class information block.
622 *  @param[in] name is the name of the object to find.
623 *  @param[in] node is the set of nodes to search.
624 *  @param[in] id will contain the Id if the search is successful.
625 *
626 *  @return This method returns one of the values from the
627 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
628 *          successful or failure.  On success @a id will contain the Id of
629 *          the requested object.
630 */
631Objects_Name_or_id_lookup_errors _Objects_Name_to_id(
632  Objects_Information *information,
633  Objects_Name         name,
634  uint32_t             node,
635  Objects_Id          *id
636);
637
638/**
639 *  This function implements the common portion of the object Id
640 *  to name directives.  This function returns the name
641 *  associated with object id.
642 *
643 *  @param[in] id is the Id of the object whose name we are locating.
644 *  @param[in] name will contain the name of the object, if found.
645 *
646 *  @return This method returns one of the values from the
647 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
648 *          successful or failure.  On success @a name will contain the name of
649 *          the requested object.
650 *
651 *  @note This function currently does not support string names.
652 */
653Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
654  Objects_Id      id,
655  Objects_Name   *name
656);
657
658/**
659 *  This function maps object ids to object control blocks.
660 *  If id corresponds to a local object, then it returns
661 *  the_object control pointer which maps to id and location
662 *  is set to OBJECTS_LOCAL.  If the object class supports global
663 *  objects and the object id is global and resides on a remote
664 *  node, then location is set to OBJECTS_REMOTE, and the_object
665 *  is undefined.  Otherwise, location is set to OBJECTS_ERROR
666 *  and the_object is undefined.
667 *
668 *  @param[in] information points to an object class information block.
669 *  @param[in] id is the Id of the object whose name we are locating.
670 *  @param[in] location will contain an indication of success or failure.
671 *
672 *  @return This method returns one of the values from the
673 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
674 *          successful or failure.  On success @a id will contain the Id of
675 *          the requested object.
676 *
677 *  @note _Objects_Get returns with dispatching disabled for
678 *  local and remote objects.  _Objects_Get_isr_disable returns with
679 *  dispatching disabled for remote objects and interrupts for local
680 *  objects.
681 */
682Objects_Control *_Objects_Get (
683  Objects_Information *information,
684  Objects_Id           id,
685  Objects_Locations   *location
686);
687
688/**
689 *  This function maps object ids to object control blocks.
690 *  If id corresponds to a local object, then it returns
691 *  the_object control pointer which maps to id and location
692 *  is set to OBJECTS_LOCAL.  If the object class supports global
693 *  objects and the object id is global and resides on a remote
694 *  node, then location is set to OBJECTS_REMOTE, and the_object
695 *  is undefined.  Otherwise, location is set to OBJECTS_ERROR
696 *  and the_object is undefined.
697 *
698 *  @param[in] information points to an object class information block.
699 *  @param[in] id is the Id of the object whose name we are locating.
700 *  @param[in] location will contain an indication of success or failure.
701 *  @param[in] level is the interrupt level being turned.
702 *
703 *  @return This method returns one of the values from the
704 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
705 *          successful or failure.  On success @a name will contain the name of
706 *          the requested object.
707 *
708 *  @note _Objects_Get returns with dispatching disabled for
709 *  local and remote objects.  _Objects_Get_isr_disable returns with
710 *  dispatching disabled for remote objects and interrupts for local
711 *  objects.
712 */
713Objects_Control *_Objects_Get_isr_disable(
714  Objects_Information *information,
715  Objects_Id           id,
716  Objects_Locations   *location,
717  ISR_Level           *level
718);
719
720/**
721 *  This function maps object index to object control blocks which must.
722 *  be local.  The parameter the_object control pointer which maps to id
723 *  and location is set to OBJECTS_LOCAL.  Otherwise, location is set to
724    OBJECTS_ERROR and the_object is undefined.
725 *
726 *  @param[in] information points to an object class information block.
727 *  @param[in] id is the Id of the object whose name we are locating.
728 *  @param[in] location will contain an indication of success or failure.
729 *
730 *  @return This method returns a pointer to the object associated with ID.
731 *
732 *  @return This method returns one of the values from the
733 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
734 *          successful or failure.  On success @a id will contain the id of
735 *          the requested object.
736 *
737 *  @note _Objects_Get returns with dispatching disabled for
738 *  local and remote objects.  _Objects_Get_isr_disable returns with
739 *  dispatching disabled for remote objects and interrupts for local
740 *  objects.
741 */
742Objects_Control *_Objects_Get_by_index (
743  Objects_Information *information,
744  Objects_Id           id,
745  Objects_Locations   *location
746);
747
748/**
749 *  This function maps object ids to object control blocks.
750 *  If id corresponds to a local object, then it returns
751 *  the_object control pointer which maps to id and location
752 *  is set to OBJECTS_LOCAL.  If the object class supports global
753 *  objects and the object id is global and resides on a remote
754 *  node, then location is set to OBJECTS_REMOTE, and the_object
755 *  is undefined.  Otherwise, location is set to OBJECTS_ERROR
756 *  and the_object is undefined.
757 *
758 *  @param[in] information points to an object class information block.
759 *  @param[in] id is the Id of the object whose name we are locating.
760 *  @param[in] location will contain an indication of success or failure.
761 *
762 *  @return This method returns one of the values from the
763 *          @ref Objects_Name_or_id_lookup_errors enumeration to indicate
764 *          successful or failure.  On success @a id will contain the Id of
765 *          the requested object.
766 *
767 *  @note _Objects_Get returns with dispatching disabled for
768 *  local and remote objects.  _Objects_Get_isr_disable returns with
769 *  dispatching disabled for remote objects and interrupts for local
770 *  objects.
771 */
772Objects_Control *_Objects_Get_no_protection(
773  Objects_Information *information,
774  Objects_Id           id,
775  Objects_Locations   *location
776);
777
778/**
779 *  Like @ref _Objects_Get, but is used to find "next" open object.
780 *
781 *  @param[in] information points to an object class information block.
782 *  @param[in] id is the Id of the object whose name we are locating.
783 *  @param[in] location_p will contain an indication of success or failure.
784 *  @param[in] next_id_p is the Id of the next object we will look at.
785 *
786 *  @return This method returns the pointer to the object located or
787 *          NULL on error.
788 */
789Objects_Control *_Objects_Get_next(
790    Objects_Information *information,
791    Objects_Id           id,
792    Objects_Locations   *location_p,
793    Objects_Id          *next_id_p
794);
795
796/*
797 *  Pieces of object.inl are promoted out to the user
798 */
799
800#include <rtems/score/object.inl>
801#if defined(RTEMS_MULTIPROCESSING)
802#include <rtems/score/objectmp.h>
803#endif
804
805#ifdef __cplusplus
806}
807#endif
808
809#endif
810/* end of include file */
Note: See TracBrowser for help on using the repository browser.