source: rtems/cpukit/posix/inline/rtems/posix/mqueue.inl @ 3507c6df

4.104.115
Last change on this file since 3507c6df was 3507c6df, checked in by Joel Sherrill <joel.sherrill@…>, on 01/05/09 at 20:26:01

2009-01-05 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/gxx_wrappers.c, posix/include/mqueue.h, posix/include/rtems/posix/semaphore.h, posix/inline/rtems/posix/barrier.inl, posix/inline/rtems/posix/key.inl, posix/inline/rtems/posix/mqueue.inl, posix/inline/rtems/posix/rwlock.inl, posix/inline/rtems/posix/semaphore.inl, posix/inline/rtems/posix/spinlock.inl, posix/inline/rtems/posix/timer.inl, posix/src/condget.c, posix/src/mqueuenametoid.c, posix/src/mutexget.c, posix/src/semaphorenametoid.c, posix/src/semopen.c, sapi/src/itronapi.c, sapi/src/posixapi.c: Make changes necessary for all tests to run on SPARC with 16-bit Ids. This required ensuring that all POSIX and compilering binding code makes a distinction between the public Id type (e.g. pthread_t, etc.) and the RTEMS Object_Id type. All POSIX Object Get routines should not take the POSIX Id type as the argument. Sixteen bit RTEMS Ids should be placed into the 32-bits reserved by the POSIX API type in a uniform manner now. This removed all assumptions that the external Id types in POSIX and ITRON are the same as the internal Object Id type.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/**
2 * @file rtems/posix/mqueue.inl
3 */
4
5/*  rtems/posix/mqueue.inl
6 *
7 *  This include file contains the static inline implementation of the private
8 *  inlined routines for POSIX Message Queue.
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19 
20#ifndef _RTEMS_POSIX_MQUEUE_H
21# error "Never use <rtems/posix/mqueue.inl> directly; include <rtems/posix/mqueue.h> instead."
22#endif
23
24#ifndef _RTEMS_POSIX_MQUEUE_INL
25#define _RTEMS_POSIX_MQUEUE_INL
26 
27/*PAGE
28 *
29 *  _POSIX_Message_queue_Allocate
30 */
31 
32RTEMS_INLINE_ROUTINE
33  POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
34{
35  return (POSIX_Message_queue_Control *)
36    _Objects_Allocate( &_POSIX_Message_queue_Information );
37}
38 
39/*PAGE
40 *
41 *  _POSIX_Message_queue_Allocate_fd
42 */
43 
44RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *
45  _POSIX_Message_queue_Allocate_fd( void )
46{
47  return (POSIX_Message_queue_Control_fd *)
48    _Objects_Allocate( &_POSIX_Message_queue_Information_fds );
49}
50 
51/*PAGE
52 *
53 *  _POSIX_Message_queue_Free
54 */
55 
56RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
57  POSIX_Message_queue_Control *the_mq
58)
59{
60  _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
61}
62
63/*PAGE
64 *
65 *  _POSIX_Message_queue_Free_fd
66 */
67 
68RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd (
69  POSIX_Message_queue_Control_fd *the_mq_fd
70)
71{
72  _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object );
73}
74
75/*PAGE
76 *
77 *  _POSIX_Message_queue_Namespace_remove
78 */
79 
80RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
81  POSIX_Message_queue_Control *the_mq
82)
83{
84  _Objects_Namespace_remove(
85    &_POSIX_Message_queue_Information, &the_mq->Object );
86}
87 
88/*PAGE
89 *
90 *  _POSIX_Message_queue_Get
91 */
92 
93RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
94  Objects_Id         id,
95  Objects_Locations *location
96)
97{
98  return (POSIX_Message_queue_Control *)
99    _Objects_Get( &_POSIX_Message_queue_Information, id, location );
100}
101 
102/*PAGE
103 *
104 *  _POSIX_Message_queue_Get_fd
105 */
106 
107RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
108  mqd_t              id,
109  Objects_Locations *location
110)
111{
112  return (POSIX_Message_queue_Control_fd *) _Objects_Get(
113    &_POSIX_Message_queue_Information_fds,
114    (Objects_Id)id,
115    location
116  );
117}
118 
119/*PAGE
120 *
121 *  _POSIX_Message_queue_Is_null
122 */
123 
124RTEMS_INLINE_ROUTINE bool _POSIX_Message_queue_Is_null (
125  POSIX_Message_queue_Control *the_mq
126)
127{
128  return !the_mq;
129}
130
131/*PAGE
132 *
133 *  _POSIX_Message_queue_Priority_to_core
134 */
135 
136RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
137  unsigned int priority
138)
139{
140  return priority * -1;
141}
142
143/*
144 *  _POSIX_Message_queue_Priority_from_core
145 *
146 *  DESCRIPTION:
147 *
148 *  XXX
149 */
150 
151RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
152  CORE_message_queue_Submit_types priority
153)
154{
155  /* absolute value without a library dependency */
156  return ((priority >= 0) ? priority : -priority);
157}
158
159#endif
160/*  end of include file */
Note: See TracBrowser for help on using the repository browser.