cpu.resource(pc-i386) Get this compile again, with acpica.library
[AROS.git] / arch / all-pc / acpi / oemblacklist.c
blob554d310650048bee6b9a1e11bbcf934c0d53ee17
1 #include <aros/debug.h>
2 #include <resources/acpi.h>
3 #include <proto/acpi.h>
5 #include <string.h>
7 #include "acpi_intern.h"
9 #ifdef ENABLE_BLACKLIST
12 Everything that doesnt work MUST be put on the OEMBlacklist!!!
13 If the problem is critical - mark it as such
16 enum acpi_oemblacklist_revisionmatch
18 all_versions,
19 less_than_or_equal,
20 equal,
21 greater_than_or_equal,
24 struct acpi_oemblacklist_entry
26 char oem_id[7];
27 char oem_table_id[9];
28 unsigned int oem_revision;
29 unsigned int acpi_tableid;
30 enum acpi_oemblacklist_revisionmatch oem_revision_match;
31 char *blacklist_reason;
32 unsigned int blacklist_critical;
35 static const struct acpi_oemblacklist_entry _ACPI_OEMBlacklist[] =
37 /* ASUS K7M */
38 {"ASUS ", "K7M ", 0x00001000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0},
39 /* ASUS P2B-S */
40 {"ASUS\0\0", "P2B-S ", 0x00000000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Bogus PCI routing", 1},
41 /* Seattle 2 - old BIOS rev. */
42 {"INTEL ", "440BX ", 0x00001000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0},
43 /* Intel 810 Motherboard */
44 {"MNTRAL", "MO81010A", 0x00000012, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0},
45 /* Compaq Presario 711FR */
46 {"COMAPQ", "EAGLES", 0x06040000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "SCI issues (C2 disabled)", 0},
47 /* Compaq Presario 1700 */
48 {"PTLTD ", " DSDT ", 0x06040000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Multiple problems", 1},
49 /* Sony FX120, FX140, FX150? */
50 {"SONY ", "U0 ", 0x20010313, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "ACPI driver problem", 1},
51 /* Compaq Presario 800, Insyde BIOS */
52 {"INT440", "SYSFexxx", 0x00001001, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
53 /* IBM 600E - _ADR should return 7, but it returns 1 */
54 {"IBM ", "TP600E ", 0x00000105, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Incorrect _ADR", 1},
55 /* Portege 7020, BIOS 8.10 */
56 {"TOSHIB", "7020CT ", 0x19991112, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0},
57 /* Portege 4030 */
58 {"TOSHIB", "4030 ", 0x19991112, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0},
59 /* Portege 310/320, BIOS 7.1 */
60 {"TOSHIB", "310 ", 0x19990511, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0},
61 {"\0"}
64 /**********************************************************/
65 int acpi_IsBlacklisted(struct ACPIBase *ACPIBase)
67 int i = 0;
68 struct ACPI_TABLE_DEF_HEADER *table_header;
70 D(bug("[ACPI] core_ACPIIsBlacklisted()\n"));
72 for (i = 0; _ACPI_OEMBlacklist[i].oem_id[0] != '\0'; i++)
74 table_header = ACPI_FindSDT(_ACPI_OEMBlacklist[i].acpi_tableid);
76 if (!table_header)
77 continue;
79 if (strncmp(_ACPI_OEMBlacklist[i].oem_id, table_header->oem_id, 6))
80 continue;
82 if (strncmp(_ACPI_OEMBlacklist[i].oem_table_id, table_header->oem_table_id, 8))
83 i++;
84 continue;
86 if (table_header != NULL)
88 if ((_ACPI_OEMBlacklist[i].oem_revision_match == all_versions) ||
89 ((_ACPI_OEMBlacklist[i].oem_revision_match == less_than_or_equal) &&
90 (table_header->oem_revision <= _ACPI_OEMBlacklist[i].oem_revision)) ||
91 ((_ACPI_OEMBlacklist[i].oem_revision_match == greater_than_or_equal) &&
92 (table_header->oem_revision >= _ACPI_OEMBlacklist[i].oem_revision)) ||
93 ((_ACPI_OEMBlacklist[i].oem_revision_match == equal) &&
94 (table_header->oem_revision == _ACPI_OEMBlacklist[i].oem_revision)))
96 bug("[ACPI] core_ACPIIsBlacklisted: ERROR - Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
97 _ACPI_OEMBlacklist[i].oem_id, _ACPI_OEMBlacklist[i].oem_table_id, _ACPI_OEMBlacklist[i].oem_revision);
98 bug("[ACPI] core_ACPIIsBlacklisted: ERROR - Reason: %s. This is a %s error\n",
99 _ACPI_OEMBlacklist[i].blacklist_reason, ( _ACPI_OEMBlacklist[i].blacklist_critical ? "non-recoverable" : "recoverable" ));
101 return _ACPI_OEMBlacklist[i].blacklist_critical;
106 return 0;
109 #endif