zephyr/scripts/native_simulator/common/src/nsi_weak_stubs.c
Alberto Escolar Piedras e3aa649ee0 native simulator: Get latest from upstream
Align with native_simulator's upstream main
64b8be6311a61df2c63987813e8058560c8dc49c

Which includes:
 * 64b8be6 Make: Give option to add extra localization parameters
 * 05bc3ce Generalize code for N CPUs/MCUs
 * 489069b Makefile: Generalize for N embedded images
 * a4c817e runner->embedded trampolines: Improve definitions
 * 8d8dd29 nsi_utils: Provide debracket macro
 * 6b4956e Add optional embedded test hook definition

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-18 10:42:38 +01:00

37 lines
1.3 KiB
C

/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "nsi_cpu_if.h"
#include "nsi_tracing.h"
/*
* Stubbed embedded CPU images, which do nothing:
* The CPU does not boot, and interrupts are just ignored
* These are all defined as weak, so if an actual image is present for that CPU,
* that will be linked against.
*
* This exists in case the total device image is assembled lacking some of the embedded CPU images
*/
static void nsi_boot_warning(const char *func)
{
nsi_print_trace("%s: Attempted boot of CPU without image. "
"CPU shut down permanently\n", func);
}
/*
* These will define N functions like
* int nsif_cpu<n>_cleanup(void) { return 0; }
*/
F_TRAMP_BODY_LIST(__attribute__((weak)) void nsif_cpu, _pre_cmdline_hooks(void) { })
F_TRAMP_BODY_LIST(__attribute__((weak)) void nsif_cpu, _pre_hw_init_hooks(void) { })
F_TRAMP_BODY_LIST(__attribute__((weak)) void nsif_cpu,
_boot(void) { nsi_boot_warning(__func__); })
F_TRAMP_BODY_LIST(__attribute__((weak)) int nsif_cpu, _cleanup(void) { return 0; })
F_TRAMP_BODY_LIST(__attribute__((weak)) void nsif_cpu, _irq_raised(void) { })
F_TRAMP_BODY_LIST(__attribute__((weak)) void nsif_cpu, _irq_raised_from_sw(void) { })
F_TRAMP_BODY_LIST(__attribute__((weak)) int nsif_cpu, _test_hook(void *p) { return 0; })