RTEMS 6.1-rc6
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) 2024 Mohamed Hassan <muhammad.hamdy.hassan@gmail.com>
14 * Copyright (C) 2020 embedded brains GmbH & Co. KG
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_CONFDEFS_EXTENSIONS_H
39#define _RTEMS_CONFDEFS_EXTENSIONS_H
40
41#ifndef __CONFIGURATION_TEMPLATE_h
42#error "Do not include this file directly, use <rtems/confdefs.h> instead"
43#endif
44
45#ifdef CONFIGURE_INIT
46
47#include <rtems/confdefs/bsp.h>
50#include <rtems/sysinit.h>
51
52#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
53 #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0
54#endif
55
56#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
57 #include <rtems/extensiondata.h>
58#endif
59
60#ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
61 #include <rtems/libcsupport.h>
62#endif
63
64#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
65 #if (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS & (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS - 1)) != 0
66 #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be a power of two"
67 #endif
68
69 #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS < 16
70 #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be at least 16"
71 #endif
72
73 #if defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED) \
74 || defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64) \
75 || defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB)
76 #define _CONFIGURE_RECORD_NEED_EXTENSION
77 #endif
78
80 #include <rtems/record.h>
81#else
82 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
83 #warning "CONFIGURE_RECORD_EXTENSIONS_ENABLED defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
84 #endif
85 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64
86 #warning "CONFIGURE_RECORD_FATAL_DUMP_BASE64 defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
87 #endif
88 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
89 #warning "CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB defined without CONFIGURE_RECORD_PER_PROCESSOR_ITEMS"
90 #endif
91#endif
92
93#if !defined(CONFIGURE_STACK_CHECKER_ENABLED) && defined(CONFIGURE_STACK_CHECKER_REPORTER)
94 #error "Stack checker is disabled but a custom reporter is configured"
95#endif
96
97#ifdef CONFIGURE_STACK_CHECKER_ENABLED
98 #include <rtems/stackchk.h>
99#endif
100
101#ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
102 #include <rtems/score/exception.h>
103#endif
104
105#ifdef __cplusplus
106extern "C" {
107#endif
108
109#if defined(_CONFIGURE_RECORD_NEED_EXTENSION) \
110 || defined(_CONFIGURE_ENABLE_NEWLIB_REENTRANCY) \
111 || defined(CONFIGURE_STACK_CHECKER_ENABLED) \
112 || defined(CONFIGURE_INITIAL_EXTENSIONS) \
113 || defined(BSP_INITIAL_EXTENSION)
115 #ifdef CONFIGURE_EXCEPTION_TO_SIGNAL_MAPPING
116 { .fatal = _Exception_Raise_signal },
117 #endif
118 #ifdef _CONFIGURE_RECORD_NEED_EXTENSION
119 {
120 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
121 _Record_Thread_create,
122 _Record_Thread_start,
123 _Record_Thread_restart,
124 _Record_Thread_delete,
125 _Record_Thread_switch,
126 _Record_Thread_begin,
127 _Record_Thread_exitted,
128 #else
129 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
130 #endif
131 #ifdef CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB
132 _Record_Fatal_dump_base64_zlib,
133 #elif defined(CONFIGURE_RECORD_FATAL_DUMP_BASE64)
134 _Record_Fatal_dump_base64,
135 #else
136 NULL,
137 #endif
138 #ifdef CONFIGURE_RECORD_EXTENSIONS_ENABLED
139 _Record_Thread_terminate
140 #else
141 NULL
142 #endif
143 },
144 #endif
145 #ifdef _CONFIGURE_ENABLE_NEWLIB_REENTRANCY
146 RTEMS_NEWLIB_EXTENSION,
147 #endif
148 #ifdef CONFIGURE_STACK_CHECKER_ENABLED
150 #endif
151 #ifdef CONFIGURE_INITIAL_EXTENSIONS
153 #endif
154 #if !defined(CONFIGURE_DISABLE_BSP_SETTINGS) && \
155 defined(BSP_INITIAL_EXTENSION)
156 BSP_INITIAL_EXTENSION
157 #endif
158 };
159
160 const size_t _User_extensions_Initial_count =
162
165 ];
166
169 RTEMS_SYSINIT_INITIAL_EXTENSIONS,
170 RTEMS_SYSINIT_ORDER_MIDDLE
171 );
172#endif
173
174#if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
176#endif
177
178#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
179 typedef struct {
180 Record_Control Control;
181 rtems_record_item Items[ CONFIGURE_RECORD_PER_PROCESSOR_ITEMS ];
182 } Record_Configured_control;
183
184 static Record_Configured_control _Record_Controls[ _CONFIGURE_MAXIMUM_PROCESSORS ];
185
186 const Record_Configuration _Record_Configuration = {
188 &_Record_Controls[ 0 ].Control
189 };
190
192 _Record_Initialize,
193 RTEMS_SYSINIT_RECORD,
194 RTEMS_SYSINIT_ORDER_MIDDLE
195 );
196
197 #ifdef CONFIGURE_RECORD_INTERRUPTS_ENABLED
199 _Record_Interrupt_initialize,
200 RTEMS_SYSINIT_LAST,
201 RTEMS_SYSINIT_ORDER_MIDDLE
202 );
203 #endif
204#endif
205
206#ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
209 RTEMS_SYSINIT_RECORD,
210 RTEMS_SYSINIT_ORDER_LAST
211 );
212#endif
213
214#ifdef CONFIGURE_STACK_CHECKER_ENABLED
215 #ifdef CONFIGURE_STACK_CHECKER_REPORTER
217 CONFIGURE_STACK_CHECKER_REPORTER;
218 #else
221 #endif
222#endif
223
224#ifdef __cplusplus
225}
226#endif
227
228#endif /* CONFIGURE_INIT */
229
230#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:2815
#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.
const Stack_checker_Reporter_handler Stack_checker_Reporter
The Stack Checker Reporter Initialization Handler.
void(* Stack_checker_Reporter_handler)(const rtems_tcb *running, bool pattern_ok)
The Stack Checker Reporter Initialization Handler.
Definition: stackchk.h:263
void rtems_stack_checker_reporter_quiet(const rtems_tcb *running, bool pattern_ok)
A Quiet Version of Stack Checker Reporter.
Definition: check.c:312
#define RTEMS_STACK_CHECKER_EXTENSION
Stack Checker Extension Set Definition.
Definition: stackchk.h:241
Standard C Library Support.
This header file evaluates configuration options related to the Newlib C Library configuration.
This header file provides the Stack Checker API.
Definition: record.h:53
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...