Back to home page

OSCL-LXR

 
 

    


0001 /******************************************************************************
0002  * hypercall.h
0003  *
0004  * Linux-specific hypervisor handling.
0005  *
0006  * Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Citrix, 2012
0007  *
0008  * This program is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU General Public License version 2
0010  * as published by the Free Software Foundation; or, when distributed
0011  * separately from the Linux kernel or incorporated into other
0012  * software packages, subject to the following license:
0013  *
0014  * Permission is hereby granted, free of charge, to any person obtaining a copy
0015  * of this source file (the "Software"), to deal in the Software without
0016  * restriction, including without limitation the rights to use, copy, modify,
0017  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
0018  * and to permit persons to whom the Software is furnished to do so, subject to
0019  * the following conditions:
0020  *
0021  * The above copyright notice and this permission notice shall be included in
0022  * all copies or substantial portions of the Software.
0023  *
0024  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0025  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0026  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0027  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0028  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0029  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0030  * IN THE SOFTWARE.
0031  */
0032 
0033 #ifndef _ASM_ARM_XEN_HYPERCALL_H
0034 #define _ASM_ARM_XEN_HYPERCALL_H
0035 
0036 #include <linux/bug.h>
0037 
0038 #include <xen/interface/xen.h>
0039 #include <xen/interface/sched.h>
0040 #include <xen/interface/platform.h>
0041 
0042 struct xen_dm_op_buf;
0043 
0044 long privcmd_call(unsigned call, unsigned long a1,
0045         unsigned long a2, unsigned long a3,
0046         unsigned long a4, unsigned long a5);
0047 int HYPERVISOR_xen_version(int cmd, void *arg);
0048 int HYPERVISOR_console_io(int cmd, int count, char *str);
0049 int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count);
0050 int HYPERVISOR_sched_op(int cmd, void *arg);
0051 int HYPERVISOR_event_channel_op(int cmd, void *arg);
0052 unsigned long HYPERVISOR_hvm_op(int op, void *arg);
0053 int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
0054 int HYPERVISOR_physdev_op(int cmd, void *arg);
0055 int HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args);
0056 int HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type);
0057 int HYPERVISOR_dm_op(domid_t domid, unsigned int nr_bufs,
0058              struct xen_dm_op_buf *bufs);
0059 int HYPERVISOR_platform_op_raw(void *arg);
0060 static inline int HYPERVISOR_platform_op(struct xen_platform_op *op)
0061 {
0062     op->interface_version = XENPF_INTERFACE_VERSION;
0063     return HYPERVISOR_platform_op_raw(op);
0064 }
0065 int HYPERVISOR_multicall(struct multicall_entry *calls, uint32_t nr);
0066 
0067 static inline int
0068 HYPERVISOR_suspend(unsigned long start_info_mfn)
0069 {
0070     struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
0071 
0072     /* start_info_mfn is unused on ARM */
0073     return HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
0074 }
0075 
0076 #endif /* _ASM_ARM_XEN_HYPERCALL_H */