diff --git a/arch/arm64/core/xen/enlighten.c b/arch/arm64/core/xen/enlighten.c index 164947a09ffdccb..91bf014b76212e6 100644 --- a/arch/arm64/core/xen/enlighten.c +++ b/arch/arm64/core/xen/enlighten.c @@ -42,7 +42,7 @@ static int xen_map_shared_info(const shared_info_t *shared_page) return HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp); } -static int xen_enlighten_init(void) +int xen_enlighten_init(void) { int ret = 0; shared_info_t *info = (shared_info_t *) shared_info_buf; @@ -66,5 +66,3 @@ static int xen_enlighten_init(void) return 0; } - -SYS_INIT(xen_enlighten_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/arch/arm64/include/kernel_arch_func.h b/arch/arm64/include/kernel_arch_func.h index cc91abc3b49f3f1..d2c346be1f02c34 100644 --- a/arch/arm64/include/kernel_arch_func.h +++ b/arch/arm64/include/kernel_arch_func.h @@ -28,8 +28,13 @@ extern "C" { #ifndef _ASMLANGUAGE +extern void xen_enlighten_init(void); + static ALWAYS_INLINE void arch_kernel_init(void) { +#ifdef CONFIG_XEN + xen_enlighten_init(); +#endif } static inline void arch_switch(void *switch_to, void **switched_from)