C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches
Static initialization

Mechanisms provided for application designer to statically initialize objects. More...

Detailed Description

Mechanisms provided for application designer to statically initialize objects.

These mechanisms are provided, so that various structures are generated into application image. These replace need to call os routines manually. Currently it is possible to statically initialize processes and threads.

Macro Definition Documentation

◆ OS_APPLICATION

#define OS_APPLICATION (   application)
Value:
extern void * __APPL_SYMBOL(application, data_start);\
extern void * __APPL_SYMBOL(application, data_end);\
extern void * __APPL_SYMBOL(application, bss_start);\
extern void * __APPL_SYMBOL(application, bss_end);\
extern void * __APPL_SYMBOL(application, vtable_start);\
extern void * __APPL_SYMBOL(application, vtable_end);\
extern void * __APPL_SYMBOL(application, __mmio_start);\
extern void * __APPL_SYMBOL(application, __mmio_end);\
extern void * __APPL_SYMBOL(application, shared_start);\
extern void * __APPL_SYMBOL(application, shared_end);\
\
__attribute__((externally_visible, used, section(".applications") )) const struct OS_process_definition_t __APPL_SYMBOL(application, instance) = {\
{\
{ &__APPL_SYMBOL(application, data_start), &__APPL_SYMBOL(application, data_end) },\
{ &__APPL_SYMBOL(application, bss_start), &__APPL_SYMBOL(application, bss_end) },\
{ __APPL_SYMBOL(application, mmio_start), __APPL_SYMBOL(application, mmio_end) },\
{ __APPL_SYMBOL(application, mmio_2_start), __APPL_SYMBOL(application, mmio_2_end) },\
{ &__APPL_SYMBOL(application, shared_start), &__APPL_SYMBOL(application, shared_end) }\
},\
{ &__APPL_SYMBOL(application, vtable_start), &__APPL_SYMBOL(application, vtable_end) }\
}
Static definition of process in firmware image.
Definition runtime.h:30

Declare userspace process.

This will create userspace process entry in process table. Process is used to contain information on MPU configuration all threads bound to this process can use.

◆ OS_APPLICATION_MMIO_RANGE

#define OS_APPLICATION_MMIO_RANGE (   application,
  from,
  to 
)
Value:
static void * const __APPL_SYMBOL(application, mmio_start) = (void *) (from);\
static void * const __APPL_SYMBOL(application, mmio_end) = (void *) (to);\
static void * const __APPL_SYMBOL(application, mmio_2_start) = (void *) 0;\
static void * const __APPL_SYMBOL(application, mmio_2_end) = (void *) 0;\
_Static_assert(from == 0 || to == 0 || from % (to - from) == 0, "MMIO range not size-aligned")

◆ OS_APPLICATION_MMIO_RANGES

#define OS_APPLICATION_MMIO_RANGES (   application,
  from,
  to,
  from2,
  to2 
)
Value:
static void * const __APPL_SYMBOL(application, mmio_start) = (void *) (from);\
static void * const __APPL_SYMBOL(application, mmio_end) = (void *) (to);\
static void * const __APPL_SYMBOL(application, mmio_2_start) = (void *) (from2);\
static void * const __APPL_SYMBOL(application, mmio_2_end) = (void *) (to2);\
_Static_assert(from == 0 || to == 0 || from % (to - from) == 0, "MMIO range 1 not size-aligned");\
_Static_assert(from == 0 || to == 0 || from2 == 0 || to2 == 0 || from2 % (to2 - from2) == 0, "MMIO range 2 not size-aligned")

◆ OS_THREAD_CREATE

#define OS_THREAD_CREATE (   application,
  entrypoint,
  data,
  priority,
  core 
)     _OS_THREAD_CREATE(application, entrypoint, data, priority, core)

Thread autostart facility.

Use this to automatically create thread upon kernel start. With this you don't need to call thread_create() explicitly. Kernel will create and initialize thread for you.

Parameters
applicationname of process/application you want to bind your thread to.
entrypointentrypoint function name. This function will be given control once thread starts.
datauser-defined data passed to entrypoint function.
prioritythread priority of newly created thread

◆ VTABLE

#define VTABLE   __attribute__((section(".vtable."))) const