ia64/xen-unstable

view tools/libxc/xc_evtchn.c @ 9488:0a6f5527ca4b

[IA64] set itv handoff as masked and enable reading irr[0-3]

Set initial vcpu itv handoff state to mask the timer vector.
This seems to match hardware and makes logical sense from a
spurious interrupt perspective. Enable vcpu_get_irr[0-3]
functions as they seem to work and have the proper backing.
This enables the check_sal_cache_flush() in arch/ia64/kernel.sal.c
to work unmodified, allowing us to remove the Xen changes from
the file (and thus the file from the sparse tree).

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Apr 04 09:39:45 2006 -0600 (2006-04-04)
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 }