source: rtems/cpukit/include/rtems/config.h @ ad85c00

5
Last change on this file since ad85c00 was ad85c00, checked in by Sebastian Huber <sebastian.huber@…>, on 02/14/20 at 12:48:18

config: Add _Workspace_Is_unified

Move the unified workspace configuration constant out of the
configuration table.

Provide a default definition of the unified workspace constant.

Update #3875.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief Table of User Defined Configuration Parameters
5 *
6 * This include file contains the table of user defined configuration
7 * parameters.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2014.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_CONFIG_H
20#define _RTEMS_CONFIG_H
21
22/*
23 *  Unlimited object support. Changes the configuration table entry for POSIX
24 *  or RTEMS APIs to bounded only by the memory of the work-space.
25 *
26 *  Use the macro to define the resource unlimited before placing in
27 *  the configuration table.
28 */
29
30#include <rtems/score/object.h>
31#include <rtems/score/isr.h>
32#include <rtems/score/memory.h>
33#include <rtems/score/stack.h>
34#include <rtems/score/userextdata.h>
35#include <rtems/score/threadidledata.h>
36#include <rtems/score/watchdogticks.h>
37#include <rtems/score/wkspacedata.h>
38#include <rtems/rtems/config.h>
39#include <rtems/extension.h>
40#if defined(RTEMS_MULTIPROCESSING)
41#include <rtems/rtems/types.h>
42#endif
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48#define RTEMS_UNLIMITED_OBJECTS OBJECTS_UNLIMITED_OBJECTS
49
50#define rtems_resource_unlimited(resource) \
51  ( resource | RTEMS_UNLIMITED_OBJECTS )
52
53#define rtems_resource_is_unlimited(resource) \
54  _Objects_Is_unlimited(resource)
55
56#define rtems_resource_maximum_per_allocation(resource) \
57  _Objects_Maximum_per_allocation(resource)
58
59/**
60 * @copydoc Stack_Allocator_initialize
61 */
62typedef Stack_Allocator_initialize rtems_stack_allocate_init_hook;
63
64/**
65 * @copydoc Stack_Allocator_allocate
66 */
67typedef Stack_Allocator_allocate rtems_stack_allocate_hook;
68
69/**
70 * @copydoc Stack_Allocator_free
71 */
72typedef Stack_Allocator_free rtems_stack_free_hook;
73
74/*
75 *  The following records define the Configuration Table.  The
76 *  information contained in this table is required in all
77 *  RTEMS systems, whether single or multiprocessor.  This
78 *  table primarily defines the following:
79 *
80 *     + location and size of the RTEMS Workspace
81 *     + microseconds per clock tick
82 *     + clock ticks per task timeslice
83 *     + required number of each object type for each API configured
84 */
85typedef struct {
86  #ifdef RTEMS_SMP
87    bool                         smp_enabled;
88  #endif
89
90  #ifdef RTEMS_SMP
91    uint32_t                     maximum_processors;
92  #endif
93} rtems_configuration_table;
94
95/**
96 * This is the configuration table generated by confdefs.h.
97 */
98extern const rtems_configuration_table Configuration;
99
100/*
101 *  Some handy macros to avoid dependencies on either the BSP
102 *  or the exact format of the configuration table.
103 */
104
105#define rtems_configuration_get_unified_work_area() \
106        (_Workspace_Is_unified)
107
108/**
109 * @brief Return if the stack allocator avoids the work space.
110 *
111 * @retval true The stack allocator must not allocate the thread stacks from the
112 * RTEMS Workspace
113 *
114 * @retval false The stack allocator should allocate the thread stacks from the
115 * RTEMS Workspace.
116 */
117#define rtems_configuration_get_stack_allocator_avoids_work_space() \
118  (_Stack_Allocator_avoids_workspace)
119
120uintptr_t rtems_configuration_get_stack_space_size( void );
121
122#define rtems_configuration_get_work_space_size() \
123        (_Workspace_Size + \
124          (rtems_configuration_get_stack_allocator_avoids_work_space() ? \
125            0 : rtems_configuration_get_stack_space_size()))
126
127uint32_t rtems_configuration_get_maximum_extensions( void );
128
129#define rtems_configuration_get_microseconds_per_tick() \
130        (_Watchdog_Microseconds_per_tick)
131#define rtems_configuration_get_milliseconds_per_tick() \
132        (_Watchdog_Microseconds_per_tick / 1000)
133#define rtems_configuration_get_nanoseconds_per_tick() \
134        (_Watchdog_Nanoseconds_per_tick)
135
136#define rtems_configuration_get_ticks_per_timeslice() \
137        (_Watchdog_Ticks_per_timeslice)
138
139#define rtems_configuration_get_idle_task() \
140        (_Thread_Idle_entry)
141
142#define rtems_configuration_get_idle_task_stack_size() \
143        (_Thread_Idle_stack_size)
144
145#define rtems_configuration_get_interrupt_stack_size() \
146        ((size_t) _ISR_Stack_size)
147
148#define rtems_configuration_get_stack_allocate_init_hook() \
149  (_Stack_Allocator_initialize)
150
151#define rtems_configuration_get_stack_allocate_hook() \
152  (_Stack_Allocator_allocate)
153
154#define rtems_configuration_get_stack_free_hook() \
155  (_Stack_Allocator_free)
156
157 /**
158  * This macro assists in accessing the field which indicates whether
159  * RTEMS is responsible for zeroing the Executive Workspace.
160  */
161#define rtems_configuration_get_do_zero_of_workspace() \
162  _Memory_Zero_before_use
163
164#define rtems_configuration_get_number_of_initial_extensions() \
165  ((uint32_t) _User_extensions_Initial_count)
166
167#define rtems_configuration_get_user_extension_table() \
168  (&_User_extensions_Initial_extensions[ 0 ])
169
170#if defined(RTEMS_MULTIPROCESSING)
171  #define rtems_configuration_get_user_multiprocessing_table() \
172    (&_MPCI_Configuration)
173#else
174  #define rtems_configuration_get_user_multiprocessing_table() \
175    NULL
176#endif
177
178/**
179 * @brief Returns true if the SMP mode of operation is enabled, and false
180 * otherwise.
181 *
182 * In uni-processor configurations this is a compile-time constant which
183 * evaluates to false.
184 *
185 * @retval true SMP mode of operation is enabled.
186 * @retval false Otherwise.
187 */
188#ifdef RTEMS_SMP
189  #define rtems_configuration_is_smp_enabled() \
190        (Configuration.smp_enabled)
191#else
192  #define rtems_configuration_is_smp_enabled() \
193        false
194#endif
195
196/**
197 * @brief Returns the configured maximum count of processors.
198 *
199 * The actual number of processors available for the application will be less
200 * than or equal to the configured maximum count of processors.
201 *
202 * On single-processor configurations this is a compile time constant which
203 * evaluates to one.
204 *
205 * @return The configured maximum count of processors.
206 */
207#ifdef RTEMS_SMP
208  #define rtems_configuration_get_maximum_processors() \
209        (Configuration.maximum_processors)
210#else
211  #define rtems_configuration_get_maximum_processors() \
212        1
213#endif
214
215#ifdef __cplusplus
216}
217#endif
218
219#endif
220/* end of include file */
Note: See TracBrowser for help on using the repository browser.