From 647b92bf0a989dc8e99ced34a4fd33e2e1d6dc96 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 29 Jan 2014 13:35:12 +0000 Subject: 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. --- usr.sbin/bhyve/pit_8254.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'usr.sbin/bhyve/pit_8254.c') 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 +#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); -- cgit v1.1