Commit 7cc3b88a authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] move acpi_bios_year() to blacklist.c from dmi_scan.c (Pavel Machek)

parent 75281999
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/acpi.h> #include <linux/acpi.h>
#include <asm/io.h> #include <asm/io.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -454,24 +454,10 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={ ...@@ -454,24 +454,10 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
static __init void dmi_check_blacklist(void) static __init void dmi_check_blacklist(void)
{ {
#ifdef CONFIG_ACPI_BOOT #ifdef CONFIG_ACPI_BOOT
#define ACPI_BLACKLIST_CUTOFF_YEAR 2001
if (dmi_ident[DMI_BIOS_DATE]) { if (dmi_ident[DMI_BIOS_DATE]) {
char *s = strrchr(dmi_ident[DMI_BIOS_DATE], '/'); char *s = strrchr(dmi_ident[DMI_BIOS_DATE], '/');
if (s) { if (s && !acpi_force)
int year, disable = 0; acpi_bios_year(s+1);
s++;
year = simple_strtoul(s,NULL,0);
if (year >= 1000)
disable = year < ACPI_BLACKLIST_CUTOFF_YEAR;
else if (year < 1 || (year > 90 && year <= 99))
disable = 1;
if (disable && !acpi_force) {
printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
printk(KERN_NOTICE "You can enable it with acpi=force\n");
disable_acpi();
}
}
} }
#endif #endif
dmi_check_system(dmi_blacklist); dmi_check_system(dmi_blacklist);
......
...@@ -69,6 +69,27 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata = ...@@ -69,6 +69,27 @@ static struct acpi_blacklist_item acpi_blacklist[] __initdata =
{""} {""}
}; };
#define ACPI_BLACKLIST_CUTOFF_YEAR 2001
/*
* Notice: this is called from dmi_scan.c, which contains second (!) blacklist
*/
void __init
acpi_bios_year(char *s)
{
int year, disable = 0;
year = simple_strtoul(s,NULL,0);
if (year >= 1000)
disable = year < ACPI_BLACKLIST_CUTOFF_YEAR;
else if (year < 1 || (year > 90 && year <= 99))
disable = 1;
if (disable) {
printk(KERN_NOTICE "ACPI disabled because your bios is from %s and too old\n", s);
printk(KERN_NOTICE "You can enable it with acpi=force\n");
acpi_disabled = 1;
}
}
int __init int __init
acpi_blacklisted(void) acpi_blacklisted(void)
......
...@@ -453,14 +453,15 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); ...@@ -453,14 +453,15 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
#ifdef CONFIG_ACPI_EC #ifdef CONFIG_ACPI_EC
int ec_read(u8 addr, u8 *val); extern int ec_read(u8 addr, u8 *val);
int ec_write(u8 addr, u8 val); extern int ec_write(u8 addr, u8 val);
#endif /*CONFIG_ACPI_EC*/ #endif /*CONFIG_ACPI_EC*/
#ifdef CONFIG_ACPI_INTERPRETER #ifdef CONFIG_ACPI_INTERPRETER
int acpi_blacklisted(void); extern int acpi_blacklisted(void);
extern void acpi_bios_year(char *s);
#else /*!CONFIG_ACPI_INTERPRETER*/ #else /*!CONFIG_ACPI_INTERPRETER*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment