Branch data Line data Source code
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/sys/printk.h>
11 : : #include <inttypes.h>
12 : : #include <zephyr/logging/log_ctrl.h>
13 : : #include <zephyr/arch/posix/posix_soc_if.h>
14 : :
15 : : extern void nsi_raise_sigtrap(void);
16 : :
17 : 0 : FUNC_NORETURN void arch_system_halt(unsigned int reason)
18 : : {
19 : 0 : ARG_UNUSED(reason);
20 : :
21 : 0 : if (IS_ENABLED(CONFIG_ARCH_POSIX_TRAP_ON_FATAL)) {
22 : : nsi_raise_sigtrap();
23 : : }
24 : :
25 : 0 : posix_print_error_and_exit("Exiting due to fatal error\n");
26 : : CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
27 : : }
|