Deleted Added
full compact
29c29
< * $FreeBSD: head/sys/dev/acpica/acpi.c 126080 2004-02-21 21:10:55Z phk $
---
> * $FreeBSD: head/sys/dev/acpica/acpi.c 126517 2004-03-03 03:02:17Z njl $
87a88,104
> struct acpi_quirks {
> char *OemId;
> uint32_t OemRevision;
> char *value;
> };
>
> #define ACPI_OEM_REV_ANY 0
>
> static struct acpi_quirks acpi_quirks_table[] = {
> #ifdef notyet
> /* Bad PCI routing table. Used on some SuperMicro boards. */
> { "PTLTD ", 0x06040000, "pci_link" },
> #endif
>
> { NULL, 0, NULL }
> };
>
91a109
> static void acpi_quirks_set(void);
210c228
< return_VALUE(error);
---
> return_VALUE (error);
229c247
< return_VALUE(error);
---
> return_VALUE (error);
244c262,266
< return_VALUE(AE_OK);
---
>
> /* Set up any quirks we have for this XSDT. */
> acpi_quirks_set();
>
> return_VALUE (AE_OK);
555a578,617
> static void
> acpi_quirks_set()
> {
> XSDT_DESCRIPTOR *xsdt;
> struct acpi_quirks *quirk;
> char *env, *tmp;
> int len;
>
> /* If the user specifies "noquirks", leave the settings alone. */
> len = 0;
> if ((env = getenv("debug.acpi.disabled")) != NULL) {
> if (strstr("noquirks", env) != NULL)
> goto out;
> len = strlen(env);
> }
>
> /*
> * Search through our quirk table and concatenate the disabled
> * values with whatever we find.
> */
> xsdt = AcpiGbl_XSDT;
> for (quirk = acpi_quirks_table; quirk->OemId; quirk++) {
> if (!strncmp(xsdt->OemId, quirk->OemId, strlen(quirk->OemId)) &&
> (xsdt->OemRevision == quirk->OemRevision ||
> quirk->OemRevision == ACPI_OEM_REV_ANY)) {
> len += strlen(quirk->value) + 2;
> if ((tmp = malloc(len, M_TEMP, M_NOWAIT)) == NULL)
> goto out;
> sprintf(tmp, "%s %s", env ? env : "", quirk->value);
> setenv("debug.acpi.disabled", tmp);
> free(tmp, M_TEMP);
> break;
> }
> }
>
> out:
> if (env)
> freeenv(env);
> }
>
593d654
<
1835c1896
< if ((env = getenv("debug.acpi.disable")) == NULL)
---
> if ((env = getenv("debug.acpi.disabled")) == NULL)
1837c1898
< if (!strcmp(env, "all")) {
---
> if (strcmp(env, "all") == 0) {
1842c1903
< /* scan the disable list checking for a match */
---
> /* Scan the disable list, checking for a match. */
1845c1906
< while ((*cp != 0) && isspace(*cp))
---
> while (*cp != '\0' && isspace(*cp))
1847c1908
< if (*cp == 0)
---
> if (*cp == '\0')
1850c1911
< while ((cp[len] != 0) && !isspace(cp[len]))
---
> while (cp[len] != '\0' && !isspace(cp[len]))
1852c1913
< if (!strncmp(cp, subsys, len)) {
---
> if (strncmp(cp, subsys, len) == 0) {
2214,2217d2274
< {"ACPI_BUS", ACPI_BUS},
< {"ACPI_SYSTEM", ACPI_SYSTEM},
< {"ACPI_POWER", ACPI_POWER},
< {"ACPI_EC", ACPI_EC},
2219a2277
> {"ACPI_BUS", ACPI_BUS},
2220a2279,2281
> {"ACPI_EC", ACPI_EC},
> {"ACPI_FAN", ACPI_FAN},
> {"ACPI_POWERRES", ACPI_POWERRES},
2223c2284
< {"ACPI_FAN", ACPI_FAN},
---
> {"ACPI_TIMER", ACPI_TIMER},