14#pragma clang diagnostic ignored "-Wempty-translation-unit"
19#if defined(__ARM_EABI__)
23#if defined(OS_USE_OS_APP_CONFIG_H)
24#include <cmsis-plus/os-app-config.h>
31#include <cmsis_device.h>
63#if !defined(OS_INCLUDE_STARTUP_GUARD_CHECKS)
64#define OS_BOOL_STARTUP_GUARD_CHECKS (true)
69#if !defined(OS_INCLUDE_STARTUP_INIT_MULTIPLE_RAM_SECTIONS)
89extern unsigned int __data_regions_array_start;
90extern unsigned int __data_regions_array_end;
91extern unsigned int __bss_regions_array_start;
92extern unsigned int __bss_regions_array_end;
97extern unsigned long int __stack;
100main (
int argc,
char* argv[]);
114 unsigned int* region_end);
129inline __attribute__((always_inline))
132 unsigned int* region_end)
136 unsigned int *p = region_begin;
137 while (p < region_end)
143inline __attribute__((always_inline))
149 unsigned int *p = region_begin;
150 while (p < region_end)
171inline __attribute__((always_inline))
178 for (
int i = 0; i < count; i++)
189 for (
int i = 0; i < count; i++)
202 for (
int i = count; i > 0; i--)
213#if defined(DEBUG) && (OS_BOOL_STARTUP_GUARD_CHECKS)
218#define BSS_GUARD_BAD_VALUE (0xCADEBABA)
220static uint32_t
volatile __attribute__ ((section(
".bss_begin")))
222static uint32_t volatile __attribute__ ((section(".bss_end")))
225#define DATA_GUARD_BAD_VALUE (0xCADEBABA)
226#define DATA_BEGIN_GUARD_VALUE (0x12345678)
227#define DATA_END_GUARD_VALUE (0x98765432)
229static uint32_t
volatile __attribute__ ((section(
".data_begin")))
230__data_begin_guard = DATA_BEGIN_GUARD_VALUE;
232static uint32_t volatile __attribute__ ((section(".data_end")))
233__data_end_guard = DATA_END_GUARD_VALUE;
249__attribute__ ((section(
".after_vectors"),noreturn,weak))
271#if defined(DEBUG) && (OS_BOOL_STARTUP_GUARD_CHECKS)
273 __data_begin_guard = DATA_GUARD_BAD_VALUE;
274 __data_end_guard = DATA_GUARD_BAD_VALUE;
278#if !defined(OS_INCLUDE_STARTUP_INIT_MULTIPLE_RAM_SECTIONS)
286 for (
unsigned int* p = &__data_regions_array_start;
287 p < &__data_regions_array_end;)
289 unsigned int* from = (
unsigned int *) (*p++);
290 unsigned int* region_begin = (
unsigned int *) (*p++);
291 unsigned int* region_end = (
unsigned int *) (*p++);
298#if defined(DEBUG) && (OS_BOOL_STARTUP_GUARD_CHECKS)
300 if ((__data_begin_guard != DATA_BEGIN_GUARD_VALUE)
301 || (__data_end_guard != DATA_END_GUARD_VALUE))
311#if defined(DEBUG) && (OS_BOOL_STARTUP_GUARD_CHECKS)
313 __bss_begin_guard = BSS_GUARD_BAD_VALUE;
314 __bss_end_guard = BSS_GUARD_BAD_VALUE;
318#if !defined(OS_INCLUDE_STARTUP_INIT_MULTIPLE_RAM_SECTIONS)
326 for (
unsigned int *p = &__bss_regions_array_start;
327 p < &__bss_regions_array_end;)
329 unsigned int* region_begin = (
unsigned int*) (*p++);
330 unsigned int* region_end = (
unsigned int*) (*p++);
336#if defined(DEBUG) && (OS_BOOL_STARTUP_GUARD_CHECKS)
338 if ((__bss_begin_guard != 0) || (__bss_end_guard != 0))
377#if defined(OS_HAS_INTERRUPTS_STACK)
379 static_cast<size_t> (
386 int code =
main (argc, argv);
396#if !defined(OS_USE_SEMIHOSTING_SYSCALLS)
401#pragma GCC diagnostic push
402#if defined(__clang__)
403#elif defined(__GNUC__)
404#pragma GCC diagnostic ignored "-Wunused-parameter"
416void __attribute__((weak))
424 static char name[] =
"";
430 static char* argv[2] =
439#pragma GCC diagnostic pop
void set(stack::element_t *address, std::size_t size_bytes)
Set the stack address and size.
void os_startup_initialize_free_store(void *heap_address, size_t heap_size_bytes)
Initialise free store.
void os_startup_initialize_hardware_early(void)
Initialise hardware early.
void _start(void)
The standard C application entry point.
void os_startup_initialize_args(int *p_argc, char ***p_argv)
Initialise arguments.
void os_startup_initialize_hardware(void)
Initialise hardware.
class thread::stack * stack(void)
Get the interrupts stack.
Single file µOS++ RTOS definitions.
unsigned long int _Heap_Limit
int main(int argc, char *argv[])
Default implementation of main().
static void os_run_init_array(void)
unsigned int __bss_start__
void(* __fini_array_start[])(void)
static void os_initialize_data(unsigned int *from, unsigned int *region_begin, unsigned int *region_end)
void(* __init_array_start[])(void)
void(* __init_array_end[])(void)
void os_run_fini_array(void)
void(* __fini_array_end[])(void)
static void os_initialize_bss(unsigned int *region_begin, unsigned int *region_end)
void(* __preinit_array_start[])(void)
unsigned long int __stack
void(* __preinit_array_end[])(void)
void trace_initialize(void)
int trace_printf(const char *format,...)
int trace_puts(const char *s)