source: rtems/cpukit/itron/inline/rtems/itron/msgbuffer.inl @ c4a3f1e

Last change on this file since c4a3f1e was c4a3f1e, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:46:52

2003-09-04 Joel Sherrill <joel@…>

  • include/itron.h, include/itronsys/eventflags.h, include/itronsys/fmempool.h, include/itronsys/intr.h, include/itronsys/mbox.h, include/itronsys/msgbuffer.h, include/itronsys/network.h, include/itronsys/port.h, include/itronsys/semaphore.h, include/itronsys/status.h, include/itronsys/sysmgmt.h, include/itronsys/task.h, include/itronsys/time.h, include/itronsys/types.h, include/itronsys/vmempool.h, include/rtems/itron/config.h, include/rtems/itron/eventflags.h, include/rtems/itron/fmempool.h, include/rtems/itron/intr.h, include/rtems/itron/itronapi.h, include/rtems/itron/mbox.h, include/rtems/itron/msgbuffer.h, include/rtems/itron/network.h, include/rtems/itron/object.h, include/rtems/itron/port.h, include/rtems/itron/semaphore.h, include/rtems/itron/sysmgmt.h, include/rtems/itron/task.h, include/rtems/itron/time.h, include/rtems/itron/vmempool.h, inline/rtems/itron/eventflags.inl, inline/rtems/itron/fmempool.inl, inline/rtems/itron/intr.inl, inline/rtems/itron/mbox.inl, inline/rtems/itron/msgbuffer.inl, inline/rtems/itron/network.inl, inline/rtems/itron/port.inl, inline/rtems/itron/semaphore.inl, inline/rtems/itron/sysmgmt.inl, inline/rtems/itron/task.inl, inline/rtems/itron/time.inl, inline/rtems/itron/vmempool.inl, macros/rtems/itron/eventflags.inl, macros/rtems/itron/fmempool.inl, macros/rtems/itron/intr.inl, macros/rtems/itron/mbox.inl, macros/rtems/itron/msgbuffer.inl, macros/rtems/itron/network.inl, macros/rtems/itron/port.inl, macros/rtems/itron/semaphore.inl, macros/rtems/itron/sysmgmt.inl, macros/rtems/itron/task.inl, macros/rtems/itron/time.inl, macros/rtems/itron/vmempool.inl, src/can_wup.c, src/chg_pri.c, src/cre_mbf.c, src/cre_mbx.c, src/cre_sem.c, src/cre_tsk.c, src/del_mbf.c, src/del_mbx.c, src/del_sem.c, src/del_tsk.c, src/dis_dsp.c, src/ena_dsp.c, src/eventflags.c, src/exd_tsk.c, src/ext_tsk.c, src/fmempool.c, src/frsm_tsk.c, src/get_tid.c, src/itronintr.c, src/itronsem.c, src/itrontime.c, src/mbox.c, src/mboxtranslatereturncode.c, src/msgbuffer.c, src/msgbuffertranslatereturncode.c, src/network.c, src/port.c, src/prcv_mbf.c, src/prcv_mbx.c, src/preq_sem.c, src/psnd_mbf.c, src/rcv_mbf.c, src/rcv_mbx.c, src/ref_mbf.c, src/ref_mbx.c, src/ref_sem.c, src/ref_tsk.c, src/rel_wai.c, src/rot_rdq.c, src/rsm_tsk.c, src/sig_sem.c, src/slp_tsk.c, src/snd_mbf.c, src/snd_mbx.c, src/sta_tsk.c, src/sus_tsk.c, src/sysmgmt.c, src/task.c, src/ter_tsk.c, src/trcv_mbf.c, src/trcv_mbx.c, src/tslp_tsk.c, src/tsnd_mbf.c, src/twai_sem.c, src/vmempool.c, src/wai_sem.c, src/wup_tsk.c: URL for license changed.
  • Property mode set to 100644
File size: 3.8 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1999.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#ifndef __ITRON_MESSAGE_BUFFER_inl_
13#define __ITRON_MESSAGE_BUFFER_inl_
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/*
20 *  _ITRON_Message_buffer_Allocate
21 *
22 *  DESCRIPTION:
23 *
24 *  This routine allocates the message buffer associated with the specified
25 *  message buffer ID from the pool of inactive message buffers.
26 *
27 *  Input parameters:
28 *    mbfid   - id of message buffer to allocate
29 *    status  - pointer to status variable
30 *
31 *  Output parameters:
32 *    returns - pointer to the message buffer control block
33 *    *status - status
34 */
35
36RTEMS_INLINE_ROUTINE ITRON_Message_buffer_Control
37 *_ITRON_Message_buffer_Allocate(
38  ID   mbfid
39)
40{
41  return (ITRON_Message_buffer_Control *)_ITRON_Objects_Allocate_by_index(
42    &_ITRON_Message_buffer_Information,
43    mbfid,
44    sizeof(ITRON_Message_buffer_Control)
45  );
46}
47
48/*
49 *  _ITRON_Message_buffer_Clarify_allocation_id_error
50 *
51 *  This function is invoked when an object allocation ID error
52 *  occurs to determine the specific ITRON error code to return.
53 */
54
55#define _ITRON_Message_buffer_Clarify_allocation_id_error( _id ) \
56  _ITRON_Objects_Clarify_allocation_id_error( \
57      &_ITRON_Message_buffer_Information, (_id) )
58
59/*
60 *  _ITRON_Message_buffer_Clarify_get_id_error
61 *
62 *  This function is invoked when an object get ID error
63 *  occurs to determine the specific ITRON error code to return.
64 */
65
66#define _ITRON_Message_buffer_Clarify_get_id_error( _id ) \
67 _ITRON_Objects_Clarify_get_id_error( &_ITRON_Message_buffer_Information, (_id) )
68
69/*
70 *  _ITRON_Message_buffer_Free
71 *
72 *  DESCRIPTION:
73 *
74 *  This routine frees a message buffer control block to the
75 *  inactive chain of free message buffer control blocks.
76 *
77 *  Input parameters:
78 *    the_message_buffer - pointer to message_buffer control block
79 *
80 *  Output parameters: NONE
81 */
82
83RTEMS_INLINE_ROUTINE void _ITRON_Message_buffer_Free (
84  ITRON_Message_buffer_Control *the_message_buffer
85)
86{
87  _ITRON_Objects_Free(
88    &_ITRON_Message_buffer_Information,
89    &the_message_buffer->Object
90  );
91}
92
93/*PAGE
94 *
95 *  _ITRON_Message_buffer_Get
96 *
97 *  DESCRIPTION:
98 *
99 *  This function maps message buffer IDs to message buffer control blocks.
100 *  If ID corresponds to a local message buffer, then it returns
101 *  the message buffer control pointer which maps to ID and location
102 *  is set to OBJECTS_LOCAL.  if the message buffer ID is global and
103 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
104 *  and the message buffer is undefined.  Otherwise, location is set
105 *  to OBJECTS_ERROR and the message buffer is undefined.
106 *
107 *  Input parameters:
108 *    id            - ITRON message_buffer 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_Message_buffer_Control *_ITRON_Message_buffer_Get (
116  ID                 id,
117  Objects_Locations *location
118)
119{
120  return (ITRON_Message_buffer_Control *)
121    _ITRON_Objects_Get( &_ITRON_Message_buffer_Information, id, location );
122}
123
124/*PAGE
125 *
126 *  _ITRON_Message_buffer_Is_null
127 *
128 *  This function returns TRUE if the_message_buffer is NULL
129 *  and FALSE otherwise.
130 *
131 *  Input parameters:
132 *    the_message_buffer - pointer to message buffer control block
133 *
134 *  Output parameters:
135 *    TRUE  - if the_message_buffer is NULL
136 *    FALSE - otherwise
137 */
138
139RTEMS_INLINE_ROUTINE boolean _ITRON_Message_buffer_Is_null (
140  ITRON_Message_buffer_Control *the_message_buffer
141)
142{
143  return ( the_message_buffer == NULL );
144}
145
146/* 
147 *  XXX insert inline routines here
148 */
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif
155/* end of include file */
156
Note: See TracBrowser for help on using the repository browser.