summaryrefslogtreecommitdiffstats
path: root/lib/libvmmapi
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-11-23 03:56:03 +0000
committerneel <neel@FreeBSD.org>2013-11-23 03:56:03 +0000
commit3b87354d1ea49068db130b4218c016fcc20cb9e2 (patch)
tree7fad39ddd3dfbac97b9f8929b0bd760f2adf73c2 /lib/libvmmapi
parentf19a97b48c8e5307668a5fa8de2acb82337c068c (diff)
downloadFreeBSD-src-3b87354d1ea49068db130b4218c016fcc20cb9e2.zip
FreeBSD-src-3b87354d1ea49068db130b4218c016fcc20cb9e2.tar.gz
Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest. Start using the new API in device models that use edge triggered interrupts: viz. the 8254 timer and the LPC/uart device emulation. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Diffstat (limited to 'lib/libvmmapi')
-rw-r--r--lib/libvmmapi/vmmapi.c11
-rw-r--r--lib/libvmmapi/vmmapi.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index 5ece80b..85b1069 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -419,6 +419,17 @@ vm_ioapic_deassert_irq(struct vmctx *ctx, int irq)
}
int
+vm_ioapic_pulse_irq(struct vmctx *ctx, int irq)
+{
+ struct vm_ioapic_irq ioapic_irq;
+
+ bzero(&ioapic_irq, sizeof(struct vm_ioapic_irq));
+ ioapic_irq.irq = irq;
+
+ return (ioctl(ctx->fd, VM_IOAPIC_PULSE_IRQ, &ioapic_irq));
+}
+
+int
vm_inject_nmi(struct vmctx *ctx, int vcpu)
{
struct vm_nmi vmnmi;
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index c9a2a09..8eaea29 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -69,6 +69,7 @@ int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type,
int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector);
int vm_ioapic_assert_irq(struct vmctx *ctx, int irq);
int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq);
+int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq);
int vm_inject_nmi(struct vmctx *ctx, int vcpu);
int vm_capability_name2type(const char *capname);
const char *vm_capability_type2name(int type);
OpenPOWER on IntegriCloud