OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [posix/] [inline/] [rtems/] [posix/] [mqueue.inl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  rtems/posix/mqueue.inl
2
 *
3
 *  This include file contains the static inline implementation of the private
4
 *  inlined routines for POSIX Message Queue.
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.OARcorp.com/rtems/license.html.
12
 *
13
 *  mqueue.inl,v 1.11 2002/04/26 23:39:01 joel Exp
14
 */
15
 
16
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_inl
17
#define __RTEMS_POSIX_MESSAGE_QUEUE_inl
18
 
19
/*PAGE
20
 *
21
 *  _POSIX_Message_queue_Allocate
22
 */
23
 
24
RTEMS_INLINE_ROUTINE
25
  POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
26
{
27
  return (POSIX_Message_queue_Control *)
28
    _Objects_Allocate( &_POSIX_Message_queue_Information );
29
}
30
 
31
/*PAGE
32
 *
33
 *  _POSIX_Message_queue_Allocate_fd
34
 */
35
 
36
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *
37
  _POSIX_Message_queue_Allocate_fd( void )
38
{
39
  return (POSIX_Message_queue_Control_fd *)
40
    _Objects_Allocate( &_POSIX_Message_queue_Information_fds );
41
}
42
 
43
/*PAGE
44
 *
45
 *  _POSIX_Message_queue_Free
46
 */
47
 
48
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
49
  POSIX_Message_queue_Control *the_mq
50
)
51
{
52
  _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object );
53
}
54
 
55
/*PAGE
56
 *
57
 *  _POSIX_Message_queue_Free_fd
58
 */
59
 
60
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd (
61
  POSIX_Message_queue_Control_fd *the_mq_fd
62
)
63
{
64
  _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object );
65
}
66
 
67
/*PAGE
68
 *
69
 *  _POSIX_Message_queue_Namespace_remove
70
 */
71
 
72
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove (
73
  POSIX_Message_queue_Control *the_mq
74
)
75
{
76
  _Objects_Namespace_remove(
77
    &_POSIX_Message_queue_Information, &the_mq->Object );
78
}
79
 
80
/*PAGE
81
 *
82
 *  _POSIX_Message_queue_Get
83
 */
84
 
85
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
86
  Objects_Id         id,
87
  Objects_Locations *location
88
)
89
{
90
  return (POSIX_Message_queue_Control *)
91
    _Objects_Get( &_POSIX_Message_queue_Information, id, location );
92
}
93
 
94
/*PAGE
95
 *
96
 *  _POSIX_Message_queue_Get_fd
97
 */
98
 
99
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
100
  Objects_Id         id,
101
  Objects_Locations *location
102
)
103
{
104
  return (POSIX_Message_queue_Control_fd *)
105
    _Objects_Get( &_POSIX_Message_queue_Information_fds, id, location );
106
}
107
 
108
/*PAGE
109
 *
110
 *  _POSIX_Message_queue_Is_null
111
 */
112
 
113
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
114
  POSIX_Message_queue_Control *the_mq
115
)
116
{
117
  return !the_mq;
118
}
119
 
120
/*PAGE
121
 *
122
 *  _POSIX_Message_queue_Priority_to_core
123
 */
124
 
125
RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
126
  unsigned int priority
127
)
128
{
129
  return priority * -1;
130
}
131
 
132
/*
133
 *  _POSIX_Message_queue_Priority_from_core
134
 *
135
 *  DESCRIPTION:
136
 *
137
 *  XXX
138
 */
139
 
140
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
141
  CORE_message_queue_Submit_types priority
142
)
143
{
144
  /* absolute value without a library dependency */
145
  return ((priority >= 0) ? priority : -priority);
146
}
147
 
148
#endif
149
/*  end of include file */
150
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.