Skip to content

Commit a4cf927

Browse files
arch: *: prep_c: remove check for CONFIG_SOC_PREP_HOOK
soc_prep_hook() is always called from z_prep_c() which is implemented as a C function. As such, there is no need to check for the associated CONFIG_SOC_PREP_HOOK since the platform/hooks.h header will define hooks as no-op function-like macros if their associated Kconfig isn't enabled. Remove the Kconfig check from all arch implementations of z_prep_c() and call soc_prep_hook() directly instead, to avoid duplicating the Kconfig check already performed in platform/hooks.h Signed-off-by: Mathieu Choplain <[email protected]>
1 parent 62fe9aa commit a4cf927

File tree

9 files changed

+5
-18
lines changed

9 files changed

+5
-18
lines changed

arch/arc/core/prep_c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ extern void arc_secureshield_init(void);
8484

8585
FUNC_NORETURN void z_prep_c(void)
8686
{
87-
#if defined(CONFIG_SOC_PREP_HOOK)
8887
soc_prep_hook();
89-
#endif
9088

9189
#ifdef CONFIG_ISA_ARCV3
9290
arc_cluster_scm_enable();

arch/arm/core/cortex_a_r/prep_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ extern FUNC_NORETURN void z_cstart(void);
100100
*/
101101
FUNC_NORETURN void z_prep_c(void)
102102
{
103-
#if defined(CONFIG_SOC_PREP_HOOK)
104103
soc_prep_hook();
105-
#endif
104+
106105
/* Initialize tpidruro with our struct _cpu instance address */
107106
write_tpidruro((uintptr_t)&_kernel.cpus[0]);
108107

arch/arm/core/cortex_m/prep_c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ extern FUNC_NORETURN void z_cstart(void);
197197
*/
198198
FUNC_NORETURN void z_prep_c(void)
199199
{
200-
#if defined(CONFIG_SOC_PREP_HOOK)
201200
soc_prep_hook();
202-
#endif
203201

204202
relocate_vector_table();
205203
#if defined(CONFIG_CPU_HAS_FPU)

arch/arm64/core/prep_c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ __weak void z_arm64_mm_init(bool is_primary_core) { }
3535
*/
3636
FUNC_NORETURN void z_prep_c(void)
3737
{
38-
#if defined(CONFIG_SOC_PREP_HOOK)
3938
soc_prep_hook();
40-
#endif
4139

4240
/* Initialize tpidrro_el0 with our struct _cpu instance address */
4341
write_tpidrro_el0((uintptr_t)&_kernel.cpus[0]);

arch/mips/core/prep_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ static void interrupt_init(void)
4747

4848
FUNC_NORETURN void z_prep_c(void)
4949
{
50-
#if defined(CONFIG_SOC_PREP_HOOK)
5150
soc_prep_hook();
52-
#endif
51+
5352
arch_bss_zero();
5453

5554
interrupt_init();

arch/riscv/core/prep_c.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ void soc_interrupt_init(void);
3636

3737
FUNC_NORETURN void z_prep_c(void)
3838
{
39-
#if defined(CONFIG_SOC_PREP_HOOK)
4039
soc_prep_hook();
41-
#endif
4240

4341
arch_bss_zero();
4442
arch_data_copy();

arch/sparc/core/prep_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222

2323
FUNC_NORETURN void z_prep_c(void)
2424
{
25-
#if defined(CONFIG_SOC_PREP_HOOK)
2625
soc_prep_hook();
27-
#endif
26+
2827
arch_data_copy();
2928
#if CONFIG_ARCH_CACHE
3029
arch_cache_init();

arch/x86/core/prep_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ FUNC_NORETURN void z_prep_c(void *arg)
3636
{
3737
x86_boot_arg_t *cpu_arg = arg;
3838

39-
#if defined(CONFIG_SOC_PREP_HOOK)
4039
soc_prep_hook();
41-
#endif
40+
4241
_kernel.cpus[0].nested = 0;
4342

4443
#ifdef CONFIG_MMU

arch/xtensa/core/prep_c.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ BUILD_ASSERT(CONFIG_DCACHE_LINE_SIZE == XCHAL_DCACHE_LINESIZE);
3131
*/
3232
FUNC_NORETURN void z_prep_c(void)
3333
{
34-
#if defined(CONFIG_SOC_PREP_HOOK)
3534
soc_prep_hook();
36-
#endif
35+
3736
#if CONFIG_SOC_HAS_RUNTIME_NUM_CPUS
3837
soc_num_cpus_init();
3938
#endif

0 commit comments

Comments
 (0)