1 /*
2  * Copyright (c) 2021 KT-Elektronik, Klaucke und Partner GmbH
3  * Copyright (c) 2024 Renesas Electronics Corporation
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief Full C support initialization
10  *
11  *
12  * Initialization of full C support: zero the .bss and call z_cstart().
13  *
14  * Stack is available in this module, but not the global data/bss until their
15  * initialization is performed.
16  */
17 
18 #include <kernel_internal.h>
19 #include <zephyr/kernel.h>
20 #include <zephyr/logging/log.h>
21 #include <zephyr/toolchain.h>
22 #include <zephyr/linker/sections.h>
23 
24 K_KERNEL_PINNED_STACK_ARRAY_DEFINE(z_initialization_process_stacks, CONFIG_MP_MAX_NUM_CPUS,
25 				   CONFIG_INITIALIZATION_STACK_SIZE);
26 /**
27  * @brief Prepare to and run C code
28  *
29  * This routine prepares for the execution of and runs C code.
30  *
31  * @return N/A
32  */
z_prep_c(void)33 void z_prep_c(void)
34 {
35 	z_bss_zero();
36 
37 	z_data_copy();
38 
39 	z_cstart();
40 	CODE_UNREACHABLE;
41 }
42