/* Reset the system. 
This routine resets the processor.  */
void sys_arch_reboot(int type)
/* Reset the system. 
This routine resets the processor.  */
void sys_arch_reboot(int type)
{
	ARG_UNUSED(type);
	extern void z_do_software_reboot(void);
	extern void z_force_exit_one_nested_irq(void);
	__asm__ volatile("cpsie i" :::);
	if ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
		z_do_software_reboot();
	} else {
		__asm__ volatile(
			"ldr r0,  =z_force_exit_one_nested_irq\n\t"
			"bx r0\n\t"
			:::);
	}
}