[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Resources and ACPI
- To: Alan Garfield <alan_(_at_)_fromorbit_(_dot_)_com>
- Subject: Re: Resources and ACPI
- From: takawata_(_at_)_jp_(_dot_)_freebsd_(_dot_)_org
- Date: Wed, 11 Apr 2007 20:48:04 +0900
- Cc: acpi_(_at_)_freebsd_(_dot_)_org, hackers_(_at_)_freebsd_(_dot_)_org
In message <461CC586_(_dot_)_5060507_(_at_)_fromorbit_(_dot_)_com>, Alan Garfield さんいわく:
>takawata_(_at_)_jp_(_dot_)_freebsd_(_dot_)_org wrote:
>>> If the resources are allocated how do I access/see them?
>>
>> sc->sc_rid1 = 0;
>> sc->sc_res1 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &sc->sc_rid,
>RF_ACTIVE);
>> sc->sc_rid2 = 0;
Oops!
sc->sc_rid2 = 1;
>> sc->sc_res2 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &sc->sc_rid,
>RF_ACTIVE);
>> value_af = bus_space_read_8(rman_get_bustag(sc->sc_res2), rman_get_bus
>handle(sc->sc_res2), 1);
>
>Thanks for this, but how does on tell which resources have been
>allocated to which other than manually specifying them with
>bus_alloc_resource()?
Resource manager will do it. Device driver for a PnP aware bus will set
resource location for each device under the bus. At that time, the resource
is not allocated and activated. Then a device driver for a child device
will allocate bus resource. rid parameter tells the order of resource you
want to get.
_______________________________________________
freebsd-hackers_(_at_)_freebsd_(_dot_)_org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe_(_at_)_freebsd_(_dot_)_org"
Visit your host, monkey.org