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

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.

#define __APPL_SYMBOL(application, symbol)   application ## _ ## symbol
 
#define VTABLE   __attribute__((section(".vtable."))) const
 
#define OS_APPLICATION_MMIO_RANGE(application, from, to)
 
#define OS_APPLICATION_MMIO_RANGES(application, from, to, from2, to2)
 
#define OS_APPLICATION(application)
 Declare userspace process.
 
#define OS_THREAD_CREATE(application, entrypoint, data, priority)
 Thread autostart facility.
 

Macro Definition Documentation

◆ __APPL_SYMBOL

#define __APPL_SYMBOL (   application,
  symbol 
)    application ## _ ## symbol

◆ 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) }\
}
#define __APPL_SYMBOL(application, symbol)
Definition: application.h:20
Static definition of process in firmware image.
Definition: runtime.h:138

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

◆ 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)

◆ OS_THREAD_CREATE

#define OS_THREAD_CREATE (   application,
  entrypoint,
  data,
  priority 
)
Value:
__attribute__((externally_visible, used, section(".thread_create") )) const struct OS_thread_create_t __APPL_SYMBOL(application, thread_create_ ## entrypoint) = {\
&__APPL_SYMBOL(application, instance),\
entrypoint,\
data,\
priority\
}
Structure describing auto-spawned thread.
Definition: runtime.h:172

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