Reviewed-by: Nadav Har'El <[email protected]>

--
Nadav Har'El
[email protected]

On Fri, Jan 20, 2017 at 1:04 PM, 'Sergiy Kibrik' via OSv Development <
[email protected]> wrote:

> Signed-off-by: Sergiy Kibrik <[email protected]>
> ---
>  bsd/aarch64/machine/xen/hypercall.h  | 73 ++++++++++++++++++++++++++++++
> ++++++
>  bsd/sys/xen/interface/arch-aarch64.h | 52 +++++++++++++++++++++++++
>  bsd/sys/xen/interface/xen.h          |  2 +
>  3 files changed, 127 insertions(+)
>  create mode 100644 bsd/aarch64/machine/xen/hypercall.h
>  create mode 100644 bsd/sys/xen/interface/arch-aarch64.h
>
> diff --git a/bsd/aarch64/machine/xen/hypercall.h
> b/bsd/aarch64/machine/xen/hypercall.h
> new file mode 100644
> index 0000000..db14d5e
> --- /dev/null
> +++ b/bsd/aarch64/machine/xen/hypercall.h
> @@ -0,0 +1,73 @@
> +/*
> + * Copyright (C) 2017 Sergiy Kibrik <[email protected]>
> + *
> + * This work is open source software, licensed under the terms of the
> + * BSD license as described in the LICENSE file in the top-level
> directory.
> + */
> +
> +#ifndef __MACHINE_XEN_HYPERCALL_H__
> +#define __MACHINE_XEN_HYPERCALL_H__
> +
> +#include <xen/interface/xen.h>
> +
> +#define        ENOXENSYS       38
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +int HYPERVISOR_sched_op(int cmd, void *arg);
> +int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
> +int HYPERVISOR_multicall(multicall_entry_t *call_list, unsigned int
> nr_calls);
> +int HYPERVISOR_event_channel_op(int cmd, void *arg);
> +int HYPERVISOR_xen_version(int cmd, void *arg);
> +int HYPERVISOR_console_io(int cmd, unsigned int count, char *str);
> +int HYPERVISOR_physdev_op(int cmd, void *arg);
> +int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int
> count);
> +int HYPERVISOR_vcpu_op(int cmd, unsigned int vcpuid, void *extra_args);
> +int HYPERVISOR_platform_op_raw(struct xen_platform_op *platform_op);
> +unsigned long HYPERVISOR_hvm_op(int op, void *arg);
> +
> +#ifdef __cplusplus
> +} /* extern "C" */
> +#endif
> +
> +static inline int
> +HYPERVISOR_platform_op(struct xen_platform_op *platform_op)
> +{
> +       platform_op->interface_version = XENPF_INTERFACE_VERSION;
> +       return HYPERVISOR_platform_op_raw(platform_op);
> +}
> +
> +static inline int
> +HYPERVISOR_suspend(unsigned long mfn)
> +{
> +       struct sched_shutdown sched_shutdown = {
> +               .reason = SHUTDOWN_suspend
> +       };
> +
> +       return HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
> +}
> +
> +static inline int
> +HYPERVISOR_sched_op_compat(
> +       int cmd, unsigned long arg)
> +{
> +       abort();
> +}
> +
> +static inline int
> +HYPERVISOR_update_va_mapping(
> +       unsigned long va, uint64_t new_val, unsigned long flags)
> +{
> +       abort();
> +}
> +
> +static inline int
> +HYPERVISOR_mmu_update(
> +       mmu_update_t *req, unsigned int count, unsigned int *success_count,
> +       domid_t domid)
> +{
> +       abort();
> +}
> +#endif /* __MACHINE_XEN_HYPERCALL_H__ */
> diff --git a/bsd/sys/xen/interface/arch-aarch64.h
> b/bsd/sys/xen/interface/arch-aarch64.h
> new file mode 100644
> index 0000000..998cd5e
> --- /dev/null
> +++ b/bsd/sys/xen/interface/arch-aarch64.h
> @@ -0,0 +1,52 @@
> +/*
> + * arch-aarch64.h
> + *
> + * based on arch-x86/xen.h
> + *
> + * Copyright (C) 2017 Sergiy Kibrik <[email protected]>
> + *
> + * This work is open source software, licensed under the terms of the
> + * BSD license as described in the LICENSE file in the top-level
> directory.
> +
> +*/
> +
> +#include "xen.h"
> +
> +#ifndef __XEN_PUBLIC_ARCH_AARCH64_H__
> +#define __XEN_PUBLIC_ARCH_AARCH64_H__
> +
> +#define ___DEFINE_XEN_GUEST_HANDLE(name, type)
>        \
> +       typedef struct { type *p; } __guest_handle_##name
> +
> +#define __DEFINE_XEN_GUEST_HANDLE(name, type)                  \
> +       ___DEFINE_XEN_GUEST_HANDLE(name, type);         \
> +       ___DEFINE_XEN_GUEST_HANDLE(const_##name, const type)
> +
> +#define DEFINE_XEN_GUEST_HANDLE(name)   __DEFINE_XEN_GUEST_HANDLE(name,
> name)
> +#define XEN_GUEST_HANDLE(name) __guest_handle_##name
> +
> +#define __HYPERVISOR_platform_op_raw __HYPERVISOR_platform_op
> +
> +/* Maximum number of virtual CPUs in multi-processor guests. */
> +#define MAX_VIRT_CPUS 1
> +
> +#ifndef __ASSEMBLY__
> +typedef uint64_t xen_pfn_t;
> +#define PRI_xen_pfn "llx"
> +typedef uint64_t xen_ulong_t;
> +#define PRI_xen_ulong "llx"
> +
> +struct arch_vcpu_info {
> +};
> +typedef struct arch_vcpu_info arch_vcpu_info_t;
> +
> +struct arch_shared_info {
> +};
> +
> +typedef struct arch_shared_info arch_shared_info_t;
> +
> +typedef unsigned long xen_callback_t;
> +
> +#endif /* __ASSEMBLY__ */
> +
> +#endif /* __XEN_PUBLIC_ARCH_AARCH64_H__ */
> diff --git a/bsd/sys/xen/interface/xen.h b/bsd/sys/xen/interface/xen.h
> index 4b444b4..ee0bd8e 100644
> --- a/bsd/sys/xen/interface/xen.h
> +++ b/bsd/sys/xen/interface/xen.h
> @@ -33,6 +33,8 @@
>  #include "arch-x86/xen.h"
>  #elif defined(__ia64__)
>  #include "arch-ia64.h"
> +#elif defined(__aarch64__)
> +#include "arch-aarch64.h"
>  #else
>  #error "Unsupported architecture"
>  #endif
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to