aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyve/pci_lpc.c
diff options
context:
space:
mode:
authorTycho Nightingale <tychon@FreeBSD.org>2014-04-18 00:02:06 +0000
committerTycho Nightingale <tychon@FreeBSD.org>2014-04-18 00:02:06 +0000
commit79d6ca331ec02d76c58383803148333576e6ddd8 (patch)
treec6778c6f71b49f2361785e89a6d662a3caa713c1 /usr.sbin/bhyve/pci_lpc.c
parent209579aeac0ac46349f9a1672a75df1eee1adf05 (diff)
downloadsrc-79d6ca331ec02d76c58383803148333576e6ddd8.tar.gz
src-79d6ca331ec02d76c58383803148333576e6ddd8.zip
Add support for reading the PIT Counter 2 output signal via the NMI
Status and Control register at port 0x61. Be more conservative about "catching up" callouts that were supposed to fire in the past by skipping an interrupt if it was scheduled too far in the past. Restore the PIT ACPI DSDT entries and add an entry for NMISC too. Approved by: neel (co-mentor)
Notes
Notes: svn path=/head/; revision=264631
Diffstat (limited to 'usr.sbin/bhyve/pci_lpc.c')
-rw-r--r--usr.sbin/bhyve/pci_lpc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c
index ddeb9bdc0c5b..d50ea89897ab 100644
--- a/usr.sbin/bhyve/pci_lpc.c
+++ b/usr.sbin/bhyve/pci_lpc.c
@@ -55,6 +55,11 @@ SET_DECLARE(lpc_sysres_set, struct lpc_sysres);
#define ELCR_PORT 0x4d0
SYSRES_IO(ELCR_PORT, 2);
+#define IO_TIMER1_PORT 0x40
+
+#define NMISC_PORT 0x61
+SYSRES_IO(NMISC_PORT, 1);
+
static struct pci_devinst *lpc_bridge;
#define LPC_UART_NUM 2
@@ -226,6 +231,19 @@ pci_lpc_write_dsdt(struct pci_devinst *pi)
dsdt_line("}");
dsdt_unindent(1);
+ dsdt_line("");
+ dsdt_line("Device (TIMR)");
+ dsdt_line("{");
+ dsdt_line(" Name (_HID, EisaId (\"PNP0100\"))");
+ dsdt_line(" Name (_CRS, ResourceTemplate ()");
+ dsdt_line(" {");
+ dsdt_indent(2);
+ dsdt_fixed_ioport(IO_TIMER1_PORT, 4);
+ dsdt_fixed_irq(0);
+ dsdt_unindent(2);
+ dsdt_line(" })");
+ dsdt_line("}");
+
dsdt_line("}");
}