arm64: xenvm: Add Xen hypercall interface for arm64
This commit adds Xen hypervisor call interface for arm64 architecture. This is needed for further development of Xen features in Zephyr. Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit is contained in:
parent
bfe9989d9f
commit
c4ab278688
4 changed files with 50 additions and 0 deletions
|
@ -30,3 +30,5 @@ if ((CONFIG_MP_NUM_CPUS GREATER 1) OR (CONFIG_SMP))
|
|||
endif ()
|
||||
|
||||
zephyr_cc_option_ifdef(CONFIG_USERSPACE -mno-outline-atomics)
|
||||
|
||||
add_subdirectory_ifdef(CONFIG_SOC_XENVM xen)
|
||||
|
|
10
arch/arm64/core/xen/CMakeLists.txt
Normal file
10
arch/arm64/core/xen/CMakeLists.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (c) 2021 EPAM Systems
|
||||
|
||||
# Needed to separate definitions in common Xen headers
|
||||
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:-D__ASSEMBLY__>)
|
||||
|
||||
# Xen interface version used in headers for correct definition
|
||||
zephyr_compile_options(-D__XEN_INTERFACE_VERSION__=0x00040e00)
|
||||
|
||||
zephyr_library_sources(hypercall.S)
|
26
arch/arm64/core/xen/hypercall.S
Normal file
26
arch/arm64/core/xen/hypercall.S
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2021 EPAM Systems
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <toolchain.h>
|
||||
#include <linker/sections.h>
|
||||
#include <xen/public/arch-arm.h>
|
||||
#include <xen/public/xen.h>
|
||||
|
||||
#define HYPERCALL(hypercall) \
|
||||
GTEXT(HYPERVISOR_##hypercall); \
|
||||
SECTION_FUNC(TEXT, HYPERVISOR_##hypercall) \
|
||||
mov x16, #__HYPERVISOR_##hypercall; \
|
||||
hvc XEN_HYPERCALL_TAG; \
|
||||
ret;
|
||||
|
||||
_ASM_FILE_PROLOGUE
|
||||
|
||||
HYPERCALL(console_io);
|
||||
HYPERCALL(grant_table_op);
|
||||
HYPERCALL(sched_op);
|
||||
HYPERCALL(event_channel_op);
|
||||
HYPERCALL(hvm_op);
|
||||
HYPERCALL(memory_op);
|
12
include/arch/arm64/hypercall.h
Normal file
12
include/arch/arm64/hypercall.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright (c() 2021 EPAM Systems
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* defined in hypercall.S by HYPERCALL(hypercall) */
|
||||
int HYPERVISOR_console_io(int op, int cnt, char *str);
|
||||
int HYPERVISOR_sched_op(int op, void *param);
|
||||
int HYPERVISOR_event_channel_op(int op, void *param);
|
||||
int HYPERVISOR_hvm_op(int op, void *param);
|
||||
int HYPERVISOR_memory_op(int op, void *param);
|
Loading…
Add table
Add a link
Reference in a new issue