18c2ecf20Sopenharmony_ci/******************************************************************************
28c2ecf20Sopenharmony_ci * hypercall.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Linux-specific hypervisor handling.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Citrix, 2012
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or
98c2ecf20Sopenharmony_ci * modify it under the terms of the GNU General Public License version 2
108c2ecf20Sopenharmony_ci * as published by the Free Software Foundation; or, when distributed
118c2ecf20Sopenharmony_ci * separately from the Linux kernel or incorporated into other
128c2ecf20Sopenharmony_ci * software packages, subject to the following license:
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
158c2ecf20Sopenharmony_ci * of this source file (the "Software"), to deal in the Software without
168c2ecf20Sopenharmony_ci * restriction, including without limitation the rights to use, copy, modify,
178c2ecf20Sopenharmony_ci * merge, publish, distribute, sublicense, and/or sell copies of the Software,
188c2ecf20Sopenharmony_ci * and to permit persons to whom the Software is furnished to do so, subject to
198c2ecf20Sopenharmony_ci * the following conditions:
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
228c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
258c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
268c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
278c2ecf20Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
288c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
298c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
308c2ecf20Sopenharmony_ci * IN THE SOFTWARE.
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#ifndef _ASM_ARM_XEN_HYPERCALL_H
348c2ecf20Sopenharmony_ci#define _ASM_ARM_XEN_HYPERCALL_H
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#include <linux/bug.h>
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#include <xen/interface/xen.h>
398c2ecf20Sopenharmony_ci#include <xen/interface/sched.h>
408c2ecf20Sopenharmony_ci#include <xen/interface/platform.h>
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cistruct xen_dm_op_buf;
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_cilong privcmd_call(unsigned call, unsigned long a1,
458c2ecf20Sopenharmony_ci		unsigned long a2, unsigned long a3,
468c2ecf20Sopenharmony_ci		unsigned long a4, unsigned long a5);
478c2ecf20Sopenharmony_ciint HYPERVISOR_xen_version(int cmd, void *arg);
488c2ecf20Sopenharmony_ciint HYPERVISOR_console_io(int cmd, int count, char *str);
498c2ecf20Sopenharmony_ciint HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
508c2ecf20Sopenharmony_ciint HYPERVISOR_sched_op(int cmd, void *arg);
518c2ecf20Sopenharmony_ciint HYPERVISOR_event_channel_op(int cmd, void *arg);
528c2ecf20Sopenharmony_ciunsigned long HYPERVISOR_hvm_op(int op, void *arg);
538c2ecf20Sopenharmony_ciint HYPERVISOR_memory_op(unsigned int cmd, void *arg);
548c2ecf20Sopenharmony_ciint HYPERVISOR_physdev_op(int cmd, void *arg);
558c2ecf20Sopenharmony_ciint HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
568c2ecf20Sopenharmony_ciint HYPERVISOR_tmem_op(void *arg);
578c2ecf20Sopenharmony_ciint HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
588c2ecf20Sopenharmony_ciint HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
598c2ecf20Sopenharmony_ci		     struct xen_dm_op_buf *bufs);
608c2ecf20Sopenharmony_ciint HYPERVISOR_platform_op_raw(void *arg);
618c2ecf20Sopenharmony_cistatic inline int HYPERVISOR_platform_op(struct xen_platform_op *op)
628c2ecf20Sopenharmony_ci{
638c2ecf20Sopenharmony_ci	op->interface_version = XENPF_INTERFACE_VERSION;
648c2ecf20Sopenharmony_ci	return HYPERVISOR_platform_op_raw(op);
658c2ecf20Sopenharmony_ci}
668c2ecf20Sopenharmony_ciint HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cistatic inline int
698c2ecf20Sopenharmony_ciHYPERVISOR_suspend(unsigned long start_info_mfn)
708c2ecf20Sopenharmony_ci{
718c2ecf20Sopenharmony_ci	struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci	/* start_info_mfn is unused on ARM */
748c2ecf20Sopenharmony_ci	return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
758c2ecf20Sopenharmony_ci}
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_cistatic inline void
788c2ecf20Sopenharmony_ciMULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
798c2ecf20Sopenharmony_ci			unsigned int new_val, unsigned long flags)
808c2ecf20Sopenharmony_ci{
818c2ecf20Sopenharmony_ci	BUG();
828c2ecf20Sopenharmony_ci}
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_cistatic inline void
858c2ecf20Sopenharmony_ciMULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
868c2ecf20Sopenharmony_ci		 int count, int *success_count, domid_t domid)
878c2ecf20Sopenharmony_ci{
888c2ecf20Sopenharmony_ci	BUG();
898c2ecf20Sopenharmony_ci}
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#endif /* _ASM_ARM_XEN_HYPERCALL_H */
92