summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pit_8254.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-01-29 13:35:12 +0000
committerjhb <jhb@FreeBSD.org>2014-01-29 13:35:12 +0000
commit647b92bf0a989dc8e99ced34a4fd33e2e1d6dc96 (patch)
treeddf69a1306e432a02088c43f51d6530a00ac3dec /usr.sbin/bhyve/pit_8254.c
parent3e6f6a1694cd4c4265eab094e4a811fc9f1482a2 (diff)
downloadFreeBSD-src-647b92bf0a989dc8e99ced34a4fd33e2e1d6dc96.zip
FreeBSD-src-647b92bf0a989dc8e99ced34a4fd33e2e1d6dc96.tar.gz
MFC 260206:
Rework the DSDT generation code a bit to generate more accurate info about LPC devices. Among other things, the LPC serial ports now appear as ACPI devices.
Diffstat (limited to 'usr.sbin/bhyve/pit_8254.c')
-rw-r--r--usr.sbin/bhyve/pit_8254.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pit_8254.c b/usr.sbin/bhyve/pit_8254.c
index 9ecb565..3eb1aa7 100644
--- a/usr.sbin/bhyve/pit_8254.c
+++ b/usr.sbin/bhyve/pit_8254.c
@@ -42,9 +42,11 @@ __FBSDID("$FreeBSD$");
#include <vmmapi.h>
+#include "acpi.h"
#include "bhyverun.h"
#include "inout.h"
#include "mevent.h"
+#include "pci_lpc.h"
#include "pit_8254.h"
#define TIMER_SEL_MASK 0xc0
@@ -268,3 +270,22 @@ INOUT_PORT(8254, TIMER_MODE, IOPORT_F_OUT, pit_8254_handler);
INOUT_PORT(8254, TIMER_CNTR0, IOPORT_F_INOUT, pit_8254_handler);
INOUT_PORT(8254, TIMER_CNTR1, IOPORT_F_INOUT, pit_8254_handler);
INOUT_PORT(8254, TIMER_CNTR2, IOPORT_F_INOUT, pit_8254_handler);
+
+static void
+pit_dsdt(void)
+{
+
+ 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, 4);
+ dsdt_fixed_irq(0);
+ dsdt_unindent(2);
+ dsdt_line(" })");
+ dsdt_line("}");
+}
+LPC_DSDT(pit_dsdt);
OpenPOWER on IntegriCloud