Commit 42396735 authored by Anas Nashif's avatar Anas Nashif Committed by Carles Cufi
Browse files

xtensa: introduce prep_c for xtensa



xtensa is the only architecutre doing thing differently and introduces
inconsistency in the init process and dependencies as we attemp to
cleanup init levels and remove misused of SYS_INIT.

Introduce prep_c for this architecture and align with other
architectures.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent 299dddfd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ zephyr_library_sources(
  irq_manage.c
  thread.c
  vector_handlers.c
  prep_c.c
  )

zephyr_library_sources_ifdef(CONFIG_XTENSA_USE_CORE_CRT1 crt1.S)
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
 */

.global __start
.type	z_cstart, @function
.type	z_prep_c, @function


/* Macros to abstract away ABI differences */
@@ -189,6 +189,6 @@ _start:
#endif /* !XCHAL_HAVE_BOOTLOADER */

	/* Enter C domain, never returns from here */
	CALL	z_cstart
	CALL	z_prep_c

	.size	_start, . - _start
+22 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2024 Intel Corporation.
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#include <zephyr/kernel.h>
#include <kernel_internal.h>

extern FUNC_NORETURN void z_cstart(void);

/**
 *
 * @brief Prepare to and run C code
 *
 * This routine prepares for the execution of and runs C code.
 *
 */
void z_prep_c(void)
{
	z_cstart();
	CODE_UNREACHABLE;
}