RTEMS 6.1-rc2
Loading...
Searching...
No Matches
extensions.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2020 embedded brains GmbH & Co. KG
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_CONFDEFS_EXTENSIONS_H
38#define _RTEMS_CONFDEFS_EXTENSIONS_H
39
40#ifndef __CONFIGURATION_TEMPLATE_h
41#error "Do not include this file directly, use <rtems/confdefs.h> instead"
42#endif
43
44#ifdef CONFIGURE_INIT
45
46#include <rtems/confdefs/bsp.h>
49#include <rtems/sysinit.h>
50
51#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
52 #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
53#endif
54
55#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
56 #include <rtems/extensiondata.h>
57#endif
58
59#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
60 #include <rtems/libcsupport.h>
61#endif
62
63#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
64 #if (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS & (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS - 1)) != 0
65 #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be a power of two"
66 #endif
67
68 #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS < 16
69 #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be at least 16"
70 #endif
71
72 #if defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED) \
73 || defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64) \
74 || defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB)
75 #define _CONFIGURE_RECORD_NEED_EXTENSION
76 #endif
77
79 #include <rtems/record.h>
80#else
81 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
82 #warning "CONFIGURE_RECORD_EXTENSIONS_ENABLED defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
83 #endif
84 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64
85 #warning "CONFIGURE_RECORD_FATAL_DUMP_BASE64 defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
86 #endif
87 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
88 #warning "CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
89 #endif
90#endif
91
92#ifdef CONFIGURE_STACK_CHECKER_ENABLED
93 #include <rtems/stackchk.h>
94#endif
95
96#ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
98#endif
99
100#ifdef __cplusplus
101extern "C" {
102#endif
103
104#if defined(_CONFIGURE_RECORD_NEED_EXTENSION) \
105 || defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) \
106 || defined(CONFIGURE_STACK_CHECKER_ENABLED) \
107 || defined(CONFIGURE_INITIAL_EXTENSIONS) \
108 || defined(BSP_INITIAL_EXTENSION)
110 #ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
111 { .fatal = _Exception_Raise_signal },
112 #endif
113 #ifdef _CONFIGURE_RECORD_NEED_EXTENSION
114 {
115 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
116 _Record_Thread_create,
117 _Record_Thread_start,
118 _Record_Thread_restart,
119 _Record_Thread_delete,
120 _Record_Thread_switch,
121 _Record_Thread_begin,
122 _Record_Thread_exitted,
123 #else
125 #endif
126 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
127 _Record_Fatal_dump_base64_zlib,
128 #elif defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64)
129 _Record_Fatal_dump_base64,
130 #else
131 NULL,
132 #endif
133 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
134 _Record_Thread_terminate
135 #else
136 NULL
137 #endif
138 },
139 #endif
140 #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
141 RTEMS_NEWLIB_EXTENSION,
142 #endif
143 #ifdef CONFIGURE_STACK_CHECKER_ENABLED
145 #endif
146 #ifdef CONFIGURE_INITIAL_EXTENSIONS
148 #endif
149 #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
150 defined(BSP_INITIAL_EXTENSION)
151 BSP_INITIAL_EXTENSION
152 #endif
153 };
154
155 const size_t _User_extensions_Initial_count =
157
160 ];
161
164 RTEMS_SYSINIT_INITIAL_EXTENSIONS,
165 RTEMS_SYSINIT_ORDER_MIDDLE
166 );
167#endif
168
169#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
171#endif
172
173#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
174 typedef struct {
175 Record_Control Control;
176 rtems_record_item Items[ CONFIGURE_RECORD_PER_PROCESSOR_ITEMS ];
177 } Record_Configured_control;
178
179 static Record_Configured_control _Record_Controls[ _CONFIGURE_MAXIMUM_PROCESSORS ];
180
181 const Record_Configuration _Record_Configuration = {
183 &_Record_Controls[ 0 ].Control
184 };
185
187 _Record_Initialize,
188 RTEMS_SYSINIT_RECORD,
189 RTEMS_SYSINIT_ORDER_MIDDLE
190 );
191
192 #ifdef CONFIGURE_RECORD_INTERRUPTS_ENABLED
194 _Record_Interrupt_initialize,
195 RTEMS_SYSINIT_LAST,
196 RTEMS_SYSINIT_ORDER_MIDDLE
197 );
198 #endif
199#endif
200
201#ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
204 RTEMS_SYSINIT_RECORD,
205 RTEMS_SYSINIT_ORDER_LAST
206 );
207#endif
208
209#ifdef __cplusplus
210}
211#endif
212
213#endif /* CONFIGURE_INIT */
214
215#endif /* _RTEMS_CONFDEFS_EXTENSIONS_H */
This header file evaluates configuration options related to the per-CPU configuration.
This header file evaluates configuration options related to the BSP configuration.
This header file provides the interfaces for mapping exceptions to signsls.
void _Exception_Raise_signal(Internal_errors_Source source, bool always_set_to_false, Internal_errors_t code)
Handle an exception frame for the purpose of mapping signals.
Definition: exceptionmapping.c:61
This header file provides data structures used by the implementation and the Application Configuratio...
#define RTEMS_ARRAY_SIZE(_array)
Gets the element count of the array.
Definition: basedefs.h:244
#define RTEMS_SYSINIT_ITEM(handler, module, order)
Creates the system initialization item associated with the handler, module, and order.
Definition: sysinit.h:204
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS
This configuration option is an integer define.
Definition: appl-config.h:835
#define CONFIGURE_RECORD_PER_PROCESSOR_ITEMS
This configuration option is an integer define.
Definition: appl-config.h:1895
#define CONFIGURE_INITIAL_EXTENSIONS
This configuration option is an initializer define.
Definition: appl-config.h:2808
#define EXTENSION_INFORMATION_DEFINE(max)
Macro to define the objects information for the Classic Extensions objects.
Definition: extensiondata.h:74
void _Sysinit_Verbose(void)
Enables a verbose system initialization.
Definition: sysinitverbose.c:154
User_extensions_Switch_control _User_extensions_Initial_switch_controls[]
A spare switch control for each initial user extension.
void _User_extensions_Handler_initialization(void)
Initializes the user extensions handler.
Definition: userext.c:44
const size_t _User_extensions_Initial_count
The count of initial user extensions.
const User_extensions_Table _User_extensions_Initial_extensions[]
The table of initial user extensions.
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
#define RTEMS_STACK_CHECKER_EXTENSION
Stack Checker Extension Set Definition.
Definition: stackchk.h:214
Standard C Library Support.
This header file evaluates configuration options related to the Newlib C Library configuration.
Stack Checker Information.
Definition: record.h:54
Definition: record.h:44
Manages the switch callouts.
Definition: userextdata.h:61
User extension table.
Definition: userext.h:253
This header file provides the API of the System Initialization Support.
This header file provides interfaces of the User Extensions Handler which are only used by the implem...