esp32: Set CPU pointer on app cpu at startup
It's not enough to wait for a switch, lots of things need this early. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
b0b9b3d16a
commit
53eceffb7f
1 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <zephyr.h>
|
||||
#include <kernel_structs.h>
|
||||
#include <soc.h>
|
||||
|
||||
#define _REG(base, off) (*(volatile u32_t *)((base) + (off)))
|
||||
|
||||
|
@ -66,6 +68,13 @@ static void appcpu_entry2(void)
|
|||
__asm__ volatile("wsr.VECBASE %0" : : "r"(start_rec->vecbase));
|
||||
__asm__ volatile("rsync");
|
||||
|
||||
/* Set up the CPU pointer. Really this should be xtensa arch
|
||||
* code, not in the ESP-32 layer
|
||||
*/
|
||||
_cpu_t *cpu = &_kernel.cpus[1];
|
||||
|
||||
__asm__ volatile("wsr.MISC0 %0" : : "r"(cpu));
|
||||
|
||||
*start_rec->alive = 1;
|
||||
start_rec->fn(ps, start_rec->arg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue