Go to the source code of this file.
◆ smp_init_fn
typedef void(* smp_init_fn) (void *arg) |
◆ k_smp_cpu_resume()
void k_smp_cpu_resume |
( |
int | id, |
|
|
smp_init_fn | fn, |
|
|
void * | arg, |
|
|
bool | reinit_timer, |
|
|
bool | invoke_sched ) |
Resume a previously suspended CPU.
This function works like k_smp_cpu_start, but does not re-initialize the kernel's internal tracking data for the target CPU. Therefore, k_smp_cpu_start must have previously been called for the target CPU, and it must have verifiably reached an idle/off state (detection of which must be provided by the platform layers). It may be used in cases where platform layers require, for example, that data on the interrupt or idle stack be preserved.
- Note
- This function must not be used on currently running CPU. The target CPU must be in suspended state, or in certain architectural state(s) where the CPU is permitted to go through the resume process. Detection of such state(s) must be provided by the platform layers.
- Parameters
-
id | ID of target CPU. |
fn | Function to be called before resuming context. |
arg | Argument to fn. |
reinit_timer | True if timer needs to be re-initialized. |
invoke_sched | True if scheduler is invoked after the CPU has started. |
◆ k_smp_cpu_start()
void k_smp_cpu_start |
( |
int | id, |
|
|
smp_init_fn | fn, |
|
|
void * | arg ) |
Start a CPU.
This routine is used to manually start the CPU specified by id. It may be called to restart a CPU that had been stopped or powered down, as well as some other scenario. After the CPU has finished initialization, the CPU will be ready to participate in thread scheduling and execution.
- Note
- This function must not be used on currently running CPU. The target CPU must be in off state, or in certain architectural state(s) where the CPU is permitted to go through the power up process. Detection of such state(s) must be provided by the platform layers.
-
This initializes per-CPU kernel structs and also initializes timers needed for MP operations. Use k_smp_cpu_resume if these are not desired.
- Parameters
-
id | ID of target CPU. |
fn | Function to be called before letting scheduler run. |
arg | Argument to fn. |