1 /*
2  * Copyright (c) 2016 Intel Corporation
3  * Copyright (c) 2017 Oticon A/S
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #include <zephyr/kernel.h>
9 #include <zephyr/arch/cpu.h>
10 #include <zephyr/kernel_structs.h>
11 #include <zephyr/sys/printk.h>
12 #include <inttypes.h>
13 #include <zephyr/logging/log_ctrl.h>
14 #include <zephyr/arch/posix/posix_soc_if.h>
15 
16 extern void nsi_raise_sigtrap(void);
17 
arch_system_halt(unsigned int reason)18 FUNC_NORETURN void arch_system_halt(unsigned int reason)
19 {
20 	ARG_UNUSED(reason);
21 
22 	if (IS_ENABLED(CONFIG_ARCH_POSIX_TRAP_ON_FATAL)) {
23 		nsi_raise_sigtrap();
24 	}
25 
26 	posix_print_error_and_exit("Exiting due to fatal error\n");
27 	CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
28 }
29