diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-05-01 10:30:22 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-05-01 10:30:22 +0100 |
commit | ca0074e519fdc29c8574356b1ba551c8a1b235bb (patch) | |
tree | 4d65accb82731b261759c982e39a6a4ad78e9fc1 /tools/libxc/xc_private.h | |
parent | 154c5516cb1264c9630f6100b28a7c7ed138430a (diff) | |
download | xen-ca0074e519fdc29c8574356b1ba551c8a1b235bb.tar.gz xen-ca0074e519fdc29c8574356b1ba551c8a1b235bb.tar.bz2 xen-ca0074e519fdc29c8574356b1ba551c8a1b235bb.zip |
MSI 2/6: change the pirq to be per-domain
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Diffstat (limited to 'tools/libxc/xc_private.h')
-rw-r--r-- | tools/libxc/xc_private.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h index b068e45dbe..0570e62dfb 100644 --- a/tools/libxc/xc_private.h +++ b/tools/libxc/xc_private.h @@ -24,10 +24,12 @@ #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall = { 0 } #define DECLARE_DOMCTL struct xen_domctl domctl = { 0 } #define DECLARE_SYSCTL struct xen_sysctl sysctl = { 0 } +#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op = { 0 } #else #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall #define DECLARE_DOMCTL struct xen_domctl domctl #define DECLARE_SYSCTL struct xen_sysctl sysctl +#define DECLARE_PHYSDEV_OP struct physdev_op physdev_op #endif #undef PAGE_SHIFT @@ -96,6 +98,34 @@ static inline int do_xen_version(int xc_handle, int cmd, void *dest) return do_xen_hypercall(xc_handle, &hypercall); } +static inline int do_physdev_op(int xc_handle, int cmd, void *op) +{ + int ret = -1; + + DECLARE_HYPERCALL; + hypercall.op = __HYPERVISOR_physdev_op; + hypercall.arg[0] = (unsigned long) cmd; + hypercall.arg[1] = (unsigned long) op; + + if ( lock_pages(op, sizeof(*op)) != 0 ) + { + PERROR("Could not lock memory for Xen hypercall"); + goto out1; + } + + if ( (ret = do_xen_hypercall(xc_handle, &hypercall)) < 0 ) + { + if ( errno == EACCES ) + DPRINTF("physdev operation failed -- need to" + " rebuild the user-space tool set?\n"); + } + + unlock_pages(op, sizeof(*op)); + +out1: + return ret; +} + static inline int do_domctl(int xc_handle, struct xen_domctl *domctl) { int ret = -1; |