aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_minios.c
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
commit2e04f9622fa58db6a5f4a1f8242877af25429db6 (patch)
treeb01ae067276a38086508d1e1ef647ed430879478 /tools/libxc/xc_minios.c
parent02e4f47747e6198c834017e5038fa6bf98a0cfeb (diff)
downloadxen-2e04f9622fa58db6a5f4a1f8242877af25429db6.tar.gz
xen-2e04f9622fa58db6a5f4a1f8242877af25429db6.tar.bz2
xen-2e04f9622fa58db6a5f4a1f8242877af25429db6.zip
libxc: osdep: convert do_xen_hypercall()
do_privcmd() was only ever used by do_xen_hypercall() so remove it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_minios.c')
-rw-r--r--tools/libxc/xc_minios.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index d822cf3e47..076605a743 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -71,6 +71,28 @@ void minios_interface_close_fd(int fd)
files[fd].type = FTYPE_NONE;
}
+static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
+{
+ multicall_entry_t call;
+ int i, ret;
+
+ call.op = hypercall->op;
+ for (i = 0; i < sizeof(hypercall->arg) / sizeof(*hypercall->arg); i++)
+ call.args[i] = hypercall->arg[i];
+
+ ret = HYPERVISOR_multicall(&call, 1);
+
+ if (ret < 0) {
+ errno = -ret;
+ return -1;
+ }
+ if ((long) call.result < 0) {
+ errno = - (long) call.result;
+ return -1;
+ }
+ return call.result;
+}
+
void *xc_map_foreign_bulk(xc_interface *xch, uint32_t dom, int prot,
const xen_pfn_t *arr, int *err, unsigned int num)
{
@@ -157,31 +179,13 @@ void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
}
-int do_xen_hypercall(xc_interface *xch, privcmd_hypercall_t *hypercall)
-{
- multicall_entry_t call;
- int i, ret;
-
- call.op = hypercall->op;
- for (i = 0; i < sizeof(hypercall->arg) / sizeof(*hypercall->arg); i++)
- call.args[i] = hypercall->arg[i];
-
- ret = HYPERVISOR_multicall(&call, 1);
-
- if (ret < 0) {
- errno = -ret;
- return -1;
- }
- if ((long) call.result < 0) {
- errno = - (long) call.result;
- return -1;
- }
- return call.result;
-}
-
static struct xc_osdep_ops minios_privcmd_ops = {
.open = &minios_privcmd_open,
.close = &minios_privcmd_close,
+
+ .u.privcmd = {
+ .hypercall = &minios_privcmd_hypercall,
+ },
};
static xc_osdep_handle minios_evtchn_open(xc_evtchn *xce)