ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
22#ifndef ICARUS_CONFIG_H
23#define ICARUS_CONFIG_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* ============================================================================
30 * VERSION INFORMATION
31 * ========================================================================= */
32
33#define ICARUS_VERSION_MAJOR 0
34#define ICARUS_VERSION_MINOR 2
35#define ICARUS_VERSION_PATCH 0
36#define ICARUS_VERSION_STRING "0.2.0"
37
38/* ============================================================================
39 * KERNEL CONFIGURATION
40 * ========================================================================= */
41
54#define ICARUS_MAX_TASKS 128
55
61#define ICARUS_MAX_SEMAPHORES 64
62
68#define ICARUS_MAX_MESSAGE_QUEUES 64
69
76#define ICARUS_MAX_MESSAGE_BYTES 512
77
84#define ICARUS_STACK_WORDS 512
85
91#define ICARUS_DATA_WORDS 512
92
97#define ICARUS_TICKS_PER_TASK 50
98
102#define ICARUS_MAX_TASK_NAME_LEN 32
103
/* End of KERNEL_CONFIG */
105
106/* ============================================================================
107 * MEMORY CONFIGURATION
108 * ========================================================================= */
109
121#define ICARUS_USE_DTCM 1
122
128#define ICARUS_USE_ITCM 1
129
/* End of MEMORY_CONFIG */
131
132/* ============================================================================
133 * SECTION PLACEMENT MACROS
134 *
135 * These macros annotate functions and data with their intended memory region.
136 *
137 * Memory region mapping:
138 * ITCM_FUNC → .itcm (hot-path code: handlers, wrappers, context switch)
139 * DTCM_DATA_PRIV → .dtcm_priv (privileged-only kernel data: task_list,
140 * semaphore_list, scheduler state)
141 * DTCM_DATA_OBC → .dtcm_obc (OBC application hot data, unprivileged RW)
142 *
143 * MPU protection:
144 * - ITCM (.itcm): Read-only + Execute for all (Region 0)
145 * * Prevents code modification attacks
146 * * Kernel handlers protected by ARM exception architecture
147 * - DTCM (.dtcm_priv): Privileged-only RW (Region 5, subregions 0-3)
148 * * Kernel data isolated from unprivileged tasks
149 * * Access via SVC call gates only
150 * - DTCM (.dtcm_obc): Full access RW (Region 3, upper 64KB)
151 * * Zero wait-state data for OBC application hot paths
152 * ========================================================================= */
153
154#ifndef HOST_TEST
155# define ITCM_FUNC __attribute__((section(".itcm")))
156# define DTCM_DATA_PRIV __attribute__((section(".dtcm_priv")))
157# define DTCM_DATA_OBC __attribute__((section(".dtcm_obc")))
158# define BKPRAM_DATA __attribute__((section(".ram_d3")))
159#else
160# define ITCM_FUNC
161# define DTCM_DATA_PRIV
162# define DTCM_DATA_OBC
163# define BKPRAM_DATA
164#endif
165
166/* ============================================================================
167 * DEBUG CONFIGURATION
168 * ========================================================================= */
169
179#define ICARUS_ENABLE_ASSERTS 1
180
184#define ICARUS_ENABLE_STATS 0
185
190#define ICARUS_PRINT_BUFFER_BYTES 64
191
195#define ICARUS_MAX_PRINT_RETRIES 4
196
/* End of DEBUG_CONFIG */
198
199/* ============================================================================
200 * DISPLAY CONFIGURATION
201 * ========================================================================= */
202
212#define ICARUS_ENABLE_HEARTBEAT_VIS 1
213
217#define ICARUS_HEARTBEAT_ON_TICKS 437
218
222#define ICARUS_HEARTBEAT_OFF_TICKS 479
223
/* End of DISPLAY_CONFIG */
225
226/* ============================================================================
227 * COMPILE-TIME VALIDATION
228 * ========================================================================= */
229
230#if (ICARUS_STACK_WORDS % 2) != 0
231#error "ICARUS_STACK_WORDS must be even for 8-byte stack alignment (ARM ABI)"
232#endif
233
234#if (ICARUS_PRINT_BUFFER_BYTES > 64)
235#error "ICARUS_PRINT_BUFFER_BYTES must be <= 64 for USB FS CDC packet sizing"
236#endif
237
238#if (ICARUS_MAX_TASKS > 255)
239#error "ICARUS_MAX_TASKS must be <= 255 (uint8_t index)"
240#endif
241
242#ifdef __cplusplus
243}
244#endif
245
246#endif /* ICARUS_CONFIG_H */