Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
Typedefs | |
typedef void(* | arch_cpustart_t) (void *data) |
Per-cpu entry function. | |
Functions | |
void | arch_cpu_start (int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) |
Start a numbered CPU on a MP-capable system. | |
bool | arch_cpu_active (int cpu_num) |
Return CPU power status. | |
static struct _cpu * | arch_curr_cpu (void) |
Return the CPU struct for the currently executing CPU. | |
static uint32_t | arch_proc_id (void) |
Processor hardware ID. | |
void | arch_sched_broadcast_ipi (void) |
Broadcast an interrupt to all CPUs. | |
void | arch_sched_directed_ipi (uint32_t cpu_bitmap) |
Direct IPIs to the specified CPUs. | |
int | arch_smp_init (void) |
static unsigned int | arch_num_cpus (void) |
Returns the number of CPUs. | |
typedef void(* arch_cpustart_t) (void *data) |
#include <zephyr/arch/arch_interface.h>
Per-cpu entry function.
data | context parameter, implementation specific |
bool arch_cpu_active | ( | int | cpu_num | ) |
#include <zephyr/arch/arch_interface.h>
Return CPU power status.
cpu_num | Integer number of the CPU |
void arch_cpu_start | ( | int | cpu_num, |
k_thread_stack_t * | stack, | ||
int | sz, | ||
arch_cpustart_t | fn, | ||
void * | arg | ||
) |
#include <zephyr/arch/arch_interface.h>
Start a numbered CPU on a MP-capable system.
This starts and initializes a specific CPU. The main thread on startup is running on CPU zero, other processors are numbered sequentially. On return from this function, the CPU is known to have begun operating and will enter the provided function. Its interrupts will be initialized but disabled such that irq_unlock() with the provided key will work to enable them.
Normally, in SMP mode this function will be called by the kernel initialization and should not be used as a user API. But it is defined here for special-purpose apps which want Zephyr running on one core and to use others for design-specific processing.
cpu_num | Integer number of the CPU |
stack | Stack memory for the CPU |
sz | Stack buffer size, in bytes |
fn | Function to begin running on the CPU. |
arg | Untyped argument to be passed to "fn" |
|
inlinestatic |
#include <zephyr/arch/arch_interface.h>
Return the CPU struct for the currently executing CPU.
|
inlinestatic |
#include <zephyr/arch/arch_interface.h>
Returns the number of CPUs.
For most systems this will be the same as CONFIG_MP_MAX_NUM_CPUS, however some systems may determine this at runtime instead.
|
inlinestatic |
#include <zephyr/arch/arch_interface.h>
Processor hardware ID.
Most multiprocessor architectures have a low-level unique ID value associated with the current CPU that can be retrieved rapidly and efficiently in kernel context. Note that while the numbering of the CPUs is guaranteed to be unique, the values are platform-defined. In particular, they are not guaranteed to match Zephyr's own sequential CPU IDs (even though on some platforms they do).
void arch_sched_broadcast_ipi | ( | void | ) |
#include <zephyr/arch/arch_interface.h>
Broadcast an interrupt to all CPUs.
This will invoke z_sched_ipi() on all other CPUs in the system.
void arch_sched_directed_ipi | ( | uint32_t | cpu_bitmap | ) |
#include <zephyr/arch/arch_interface.h>
Direct IPIs to the specified CPUs.
This will invoke z_sched_ipi() on the CPUs identified by cpu_bitmap.
cpu_bitmap | A bitmap indicating which CPUs need the IPI |
int arch_smp_init | ( | void | ) |
#include <zephyr/arch/arch_interface.h>