Question about resource allocation
Alexey Tarasov
glorgster at gmail.com
Fri Apr 11 05:11:54 UTC 2008
Hi,
I'm trying to update spic and acpi_sony drivers, looking to Linux
sony_laptop driver.
Now I'm at allocating IO ports resource stage.
spic driver on FreeBSD uses bus_alloc_resources() with default for bus
values (0, ~0) for this purpose
----
if (!(sc->port_res = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
&sc->port_rid, 0, ~0, 5, RF_ACTIVE))) {
device_printf(sc->dev,"Couldn't map I/O\n");
return (ENXIO);
}
----
sony_laptop enumerates resources of device using acpi_walk_resources()
function and then calls request_region() for all found IO regions. First non
fail result will be used later in working with SPIC.
So question: is it better to use approach from sony_laptop. If yes, then how
to walk resources (I've not found analog of acpi_walk_resource function in
FreeBSD)
If there is link to any related documentation, it'll be great help.
Thanks.
---
Best regards,
Alexey
More information about the freebsd-acpi
mailing list