/* Operating systems may expect to run in non-secure mode. Here we check if we are running in secure mode and switch to non-secure mode if necessary.  */
void switch_to_non_secure_mode(void)
/* Operating systems may expect to run in non-secure mode. Here we check if we are running in secure mode and switch to non-secure mode if necessary.  */
void switch_to_non_secure_mode(void)
{
	static bool is_nonsec;
	struct jmp_buf_data non_secure_jmp;
	if (armv7_boot_nonsec() && !is_nonsec) {
		if (setjmp(&non_secure_jmp))
			return;
		dcache_disable();
		armv7_init_nonsec();
		is_nonsec = true;
		secure_ram_addr(_do_nonsec_entry)(entry_non_secure,
						  (uintptr_t)&non_secure_jmp,
						  0, 0);
	}
}