summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pci_lpc.c
diff options
context:
space:
mode:
authortychon <tychon@FreeBSD.org>2014-03-11 16:56:00 +0000
committertychon <tychon@FreeBSD.org>2014-03-11 16:56:00 +0000
commit25c8b61cfd6f390fd191d8f7016a3d6fb37fbdc5 (patch)
tree88da83839b43667193b4f76775f5154fa48167aa /usr.sbin/bhyve/pci_lpc.c
parent537be6292992897fefd4922dc1fe5859d47d0df8 (diff)
downloadFreeBSD-src-25c8b61cfd6f390fd191d8f7016a3d6fb37fbdc5.zip
FreeBSD-src-25c8b61cfd6f390fd191d8f7016a3d6fb37fbdc5.tar.gz
Replace the userspace atpic stub with a more functional vmm.ko model.
New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ can be used to manipulate the pic, and optionally the ioapic, pin state. Reviewed by: jhb, neel Approved by: neel (co-mentor)
Diffstat (limited to 'usr.sbin/bhyve/pci_lpc.c')
-rw-r--r--usr.sbin/bhyve/pci_lpc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c
index 30b0401..0ef9403 100644
--- a/usr.sbin/bhyve/pci_lpc.c
+++ b/usr.sbin/bhyve/pci_lpc.c
@@ -46,9 +46,15 @@ __FBSDID("$FreeBSD$");
#include "pci_lpc.h"
#include "uart_emul.h"
+#define IO_ICU1 0x20
+#define IO_ICU2 0xA0
+
SET_DECLARE(lpc_dsdt_set, struct lpc_dsdt);
SET_DECLARE(lpc_sysres_set, struct lpc_sysres);
+#define ELCR_PORT 0x4d0
+SYSRES_IO(ELCR_PORT, 2);
+
static struct pci_devinst *lpc_bridge;
#define LPC_UART_NUM 2
@@ -100,7 +106,7 @@ lpc_uart_intr_assert(void *arg)
assert(sc->irq >= 0);
- vm_ioapic_pulse_irq(lpc_bridge->pi_vmctx, sc->irq);
+ vm_isa_pulse_irq(lpc_bridge->pi_vmctx, sc->irq, sc->irq);
}
static void
@@ -192,6 +198,20 @@ pci_lpc_write_dsdt(struct pci_devinst *pi)
ldp = *ldpp;
ldp->handler();
}
+
+ dsdt_line("");
+ dsdt_line("Device (PIC)");
+ dsdt_line("{");
+ dsdt_line(" Name (_HID, EisaId (\"PNP0000\"))");
+ dsdt_line(" Name (_CRS, ResourceTemplate ()");
+ dsdt_line(" {");
+ dsdt_indent(2);
+ dsdt_fixed_ioport(IO_ICU1, 2);
+ dsdt_fixed_ioport(IO_ICU2, 2);
+ dsdt_fixed_irq(2);
+ dsdt_unindent(2);
+ dsdt_line(" })");
+ dsdt_line("}");
dsdt_unindent(1);
dsdt_line("}");
OpenPOWER on IntegriCloud