ia64/xen-unstable

view tools/libxc/xc_evtchn.c @ 8964:8946b6dcd49e

Fix x86_64 Xen build.

event_callback_cs and failsafe_callback_cs are x86_32 only.

Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
author Ian.Campbell@xensource.com
date Wed Feb 22 17:26:39 2006 +0000 (2006-02-22)
parents f5b119533cc8
children 74ee53209cca
line source
1 /******************************************************************************
2 * xc_evtchn.c
3 *
4 * API for manipulating and accessing inter-domain event channels.
5 *
6 * Copyright (c) 2004, K A Fraser.
7 */
9 #include "xc_private.h"
12 static int do_evtchn_op(int xc_handle, evtchn_op_t *op)
13 {
14 int ret = -1;
15 DECLARE_HYPERCALL;
17 hypercall.op = __HYPERVISOR_event_channel_op;
18 hypercall.arg[0] = (unsigned long)op;
20 if ( mlock(op, sizeof(*op)) != 0 )
21 {
22 PERROR("do_evtchn_op: op mlock failed");
23 goto out;
24 }
26 if ((ret = do_xen_hypercall(xc_handle, &hypercall)) < 0)
27 ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
29 safe_munlock(op, sizeof(*op));
30 out:
31 return ret;
32 }
35 int xc_evtchn_alloc_unbound(int xc_handle,
36 uint32_t dom,
37 uint32_t remote_dom)
38 {
39 int rc;
40 evtchn_op_t op = {
41 .cmd = EVTCHNOP_alloc_unbound,
42 .u.alloc_unbound.dom = (domid_t)dom,
43 .u.alloc_unbound.remote_dom = (domid_t)remote_dom };
45 if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
46 rc = op.u.alloc_unbound.port;
48 return rc;
49 }
52 int xc_evtchn_status(int xc_handle,
53 uint32_t dom,
54 evtchn_port_t port,
55 xc_evtchn_status_t *status)
56 {
57 int rc;
58 evtchn_op_t op = {
59 .cmd = EVTCHNOP_status,
60 .u.status.dom = (domid_t)dom,
61 .u.status.port = port };
63 if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
64 memcpy(status, &op.u.status, sizeof(*status));
66 return rc;
67 }