1 | /** |
---|
2 | * @file rtems/posix/mqueue.inl |
---|
3 | */ |
---|
4 | |
---|
5 | /* rtems/posix/mqueue.inl |
---|
6 | * |
---|
7 | * This include file contains the macro 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_MESSAGE_QUEUE_inl |
---|
21 | #define __RTEMS_POSIX_MESSAGE_QUEUE_inl |
---|
22 | |
---|
23 | /* |
---|
24 | * _POSIX_Message_queue_Allocate |
---|
25 | */ |
---|
26 | |
---|
27 | #define _POSIX_Message_queue_Allocate() \ |
---|
28 | (POSIX_Message_queue_Control *) \ |
---|
29 | _Objects_Allocate( &_POSIX_Message_queue_Information ) |
---|
30 | |
---|
31 | /* |
---|
32 | * _POSIX_Message_queue_Allocate_fd |
---|
33 | */ |
---|
34 | |
---|
35 | #define _POSIX_Message_queue_Allocate_fd() \ |
---|
36 | (POSIX_Message_queue_Control_fd *) \ |
---|
37 | _Objects_Allocate( &_POSIX_Message_queue_Information_fds ) |
---|
38 | |
---|
39 | /* |
---|
40 | * _POSIX_Message_queue_Free |
---|
41 | */ |
---|
42 | |
---|
43 | #define _POSIX_Message_queue_Free( _the_mq ) \ |
---|
44 | _Objects_Free( &_POSIX_Message_queue_Information, &(_the_mq)->Object ) |
---|
45 | |
---|
46 | /* |
---|
47 | * _POSIX_Message_queue_Free_fd |
---|
48 | */ |
---|
49 | |
---|
50 | #define _POSIX_Message_queue_Free_fd( _the_mq_fd ) \ |
---|
51 | _Objects_Free( &_POSIX_Message_queue_Information_fds, &(_the_mq_fd)->Object ) |
---|
52 | |
---|
53 | /* |
---|
54 | * _POSIX_Message_queue_Namespace_remove |
---|
55 | */ |
---|
56 | |
---|
57 | #define _POSIX_Message_queue_Namespace_remove( _the_mq ) \ |
---|
58 | _Objects_Namespace_remove( \ |
---|
59 | &_POSIX_Message_queue_Information, &(_the_mq)->Object ) |
---|
60 | |
---|
61 | /* |
---|
62 | * _POSIX_Message_queue_Get |
---|
63 | */ |
---|
64 | |
---|
65 | #define _POSIX_Message_queue_Get( _id, _location ) \ |
---|
66 | (POSIX_Message_queue_Control *) \ |
---|
67 | _Objects_Get( &_POSIX_Message_queue_Information, (_id), (_location) ) |
---|
68 | |
---|
69 | /* |
---|
70 | * _POSIX_Message_queue_Get_fd |
---|
71 | */ |
---|
72 | |
---|
73 | #define _POSIX_Message_queue_Get_fd( _id, _location ) \ |
---|
74 | (POSIX_Message_queue_Control_fd *) \ |
---|
75 | _Objects_Get( &_POSIX_Message_queue_Information_fds, (_id), (_location) ) |
---|
76 | |
---|
77 | /* |
---|
78 | * |
---|
79 | * _POSIX_Message_queue_Is_null |
---|
80 | */ |
---|
81 | |
---|
82 | #define _POSIX_Message_queue_Is_null( _the_mq ) \ |
---|
83 | (!(_the_mq)) |
---|
84 | |
---|
85 | /* |
---|
86 | * |
---|
87 | * _POSIX_Message_queue_Priority_to_core |
---|
88 | */ |
---|
89 | |
---|
90 | #define _POSIX_Message_queue_Priority_to_core( _priority ) \ |
---|
91 | ((_priority) * -1) |
---|
92 | |
---|
93 | /* |
---|
94 | * _POSIX_Message_queue_Priority_from_core |
---|
95 | */ |
---|
96 | |
---|
97 | /* absolute value without a library dependency */ |
---|
98 | #define _POSIX_Message_queue_Priority_from_core( _priority ) \ |
---|
99 | ((((CORE_message_queue_Submit_types)(_priority)) >= 0) ? \ |
---|
100 | (_priority) : \ |
---|
101 | -((CORE_message_queue_Submit_types)(_priority))) |
---|
102 | |
---|
103 | #endif |
---|
104 | /* end of include file */ |
---|
105 | |
---|