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