1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*
8  * This module exist to provide a basic compatibility shim
9  * from Native simulator components into the POSIX architecture.
10  *
11  * It is a transitional component, intended to facilitate
12  * the migration towards the Native simulator.
13  */
14 
15 #include <zephyr/arch/posix/posix_trace.h>
16 #include <zephyr/toolchain.h>
17 #include "posix_board_if.h"
18 
nsi_print_error_and_exit(const char * format,...)19 void nsi_print_error_and_exit(const char *format, ...)
20 {
21 	va_list variable_args;
22 
23 	va_start(variable_args, format);
24 	posix_vprint_error_and_exit(format, variable_args);
25 	va_end(variable_args);
26 }
27 
nsi_print_warning(const char * format,...)28 void nsi_print_warning(const char *format, ...)
29 {
30 	va_list variable_args;
31 
32 	va_start(variable_args, format);
33 	posix_vprint_warning(format, variable_args);
34 	va_end(variable_args);
35 }
36 
nsi_print_trace(const char * format,...)37 void nsi_print_trace(const char *format, ...)
38 {
39 	va_list variable_args;
40 
41 	va_start(variable_args, format);
42 	posix_vprint_trace(format, variable_args);
43 	va_end(variable_args);
44 }
45 
nsi_exit(int exit_code)46 FUNC_NORETURN void nsi_exit(int exit_code)
47 {
48 	posix_exit(exit_code);
49 	CODE_UNREACHABLE;
50 }
51