arch: arc: Implement z_arch_system_halt()

"brk" is a break-point instruction which among other things
halts ARC core. As compared to pure halt (which is "flag 1" for ARC)
it is much more convenient as it might be executed from either
secure mode or normal mode (with SecureShield enabled), while "flag"
instruction will raise privilege violation exception if SecureShield
is enabled and we're in "normal" mode.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
This commit is contained in:
Alexey Brodkin 2019-10-16 14:44:16 +03:00 committed by Ioannis Glaropoulos
commit 19d4caaaab

View file

@ -34,3 +34,12 @@ FUNC_NORETURN void z_arch_syscall_oops(void *ssf_ptr)
z_arc_fatal_error(K_ERR_KERNEL_OOPS, ssf_ptr);
CODE_UNREACHABLE;
}
FUNC_NORETURN void z_arch_system_halt(unsigned int reason)
{
ARG_UNUSED(reason);
__asm__("brk");
CODE_UNREACHABLE;
}