2003-06-12 08:49:04

by Stelian Pop

[permalink] [raw]
Subject: Export 'acpi_disabled' symbol to modules...

Hi,

The ACPI subsystem can be today (from a driver point of view) in
three configurations: not compiled (CONFIG_ACPI=n), compiled and
running or compiled and disabled (with acpi=off).

A driver which wants to use some ACPI exported routines (in my
case it's the sonypi driver which wants to use ec_read/ec_write),
needs to know exactly what the ACPI state is.

The only way to do this today (from what I've seen) is to do:

#ifdef CONFIG_ACPI
if (!acpi_disabled)
return ec_write(addr, value);
#endif
return my_ec_emulated_write(...);

This way on doing things needs however that the 'acpi_disabled'
variable be exported to modules.

Please apply the attached patch or advise on a better way to know
if ACPI is enabled or not (patch generated against the today 2.5 BK
tree).

Thanks,

Stelian.

===== arch/i386/kernel/setup.c 1.84 vs edited =====
--- 1.84/arch/i386/kernel/setup.c Sun Jun 8 00:17:53 2003
+++ edited/arch/i386/kernel/setup.c Tue Jun 10 10:02:00 2003
@@ -61,7 +61,8 @@
unsigned long mmu_cr4_features;
EXPORT_SYMBOL_GPL(mmu_cr4_features);

-int acpi_disabled __initdata = 0;
+int acpi_disabled;
+EXPORT_SYMBOL(acpi_disabled);

int MCA_bus;
/* for MCA, but anyone else can use it if they want */

--
Stelian Pop <[email protected]>
Alcove - http://www.alcove.com