xref: /OK3568_Linux_fs/kernel/include/xen/arm/hypercall.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  * hypercall.h
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Linux-specific hypervisor handling.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Citrix, 2012
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or
9*4882a593Smuzhiyun  * modify it under the terms of the GNU General Public License version 2
10*4882a593Smuzhiyun  * as published by the Free Software Foundation; or, when distributed
11*4882a593Smuzhiyun  * separately from the Linux kernel or incorporated into other
12*4882a593Smuzhiyun  * software packages, subject to the following license:
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a copy
15*4882a593Smuzhiyun  * of this source file (the "Software"), to deal in the Software without
16*4882a593Smuzhiyun  * restriction, including without limitation the rights to use, copy, modify,
17*4882a593Smuzhiyun  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
18*4882a593Smuzhiyun  * and to permit persons to whom the Software is furnished to do so, subject to
19*4882a593Smuzhiyun  * the following conditions:
20*4882a593Smuzhiyun  *
21*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included in
22*4882a593Smuzhiyun  * all copies or substantial portions of the Software.
23*4882a593Smuzhiyun  *
24*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25*4882a593Smuzhiyun  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27*4882a593Smuzhiyun  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28*4882a593Smuzhiyun  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29*4882a593Smuzhiyun  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30*4882a593Smuzhiyun  * IN THE SOFTWARE.
31*4882a593Smuzhiyun  */
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #ifndef _ASM_ARM_XEN_HYPERCALL_H
34*4882a593Smuzhiyun #define _ASM_ARM_XEN_HYPERCALL_H
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun #include <linux/bug.h>
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #include <xen/interface/xen.h>
39*4882a593Smuzhiyun #include <xen/interface/sched.h>
40*4882a593Smuzhiyun #include <xen/interface/platform.h>
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun struct xen_dm_op_buf;
43*4882a593Smuzhiyun 
44*4882a593Smuzhiyun long privcmd_call(unsigned call, unsigned long a1,
45*4882a593Smuzhiyun 		unsigned long a2, unsigned long a3,
46*4882a593Smuzhiyun 		unsigned long a4, unsigned long a5);
47*4882a593Smuzhiyun int HYPERVISOR_xen_version(int cmd, void *arg);
48*4882a593Smuzhiyun int HYPERVISOR_console_io(int cmd, int count, char *str);
49*4882a593Smuzhiyun int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
50*4882a593Smuzhiyun int HYPERVISOR_sched_op(int cmd, void *arg);
51*4882a593Smuzhiyun int HYPERVISOR_event_channel_op(int cmd, void *arg);
52*4882a593Smuzhiyun unsigned long HYPERVISOR_hvm_op(int op, void *arg);
53*4882a593Smuzhiyun int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
54*4882a593Smuzhiyun int HYPERVISOR_physdev_op(int cmd, void *arg);
55*4882a593Smuzhiyun int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
56*4882a593Smuzhiyun int HYPERVISOR_tmem_op(void *arg);
57*4882a593Smuzhiyun int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
58*4882a593Smuzhiyun int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
59*4882a593Smuzhiyun 		     struct xen_dm_op_buf *bufs);
60*4882a593Smuzhiyun int HYPERVISOR_platform_op_raw(void *arg);
HYPERVISOR_platform_op(struct xen_platform_op * op)61*4882a593Smuzhiyun static inline int HYPERVISOR_platform_op(struct xen_platform_op *op)
62*4882a593Smuzhiyun {
63*4882a593Smuzhiyun 	op->interface_version = XENPF_INTERFACE_VERSION;
64*4882a593Smuzhiyun 	return HYPERVISOR_platform_op_raw(op);
65*4882a593Smuzhiyun }
66*4882a593Smuzhiyun int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
67*4882a593Smuzhiyun 
68*4882a593Smuzhiyun static inline int
HYPERVISOR_suspend(unsigned long start_info_mfn)69*4882a593Smuzhiyun HYPERVISOR_suspend(unsigned long start_info_mfn)
70*4882a593Smuzhiyun {
71*4882a593Smuzhiyun 	struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
72*4882a593Smuzhiyun 
73*4882a593Smuzhiyun 	/* start_info_mfn is unused on ARM */
74*4882a593Smuzhiyun 	return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
75*4882a593Smuzhiyun }
76*4882a593Smuzhiyun 
77*4882a593Smuzhiyun static inline void
MULTI_update_va_mapping(struct multicall_entry * mcl,unsigned long va,unsigned int new_val,unsigned long flags)78*4882a593Smuzhiyun MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
79*4882a593Smuzhiyun 			unsigned int new_val, unsigned long flags)
80*4882a593Smuzhiyun {
81*4882a593Smuzhiyun 	BUG();
82*4882a593Smuzhiyun }
83*4882a593Smuzhiyun 
84*4882a593Smuzhiyun static inline void
MULTI_mmu_update(struct multicall_entry * mcl,struct mmu_update * req,int count,int * success_count,domid_t domid)85*4882a593Smuzhiyun MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
86*4882a593Smuzhiyun 		 int count, int *success_count, domid_t domid)
87*4882a593Smuzhiyun {
88*4882a593Smuzhiyun 	BUG();
89*4882a593Smuzhiyun }
90*4882a593Smuzhiyun 
91*4882a593Smuzhiyun #endif /* _ASM_ARM_XEN_HYPERCALL_H */
92