Change the x86 nexus to support different drivers for different
platforms
John Baldwin
jhb at FreeBSD.org
Fri Mar 7 20:50:08 UTC 2008
Right now the two x86 platforms (i386 and amd64) support two different
platforms (ACPI vs. legacy) via some rather hackish code (legacy checks for
an acpi0 device in its probe routine, etc.). This makes it harder for 3rd
parties to add support for proprietary platforms (such as for some embedded
x86 appliances that run FreeBSD). This patch attempts to address this by
allowing different platforms to provide their own nexus driver. The platform
will do its probe in the nexus probe routine and then add suitable platform
devices under its nexus device. One side effect of this change is that on
x86 any devices that attach to directly to the nexus must be platform
independent (this is already true) if they use identify routines.
So the changes involved are to make the default nexus driver return
BUS_PROBE_GENERIC and for it to explicitly add a legacy0 device in its attach
routine (legacy no longer uses a normal identify routine). The ACPI platform
now uses a custom nexus driver (which inherits from the default) in
acpi_machdep.c which checks for ACPI in its probe routine and explicitly adds
acpi0 in its attach routine. The ACPI bus driver no longer uses a standard
acpi_identify routine, but instead exports a public 'acpi_identify()'
function which serves as a probe routine for the MD nexus drivers to use.
It might be nice, btw to possibly make other x86 platforms (such as xbox
perhaps?) use their own nexus driver, but that can happen as a followup
change later. Patch is at
http://www.FreeBSD.org/~jhb/patches/acpi_nexus_cvs.patch
--
John Baldwin
More information about the freebsd-arch
mailing list