aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_misc.c
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-07 13:13:52 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2006-11-07 13:13:52 +0000
commit25f5b0ff1569004165e5dbdf2872f4e7617a5b60 (patch)
treeef3f256ea42e8f4672a9267ed2bb75bb7f75fb98 /tools/libxc/xc_misc.c
parentbcc2aed22acbbe0d319e18f7e06c249c03daf100 (diff)
downloadxen-25f5b0ff1569004165e5dbdf2872f4e7617a5b60.tar.gz
xen-25f5b0ff1569004165e5dbdf2872f4e7617a5b60.tar.bz2
xen-25f5b0ff1569004165e5dbdf2872f4e7617a5b60.zip
[HVM] Replace shared-memory PIC state with a set-irq-level hypercall.
This simplifies the IRQ logic significantly and avoids the bogus hvm_pic_assist() on domain resume path. There is more work to be done here. At least: 1. set-irq-level should really be set-interrupt-wire-level. Wire state needs to be distinguished from PIC (in particular, PIC IRR) state. 2. Hypercalls can be batched in qemu and pushed down in one multicall. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r--tools/libxc/xc_misc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 37c505e2bc..b1924611c3 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -5,6 +5,7 @@
*/
#include "xc_private.h"
+#include <xen/hvm/hvm_op.h>
int xc_readconsolering(int xc_handle,
char **pbuffer,
@@ -89,6 +90,33 @@ int xc_perfc_control(int xc_handle,
return rc;
}
+int xc_hvm_set_irq_level(int xc_handle, domid_t dom, int irq, int level)
+{
+ DECLARE_HYPERCALL;
+ struct xen_hvm_set_irq_level arg;
+ int rc;
+
+ hypercall.op = __HYPERVISOR_hvm_op;
+ hypercall.arg[0] = HVMOP_set_irq_level;
+ hypercall.arg[1] = (unsigned long)&arg;
+
+ arg.domid = dom;
+ arg.irq = irq;
+ arg.level = level;
+
+ if ( mlock(&arg, sizeof(arg)) != 0 )
+ {
+ PERROR("Could not lock memory");
+ return -1;
+ }
+
+ rc = do_xen_hypercall(xc_handle, &hypercall);
+
+ safe_munlock(&arg, sizeof(arg));
+
+ return rc;
+}
+
/*
* Local variables:
* mode: C