On Wed, Apr 11, 2007 at 09:49:17PM +1000, Alan Garfield wrote: > I've done an acpidump and indeed the are _CRS and _PRS ResourceTemplates > that describe the io and irq requirements perfectly. How do I access > this data? ACPI seems to have very little documentation and nothing else > seems to get resource lists (except fdc_acpi.c and uart_bus_acpi.c which > don't seem to be complete. ACPI_EVALUATE_OBJECT?!?)
In general, you're not supposed to. Use bus_alloc_resource and the bus_space_* functions. busdma was introduced in order to make it possible to write device drivers without having to worry about the specifics of resource allocation / access on any given platform. If it seems like magic, that's because it is. :) For PnP busses like PCI, ISAPnP, and ISA-ACPI/LPC-ACPI, the OS takes care of figuring out what resources to use and allocates them. You only need to specify the type (Memory, IO Port, IRQ) that you want and it takes care of whatever needs to be done for the particular architecture and bus your device is attached to. This means that your driver will work regardless if the resources are specified by ACPI, or if in the future if some mad scientist attaches the hardware to the PCI bus on a SPARC64 instead (with only minimal driver changes). Craig _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"