source: rtems/cpukit/itron/inline/rtems/itron/mbox.inl @ 27b299d9

4.104.114.84.95
Last change on this file since 27b299d9 was 27b299d9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/21/05 at 07:39:58

New header guards.

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/**
2 * @file rtems/itron/mbox.inl
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _RTEMS_ITRON_MBOX_INL
17#define _RTEMS_ITRON_MBOX_INL
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/*
24 *  _ITRON_Mailbox_Allocate
25 *
26 *  DESCRIPTION:
27 *
28 *  This routine allocates the mailbox associated with the specified
29 *  mailbox ID from the pool of inactive mailboxs.
30 *
31 *  Input parameters:
32 *    mbxid   - id of mailbox to allocate
33 *    status  - pointer to status variable
34 *
35 *  Output parameters:
36 *    returns - pointer to the mailbox control block
37 *    *status - status
38 */
39
40RTEMS_INLINE_ROUTINE ITRON_Mailbox_Control *_ITRON_Mailbox_Allocate(
41  ID   mbxid
42)
43{
44  return (ITRON_Mailbox_Control *)_ITRON_Objects_Allocate_by_index(
45    &_ITRON_Mailbox_Information,
46    mbxid,
47    sizeof(ITRON_Mailbox_Control)
48  );
49}
50
51/*
52 *  _ITRON_Mailbox_Clarify_allocation_id_error
53 *
54 *  This function is invoked when an object allocation ID error
55 *  occurs to determine the specific ITRON error code to return.
56 */
57
58#define _ITRON_Mailbox_Clarify_allocation_id_error( _id ) \
59  _ITRON_Objects_Clarify_allocation_id_error( \
60      &_ITRON_Mailbox_Information, (_id) )
61
62/*
63 *  _ITRON_Mailbox_Clarify_get_id_error
64 *
65 *  This function is invoked when an object get ID error
66 *  occurs to determine the specific ITRON error code to return.
67 */
68
69#define _ITRON_Mailbox_Clarify_get_id_error( _id ) \
70 _ITRON_Objects_Clarify_get_id_error( &_ITRON_Mailbox_Information, (_id) )
71
72/*
73 *  _ITRON_Mailbox_Free
74 *
75 *  DESCRIPTION:
76 *
77 *  This routine frees a mailbox control block to the
78 *  inactive chain of free mailbox control blocks.
79 *
80 *  Input parameters:
81 *    the_mailbox - pointer to mailbox control block
82 *
83 *  Output parameters: NONE
84 */
85
86RTEMS_INLINE_ROUTINE void _ITRON_Mailbox_Free (
87  ITRON_Mailbox_Control *the_mailbox
88)
89{
90  _ITRON_Objects_Free( &_ITRON_Mailbox_Information, &the_mailbox->Object );
91}
92
93/*PAGE
94 *
95 *  _ITRON_Mailbox_Get
96 *
97 *  DESCRIPTION:
98 *
99 *  This function maps mailbox IDs to mailbox control blocks.
100 *  If ID corresponds to a local mailbox, then it returns
101 *  the_mailbox control pointer which maps to ID and location
102 *  is set to OBJECTS_LOCAL.  if the mailbox ID is global and
103 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
104 *  and the_mailbox is undefined.  Otherwise, location is set
105 *  to OBJECTS_ERROR and the_mailbox is undefined.
106 *
107 *  Input parameters:
108 *    id            - ITRON mailbox ID.
109 *    the_location  - pointer to a location variable
110 *
111 *  Output parameters:
112 *    *the_location  - location of the object
113 */
114
115RTEMS_INLINE_ROUTINE ITRON_Mailbox_Control *_ITRON_Mailbox_Get (
116  ID                 id,
117  Objects_Locations *location
118)
119{
120  return (ITRON_Mailbox_Control *)
121    _ITRON_Objects_Get( &_ITRON_Mailbox_Information, id, location );
122}
123
124/*PAGE
125 *
126 *  _ITRON_Mailbox_Is_null
127 *
128 *  This function returns TRUE if the_mailbox is NULL and FALSE otherwise.
129 *
130 *  Input parameters:
131 *    the_mailbox - pointer to mailbox control block
132 *
133 *  Output parameters:
134 *    TRUE  - if the_mailbox is NULL
135 *    FALSE - otherwise
136 */
137
138RTEMS_INLINE_ROUTINE boolean _ITRON_Mailbox_Is_null (
139  ITRON_Mailbox_Control *the_mailbox
140)
141{
142  return ( the_mailbox == NULL );
143}
144
145/* 
146 *  XXX insert inline routines here
147 */
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif
154/* end of include file */
155
Note: See TracBrowser for help on using the repository browser.