Skip to content

Commit

Permalink
arch: arm64: init xen in arch_kernel_init()
Browse files Browse the repository at this point in the history
Call xen_enlighten_init() from arch_kernel_init() instead of using
SYS_INIT.

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Jul 9, 2024
1 parent 79c5def commit 00682a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions arch/arm64/core/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
5 changes: 5 additions & 0 deletions arch/arm64/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 00682a0

Please sign in to comment.