devices that attach at acpi(4).
Begin deriving an acpi(4) device-detachment hook, acpi_detach(), from
acpi_attach(). The code between #if 0 and #endif still needs to be
turned to the opposite calls (enables to disables, maps to unmaps,
attaches to detaches), which should be run in the opposite order.
Somebody with deep ACPI knowledge can probably finish this off without
too much trouble.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
via ECDT, we would print:
acpiec0 at acpi0 (EC, PHP0C09-0): ACPI Embedded Controller (disabled)
The embedded controller isn't actually disabled, but instead this driver
instance, so change the message to read:
acpiec0 at acpi0 (EC, PHP0C09-0): using acpiecdt0
resources on the same line as autoconf messages. Things like:
pcppi1 at acpi0 (SPKR, PNP0800)
pcppi1: io 0x61
become:
pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
Switch to polling mode after the acpi(4) device has been suspended as
interrupts will be disabled later on and we may still need to execute
AML that tries to sleep or wait on a semaphore.
we will get notified for changes there). Use SME_POLL_ONLY so applications
that use GTREDATA don't cause trouble, and don't use SME_INIT_REFRESH as it
appears to be completely broken.
* No need for sme_refresh callback; GPE handler will tell us when the
device status changed (otherwise we can refresh data up to once a second,
and that can take time!)
* Since sme_refresh callback is gone, mutex is no longer required to
synchronize GPE handlers and refresh thread, so nuke it.
* Don't do any more work in GPE handler than required; use AcpiOsExecute
to clear battery status/information in the sysmon_task_queue along with
the refresh.
With these changes running GNOME's battstat-applet-2 no longer causes
my mouse to stutter once a second, and significantly reduces its CPU usage.
4.99.42 and nobody has complained. Newer systems with ioapic shouldn't
need this, and older non-ioapic systems should properly restore PCI IRQ
routing within their PCI-ISA bridge drivers.
config_found_ia on the node to save a bunch of useless 'device NNN
not configured' messages at startup. While here, condense ACPI printfs
at attach time.