kernel, esp32: Add _arch_start_cpu API
This is a mostly-internal API to start a secondary system CPU, with an implementation for the ESP-32 "APP" cpu. Exposed in kernel.h because it's plausibly useful for asymmetric MP code managed by an app. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
00f3d2e53a
commit
e717267abf
3 changed files with 217 additions and 0 deletions
|
@ -4341,6 +4341,31 @@ extern void k_mem_domain_remove_thread(k_tid_t thread);
|
|||
*/
|
||||
__syscall void k_str_out(char *c, size_t n);
|
||||
|
||||
/**
|
||||
* @brief 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 initialied 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.
|
||||
*
|
||||
* @param cpu_num Integer number of the CPU
|
||||
* @param stack Stack memory for the CPU
|
||||
* @param sz Stack buffer size, in bytes
|
||||
* @param fn Function to begin running on the CPU. First argument is
|
||||
* an irq_unlock() key.
|
||||
* @param arg Untyped argument to be passed to "fn"
|
||||
*/
|
||||
extern void _arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
|
||||
void (*fn)(int, void *), void *arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue