/* This is written in C rather than assembly since, during the port bring up, Zephyr is being booted by the Espressif bootloader. With it, the C stack is already set up.  */
void __app_cpu_start(void)
/* This is written in C rather than assembly since, during the port bring up, Zephyr is being booted by the Espressif bootloader. With it, the C stack is already set up.  */
void __app_cpu_start(void)
{
	extern uint32_t _init_start;
	extern uint32_t _bss_start;
	extern uint32_t _bss_end;
	__asm__ __volatile__ (
		"wsr %0, vecbase"
		:
		: "r"(&_init_start));
	z_bss_zero();
	__asm__ __volatile__ (
		""
		:
		: "g"(&__bss_start)
		: "memory");
	__asm__ __volatile__ (
		"wsr %0, PS"
		:
		: "r"(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE));
	__asm__ volatile("wsr.MISC0 %0; rsync" : : "r"(&_kernel.cpus[0]));
	esp_intr_initialize();
	z_cstart();
	CODE_UNREACHABLE;
}