From acf72ef4f1c174a155e70015cc8e0bd93b7a6034 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sat, 21 Jul 2001 04:04:03 +0000 Subject: [PATCH] The API for loading tables changed (we no longer explicitly search for the RSDP, it's now found via a callback). AcpiOsSleepUsec() went away, use AcpiOsSleep() instead (we could use AcpiOsStall() too) AcpiFormatException() was changed to make more sense (it behaves like our old acpi_strerror() did), so throw acpi_strerror() away (still #defined in acpivar.h though, we need to sweep these seperately). --- sys/dev/acpica/acpi.c | 19 ++----------------- sys/dev/acpica/acpivar.h | 4 ++-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 54426f419c15..d9e34f73fed0 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -168,7 +168,6 @@ static void acpi_identify(driver_t *driver, device_t parent) { device_t child; - ACPI_PHYSICAL_ADDRESS rsdp; int error; #ifdef ENABLE_DEBUGGER char *debugpoint = getenv("debug.acpi.debugger"); @@ -205,8 +204,7 @@ acpi_identify(driver_t *driver, device_t parent) if (debugpoint && !strcmp(debugpoint, "tables")) acpi_EnterDebugger(); #endif - if (((error = AcpiFindRootPointer(&rsdp)) != AE_OK) || - ((error = AcpiLoadTables(rsdp)) != AE_OK)) { + if ((error = AcpiLoadTables()) != AE_OK) { printf("ACPI: table load failed: %s\n", acpi_strerror(error)); return_VOID; } @@ -1095,7 +1093,7 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) /* wait for the WAK_STS bit */ Count = 0; while (!(AcpiHwRegisterBitAccess(ACPI_READ, ACPI_MTX_LOCK, WAK_STS))) { - AcpiOsSleepUsec(1000); + AcpiOsSleep(0, 1); /* * Some BIOSes don't set WAK_STS at all, * give up waiting for wakeup if we time out. @@ -1259,19 +1257,6 @@ struct acpi_staticbuf { char data[512]; }; -char * -acpi_strerror(ACPI_STATUS excep) -{ - static struct acpi_staticbuf buf; - - buf.buffer.Length = 512; - buf.buffer.Pointer = &buf.data[0]; - - if (AcpiFormatException(excep, &buf.buffer) == AE_OK) - return(buf.buffer.Pointer); - return("(error formatting exception)"); -} - char * acpi_name(ACPI_HANDLE handle) { diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 5a6f73752c7e..22be040c639c 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -231,8 +231,8 @@ extern struct acpi_parse_resource_set acpi_res_parse_set; extern ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set); -/* XXX this is ugly */ -extern char *acpi_strerror(ACPI_STATUS excep); +/* XXX hack to handle old code, should be fixed */ +#define acpi_strerror(e) AcpiFormatException(e) /* * ACPI event handling