ChibiOS  21.6.0
OS Instances
Collaboration diagram for OS Instances:

Detailed Description

OS instances management.

Macros

#define __instance_get_currthread(oip)   (oip)->rlist.current
 Current thread pointer get macro. More...
 
#define __instance_set_currthread(oip, tp)   (oip)->rlist.current = (tp)
 Current thread pointer set macro. More...
 

Functions

static void __idle_thread (void *p)
 This function implements the idle thread infinite loop. More...
 
void chInstanceObjectInit (os_instance_t *oip, const os_instance_config_t *oicp)
 Initializes a system instance. More...
 

Macro Definition Documentation

◆ __instance_get_currthread

#define __instance_get_currthread (   oip)    (oip)->rlist.current

Current thread pointer get macro.

Note
This macro is not meant to be used in the application code but only from within the kernel, use chThdGetSelfX() instead.

Definition at line 56 of file chinstances.h.

◆ __instance_set_currthread

#define __instance_set_currthread (   oip,
  tp 
)    (oip)->rlist.current = (tp)

Current thread pointer set macro.

Definition at line 61 of file chinstances.h.

Function Documentation

◆ __idle_thread()

static void __idle_thread ( void *  p)
static

This function implements the idle thread infinite loop.

The function puts the processor in the lowest power mode capable to serve interrupts.
The priority is internally set to the minimum system value so that this thread is executed only if there are no other ready threads in the system.

Parameters
[in]pthe thread parameter, unused in this scenario

Definition at line 62 of file chinstances.c.

References CH_CFG_IDLE_LOOP_HOOK, and port_wait_for_interrupt().

Here is the call graph for this function:

◆ chInstanceObjectInit()

void chInstanceObjectInit ( os_instance_t oip,
const os_instance_config_t oicp 
)

Initializes a system instance.

Note
The system instance is in I-Lock state after initialization.
Parameters
[out]oippointer to the os_instance_t structure
[in]oicppointer to the os_instance_config_t structure
Function Class:
Special function, this function has special requirements see the notes.

Definition at line 89 of file chinstances.c.

References __dbg_object_init(), __reg_object_init(), __rfcu_object_init(), __stats_object_init(), __thd_object_init(), __trace_object_init(), __vt_object_init(), ch_pqueue_init(), chDbgAssert, ch_os_instance::config, ch_os_instance::core_id, ch_ready_list::current, ch_os_instance::dbg, ch_system::instances, ch_os_instance::kernel_stats, ch_os_instance::mainthread, ch_ready_list::pqueue, ch_os_instance::reglist, ch_os_instance::rfcu, ch_os_instance::rlist, ch_os_instance::trace_buffer, and ch_os_instance::vtlist.

Here is the call graph for this function: