cvs commit: src/sys/dev/acpica acpi_ec.c

John Baldwin jhb at FreeBSD.org
Mon Jul 21 20:23:01 PDT 2003


On 21-Jul-2003 Nate Lawson wrote:
> On Mon, 21 Jul 2003, John Baldwin wrote:
>> On 21-Jul-2003 Nate Lawson wrote:
>> > The sequence with ECDT is:
>> > acpi_attach()
>> > acpi_ec_ecdt_probe()
>> >     if ECDT present
>> >        device_add_child("acpi_ec")
>> >        device_probe_and_attach()
>> >            acpi_ec_probe()
>> >                if ECDT magic set in ivars
>> >                   done
>>
>> The magic part seems evil.  I'm not sure yet of a better way to handle
>> that though.
> 
> The reason this was done is that there are two paths for getting resources
> about the EC:  ECDT and namespace.  They can share a common probe/attach
> function if we take the same route (ivars) for passing the data to
> probe/attach.  Since the ivars are zeroed before device_probe() is called
> and an already probed ACPI_DEVICE object is extremely unlikely to use the
> same magic since it's a pointer to the acpi_ec_devclass, this is a low
> risk approach.

I understand the reason for the magic approach, I'm just uncomfortable
with it.  I won't object to it though unless I manage to think of something
cleaner.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the cvs-src mailing list