zephyr/scripts/native_simulator/common/src/include/nsi_main.h
Alberto Escolar Piedras 732b03ced6 native_sim: Update native simulator to latest and align with it
Align with the latest upstream native simulator
4c595794588f9d7f67fcf0fe05c3db02892a00f9
including:

* 4c59579 Makefile: Add option to build native part
* 910f934 Makefile: NSI_EXTRA_INCLUDES option and lots of commentary
* d9bf489 cmd line parsin: Minor header refactoring
* 02f3555 cmd line cleanup: Run as NSI_TASK instead of calling expl.
* 2c88173 Split exit call in two
* 2b989b4 CPU IF change: nsif_cpu0_cleanup() to return int
* e696228 HW scheduler: Add API to get next event time
* ae0e9e8 native irq ctrl: Miscellaneous fixes and improvements
* 3fd84cd NSI_TASK: Add compile check of valid priority
* 7e09fb8 HW events: Change internal storage

And two minor updates to the native_sim board,
to align with this updated version:
* nsif_cpu0_cleanup(void) now must return an int
* We need to explicitly tell the native simulator build we want
  the native components built

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-16 15:05:12 +02:00

41 lines
1.1 KiB
C

/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef NSI_COMMON_SRC_INCL_NSI_MAIN_H
#define NSI_COMMON_SRC_INCL_NSI_MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Like nsi_exit(), do all cleanup required to terminate the
* execution of the native_simulator, but instead of exiting,
* return to the caller what would have been passed to exit()
*
* @param[in] exit_code: Requested exit code to the shell
* Note that other components may have requested a different
* exit code which may have precedence if it was !=0
*
* @returns Code which would have been passed to exit()
*/
int nsi_exit_inner(int exit_code);
/**
* @brief Terminate the execution of the native simulator
*
* @param[in] exit_code: Requested exit code to the shell
* Note that other components may have requested a different
* exit code which may have precedence if it was !=0
*/
void nsi_exit(int exit_code);
#ifdef __cplusplus
}
#endif
#endif /* NSI_COMMON_SRC_INCL_NSI_MAIN_H */