49#ifndef APPLICATION_NAME
50# error "Application header included from something that is not an application!"
53#define CMRX_VTABLE_SECTION_STR3(section_symbol) # section_symbol
54#define CMRX_VTABLE_SECTION_STR2(application_name) CMRX_VTABLE_SECTION_STR3(vtable_ ## application_name)
55#define CMRX_VTABLE_SECTION_STR(application_name) CMRX_VTABLE_SECTION_STR2(application_name)
57#define CMRX_VTABLE_SECTION_START2(application_name) __start_vtable_ ## application_name
58#define CMRX_VTABLE_SECTION_START(application_name) CMRX_VTABLE_SECTION_START2(application_name)
60#define CMRX_VTABLE_SECTION_STOP2(application_name) __stop_vtable_ ## application_name
61#define CMRX_VTABLE_SECTION_STOP(application_name) CMRX_VTABLE_SECTION_STOP2(application_name)
63#define CMRX_VTABLE_SECTION CMRX_VTABLE_SECTION_STR(APPLICATION_NAME)
65# define CMRX_VTABLE_SPECIFIER const
67# define CMRX_VTABLE_SPECIFIER __attribute__((section(CMRX_VTABLE_SECTION))) const
85#define CMRX_APPLICATION_INSTANCE_CONSTRUCTOR(application) \
86void * __APPL_SYMBOL(application, data_start) = (void *) 1;\
87void * __APPL_SYMBOL(application, data_end) = (void *) 1;\
88void * __APPL_SYMBOL(application, bss_start) = (void *) 1;\
89void * __APPL_SYMBOL(application, bss_end) = (void *) 1;\
90void * __APPL_SYMBOL(application, shared_start) = (void *) 1;\
91void * __APPL_SYMBOL(application, shared_end) = (void *) 1;\
92void * __APPL_SYMBOL(application, vtable_start) = (void *) 1;\
93void * __APPL_SYMBOL(application, vtable_end) = (void *) 1;\
95const struct OS_process_definition_t __APPL_SYMBOL(application, instance) = {\
97 { &__APPL_SYMBOL(application, data_start), &__APPL_SYMBOL(application, data_end) },\
98 { &__APPL_SYMBOL(application, bss_start), &__APPL_SYMBOL(application, bss_end) },\
99 { __APPL_SYMBOL(application, mmio_start), __APPL_SYMBOL(application, mmio_end) },\
100 { __APPL_SYMBOL(application, mmio_2_start), __APPL_SYMBOL(application, mmio_2_end) },\
101 { &__APPL_SYMBOL(application, shared_start), &__APPL_SYMBOL(application, shared_end) }\
103 { &CMRX_VTABLE_SECTION_START(application), &CMRX_VTABLE_SECTION_STOP(application) }\
105__attribute__((constructor)) void __APPL_SYMBOL(application, inst_construct)(void)\
107 cmrx_posix_register_application(&__APPL_SYMBOL(application, instance));\
119#define CMRX_THREAD_AUTOCREATE_CONSTRUCTOR(application, entrypoint, data, priority, core) \
120const struct OS_thread_create_t __APPL_SYMBOL(application, thread_create_ ## entrypoint) = {\
121 &__APPL_SYMBOL(application, instance),\
127__attribute__((constructor)) void __APPL_SYMBOL(application, thread_create_ ## entrypoint ## _construct)(void)\
129 cmrx_posix_register_thread(&__APPL_SYMBOL(application, thread_create_ ## entrypoint));\
void cmrx_posix_register_thread(const struct OS_thread_create_t *thread)
Internal routine to register thread with kernel.
Definition static.c:34
void cmrx_posix_register_application(const struct OS_process_definition_t *process)
Internal routine to register application with kernel.
Definition static.c:23
#define CMRX_VTABLE_SECTION_START(application_name)
Definition application.h:58
#define CMRX_VTABLE_SECTION_STOP(application_name)
Definition application.h:61
Static definition of process in firmware image.
Definition runtime.h:31
Structure describing auto-spawned thread.
Definition runtime.h:46