RTEMS 6.1-rc4
Loading...
Searching...
No Matches
objectsposix.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * Copyright (C) 2020 embedded brains GmbH & Co. KG
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_CONFDEFS_OBJECTSPOSIX_H
40#define _RTEMS_CONFDEFS_OBJECTSPOSIX_H
41
42#ifndef __CONFIGURATION_TEMPLATE_h
43#error "Do not include this file directly, use <rtems/confdefs.h> instead"
44#endif
45
46#ifdef CONFIGURE_INIT
47
50#include <rtems/config.h>
51
52#include <limits.h>
53
54#define _Configure_Memory_for_named_objects( _number, _size ) \
55 ( rtems_resource_maximum_per_allocation( _number ) \
56 * _Configure_From_workspace( _POSIX_PATH_MAX + 1 ) )
57
58#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
59 #define CONFIGURE_MAXIMUM_POSIX_KEYS 0
60#endif
61
62#ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
63 #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
64 ( CONFIGURE_MAXIMUM_POSIX_KEYS * \
65 ( CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS ) )
66#endif
67
68#if CONFIGURE_MAXIMUM_POSIX_KEYS > 0 \
69 && CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < CONFIGURE_MAXIMUM_POSIX_KEYS
70 #error "CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS must be greater than or equal to CONFIGURE_MAXIMUM_POSIX_KEYS"
71#endif
72
73#if CONFIGURE_MAXIMUM_POSIX_KEYS == 0 \
74 && CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
75 #warning "If CONFIGURE_MAXIMUM_POSIX_KEYS is zero, then CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS should be zero as well"
76#endif
77
78#if CONFIGURE_MAXIMUM_POSIX_KEYS > 0 || CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
79 #include <rtems/posix/key.h>
80#endif
81
82#if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
83 #include <rtems/posix/mqueue.h>
84#endif
85
86#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
87 #include <rtems/posix/psignal.h>
88#endif
89
90#if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
92#endif
93
94#if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
95 #include <rtems/posix/shm.h>
96#endif
97
98#if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
99 #include <rtems/posix/timer.h>
100#endif
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
106#if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
108#endif
109
110#if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
114 )
115 ];
116
119#endif
120
121#if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
124 );
125
126 #define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES \
127 _Configure_Memory_for_named_objects( \
128 CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, \
129 sizeof( POSIX_Message_queue_Control ) \
130 )
131#else
132 #define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES 0
133#endif
134
135#if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
137
138 #define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES \
139 _Configure_Memory_for_named_objects( \
140 CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, \
141 sizeof( POSIX_Semaphore_Control ) \
142 )
143#else
144 #define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES 0
145#endif
146
147#if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
149
150 #define _CONFIGURE_MEMORY_FOR_POSIX_SHMS \
151 _Configure_Memory_for_named_objects( \
152 CONFIGURE_MAXIMUM_POSIX_SHMS, \
153 sizeof( POSIX_Shm_Control ) \
154 )
155#else
156 #define _CONFIGURE_MEMORY_FOR_POSIX_SHMS 0
157#endif
158
159#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
160 #ifndef RTEMS_POSIX_API
161 #error "CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS must be zero if POSIX API is disabled"
162 #endif
163
164 const uint32_t _POSIX_signals_Maximum_queued_signals =
166
167 POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[
169 ];
170
171 #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
172 _Configure_From_workspace( CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS \
173 * sizeof( POSIX_signals_Siginfo_node ) )
174#else
175 #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
176#endif
177
178#if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
179 #ifndef RTEMS_POSIX_API
180 #error "CONFIGURE_MAXIMUM_POSIX_TIMERS must be zero if POSIX API is disabled"
181 #endif
182
184#endif
185
186#ifdef __cplusplus
187}
188#endif
189
190#define _CONFIGURE_MEMORY_FOR_POSIX_OBJECTS \
191 ( _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES \
192 + _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
193 + _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES \
194 + _CONFIGURE_MEMORY_FOR_POSIX_SHMS )
195
196#endif /* CONFIGURE_INIT */
197
198#endif /* _RTEMS_CONFDEFS_OBJECTSPOSIX_H */
POSIX Timers Internal Support.
#define POSIX_SEMAPHORE_INFORMATION_DEFINE(max)
Macro to define the objects information for the POSIX Semaphore objects.
Definition: semaphore.h:84
#define POSIX_SHM_INFORMATION_DEFINE(max)
Macro to define the objects information for the POSIX Shared Memory objects.
Definition: shm.h:162
#define POSIX_TIMER_INFORMATION_DEFINE(max)
Macro to define the objects information for the POSIX Timer objects.
Definition: timer.h:86
#define POSIX_KEYS_INFORMATION_DEFINE(max)
Macro to define the objects information for the POSIX Key objects.
Definition: key.h:138
POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[]
The initial set of POSIX key and value pairs.
Definition: keyzerokvp.c:34
const uint32_t _POSIX_Keys_Key_value_pair_maximum
The POSIX key and value pairs maximum.
Definition: keyzerokvp.c:36
#define POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE(max)
Macro to define the objects information for the POSIX Message Queue objects.
Definition: mqueue.h:99
#define rtems_resource_maximum_per_allocation(_resource)
Gets the maximum number per allocation of a resource number.
Definition: config.h:890
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
This configuration option is an integer define.
Definition: appl-config.h:4152
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
This configuration option is an integer define.
Definition: appl-config.h:4056
#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
This configuration option is an integer define.
Definition: appl-config.h:4010
#define CONFIGURE_MAXIMUM_POSIX_KEYS
This configuration option is an integer define.
Definition: appl-config.h:3963
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
This configuration option is an integer define.
Definition: appl-config.h:4101
#define CONFIGURE_MAXIMUM_POSIX_TIMERS
This configuration option is an integer define.
Definition: appl-config.h:4300
#define CONFIGURE_MAXIMUM_POSIX_SHMS
This configuration option is an integer define.
Definition: appl-config.h:4197
POSIX Key Private Support.
Internal Information about POSIX Signals.
POSIX Message Queues Private Private Support.
Private Support Information for POSIX Semaphores.
Internal Support for POSIX Shared Memory.
Represents POSIX key and value pair.
Definition: key.h:65
Definition: psignal.h:48
This header file evaluates configuration options related to the thread configuration.
This header file provides support macros to evaluate configuration options related to the RTEMS Works...