Convert from acpi_strerror() to AcpiFormatException()
Fix dangling include of the dear departed acpi_ecreg.h
This commit is contained in:
parent
3c98bba995
commit
bfae45aa43
@ -239,7 +239,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
||||
if ((status = AcpiEnterSleepState(state)) != AE_OK) {
|
||||
device_printf(sc->acpi_dev,
|
||||
"AcpiEnterSleepState failed - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ acpi_identify(driver_t *driver, device_t parent)
|
||||
acpi_EnterDebugger();
|
||||
#endif
|
||||
if ((error = AcpiInitializeSubsystem()) != AE_OK) {
|
||||
printf("ACPI: initialisation failed: %s\n", acpi_strerror(error));
|
||||
printf("ACPI: initialisation failed: %s\n", AcpiFormatException(error));
|
||||
return_VOID;
|
||||
}
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
@ -205,7 +205,7 @@ acpi_identify(driver_t *driver, device_t parent)
|
||||
acpi_EnterDebugger();
|
||||
#endif
|
||||
if ((error = AcpiLoadTables()) != AE_OK) {
|
||||
printf("ACPI: table load failed: %s\n", acpi_strerror(error));
|
||||
printf("ACPI: table load failed: %s\n", AcpiFormatException(error));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ acpi_probe(device_t dev)
|
||||
ACPI_LOCK;
|
||||
|
||||
if ((status = AcpiGetTableHeader(ACPI_TABLE_XSDT, 1, &th)) != AE_OK) {
|
||||
device_printf(dev, "couldn't get XSDT header: %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "couldn't get XSDT header: %s\n", AcpiFormatException(status));
|
||||
error = ENXIO;
|
||||
} else {
|
||||
sprintf(buf, "%.6s %.8s", th.OemId, th.OemTableId);
|
||||
@ -275,21 +275,21 @@ acpi_attach(device_t dev)
|
||||
ACPI_ADR_SPACE_SYSTEM_MEMORY,
|
||||
ACPI_DEFAULT_HANDLER,
|
||||
NULL, NULL)) != AE_OK) {
|
||||
device_printf(dev, "could not initialise SystemMemory handler: %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not initialise SystemMemory handler: %s\n", AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
if ((status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
|
||||
ACPI_ADR_SPACE_SYSTEM_IO,
|
||||
ACPI_DEFAULT_HANDLER,
|
||||
NULL, NULL)) != AE_OK) {
|
||||
device_printf(dev, "could not initialise SystemIO handler: %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not initialise SystemIO handler: %s\n", AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
if ((status = AcpiInstallAddressSpaceHandler(ACPI_ROOT_OBJECT,
|
||||
ACPI_ADR_SPACE_PCI_CONFIG,
|
||||
ACPI_DEFAULT_HANDLER,
|
||||
NULL, NULL)) != AE_OK) {
|
||||
device_printf(dev, "could not initialise PciConfig handler: %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not initialise PciConfig handler: %s\n", AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ acpi_attach(device_t dev)
|
||||
acpi_EnterDebugger();
|
||||
#endif
|
||||
if ((status = AcpiEnableSubsystem(ACPI_NO_DEVICE_INIT | ACPI_NO_OBJECT_INIT)) != AE_OK) {
|
||||
device_printf(dev, "could not enable ACPI: %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not enable ACPI: %s\n", AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -690,7 +690,7 @@ acpi_shutdown_final(void *arg, int howto)
|
||||
if (howto & RB_POWEROFF) {
|
||||
printf("Power system off using ACPI...\n");
|
||||
if ((status = AcpiEnterSleepState(acpi_off_state)) != AE_OK) {
|
||||
printf("ACPI power-off failed - %s\n", acpi_strerror(status));
|
||||
printf("ACPI power-off failed - %s\n", AcpiFormatException(status));
|
||||
} else {
|
||||
DELAY(1000000);
|
||||
printf("ACPI power-off failed - timeout\n");
|
||||
@ -1049,7 +1049,7 @@ acpi_SetSleepState(struct acpi_softc *sc, int state)
|
||||
case ACPI_STATE_S0: /* XXX only for testing */
|
||||
status = AcpiEnterSleepState((UINT8)state);
|
||||
if (status != AE_OK) {
|
||||
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", acpi_strerror(status));
|
||||
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1087,7 +1087,7 @@ acpi_SetSleepState(struct acpi_softc *sc, int state)
|
||||
} else {
|
||||
status = AcpiEnterSleepState((UINT8)state);
|
||||
if (status != AE_OK) {
|
||||
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", acpi_strerror(status));
|
||||
device_printf(sc->acpi_dev, "AcpiEnterSleepState failed - %s\n", AcpiFormatException(status));
|
||||
break;
|
||||
}
|
||||
/* wait for the WAK_STS bit */
|
||||
|
@ -111,7 +111,7 @@ acpi_button_attach(device_t dev)
|
||||
|
||||
if ((status = AcpiInstallNotifyHandler(sc->button_handle, ACPI_DEVICE_NOTIFY,
|
||||
acpi_button_notify_handler, sc)) != AE_OK) {
|
||||
device_printf(sc->button_dev, "couldn't install Notify handler - %s\n", acpi_strerror(status));
|
||||
device_printf(sc->button_dev, "couldn't install Notify handler - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
return_VALUE(0);
|
||||
|
@ -207,7 +207,7 @@ acpi_cpu_attach(device_t dev)
|
||||
buf.Pointer = &processor;
|
||||
buf.Length = sizeof(processor);
|
||||
if (ACPI_FAILURE(status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf))) {
|
||||
device_printf(sc->cpu_dev, "couldn't get Processor object - %s\n", acpi_strerror(status));
|
||||
device_printf(sc->cpu_dev, "couldn't get Processor object - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
if (processor.Type != ACPI_TYPE_PROCESSOR) {
|
||||
|
@ -147,7 +147,6 @@
|
||||
#include "acpi.h"
|
||||
|
||||
#include <dev/acpica/acpivar.h>
|
||||
#include <dev/acpica/acpi_ecreg.h>
|
||||
|
||||
/*
|
||||
* Hooks for the ACPI CA debugging infrastructure
|
||||
@ -400,7 +399,7 @@ acpi_ec_attach(device_t dev)
|
||||
*/
|
||||
DEBUG_PRINT(TRACE_RESOURCES, ("attaching GPE\n"));
|
||||
if ((Status = acpi_EvaluateInteger(sc->ec_handle, "_GPE", &sc->ec_gpebit)) != AE_OK) {
|
||||
device_printf(dev, "can't evaluate _GPE - %s\n", acpi_strerror(Status));
|
||||
device_printf(dev, "can't evaluate _GPE - %s\n", AcpiFormatException(Status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
|
||||
@ -415,7 +414,7 @@ acpi_ec_attach(device_t dev)
|
||||
if ((Status = AcpiInstallGpeHandler(sc->ec_gpebit, ACPI_EVENT_LEVEL_TRIGGERED | ACPI_EVENT_EDGE_TRIGGERED,
|
||||
EcGpeHandler, sc)) != AE_OK) {
|
||||
device_printf(dev, "can't install GPE handler for %s - %s\n",
|
||||
acpi_name(sc->ec_handle), acpi_strerror(Status));
|
||||
acpi_name(sc->ec_handle), AcpiFormatException(Status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
|
||||
@ -426,7 +425,7 @@ acpi_ec_attach(device_t dev)
|
||||
if ((Status = AcpiInstallAddressSpaceHandler(sc->ec_handle, ACPI_ADR_SPACE_EC,
|
||||
EcSpaceHandler, EcSpaceSetup, sc)) != AE_OK) {
|
||||
device_printf(dev, "can't install address space handler for %s - %s\n",
|
||||
acpi_name(sc->ec_handle), acpi_strerror(Status));
|
||||
acpi_name(sc->ec_handle), AcpiFormatException(Status));
|
||||
panic("very suck");
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
@ -470,7 +469,7 @@ EcGpeQueryHandler(void *Context)
|
||||
* If we failed to get anything from the EC, give up
|
||||
*/
|
||||
if (Status != AE_OK) {
|
||||
device_printf(sc->ec_dev, "GPE query failed - %s\n", acpi_strerror(Status));
|
||||
device_printf(sc->ec_dev, "GPE query failed - %s\n", AcpiFormatException(Status));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -485,7 +484,7 @@ EcGpeQueryHandler(void *Context)
|
||||
*/
|
||||
if (Status != AE_OK && (Data != 0 || Status != AE_NOT_FOUND)) {
|
||||
device_printf(sc->ec_dev, "evaluation of GPE query method %s failed - %s\n",
|
||||
qxx, acpi_strerror(Status));
|
||||
qxx, AcpiFormatException(Status));
|
||||
}
|
||||
}
|
||||
/* I know I request Level trigger cleanup */
|
||||
|
@ -160,12 +160,12 @@ acpi_isa_identify(driver_t *driver, device_t bus)
|
||||
* we are likely to support.
|
||||
*/
|
||||
if ((status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &parent)) != AE_OK) {
|
||||
device_printf(bus, "no ACPI _SB_ scope - %s\n", acpi_strerror(status));
|
||||
device_printf(bus, "no ACPI _SB_ scope - %s\n", AcpiFormatException(status));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if ((status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, parent, 100, acpi_isa_identify_child, bus, NULL)) != AE_OK)
|
||||
device_printf(bus, "AcpiWalkNamespace on _SB_ failed - %s\n", acpi_strerror(status));
|
||||
device_printf(bus, "AcpiWalkNamespace on _SB_ failed - %s\n", AcpiFormatException(status));
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ acpi_pcib_attach(device_t dev)
|
||||
*/
|
||||
if ((status = acpi_EvaluateInteger(sc->ap_handle, "_SEG", &sc->ap_segment)) != AE_OK) {
|
||||
if (status != AE_NOT_FOUND) {
|
||||
device_printf(dev, "could not evaluate _SEG - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not evaluate _SEG - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
/* if it's not found, assume 0 */
|
||||
@ -171,7 +171,7 @@ acpi_pcib_attach(device_t dev)
|
||||
*/
|
||||
if ((status = acpi_EvaluateInteger(sc->ap_handle, "_BBN", &sc->ap_bus)) != AE_OK) {
|
||||
if (status != AE_NOT_FOUND) {
|
||||
device_printf(dev, "could not evaluate _BBN - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
/* if it's not found, assume 0 */
|
||||
@ -189,7 +189,7 @@ acpi_pcib_attach(device_t dev)
|
||||
* Get the PCI interrupt routing table.
|
||||
*/
|
||||
if ((status = acpi_GetIntoBuffer(sc->ap_handle, AcpiGetIrqRoutingTable, &sc->ap_prt)) != AE_OK) {
|
||||
device_printf(dev, "could not get PCI interrupt routing table - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not get PCI interrupt routing table - %s\n", AcpiFormatException(status));
|
||||
/* this is not an error, but it may reduce functionality */
|
||||
}
|
||||
|
||||
@ -385,12 +385,12 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
|
||||
*/
|
||||
if (ACPI_FAILURE(status = acpi_GetIntoBuffer(lnkdev, AcpiGetCurrentResources, &crsbuf))) {
|
||||
device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _CRS data - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
goto out; /* this is fatal */
|
||||
}
|
||||
if ((status = acpi_GetIntoBuffer(lnkdev, AcpiGetPossibleResources, &prsbuf)) != AE_OK) {
|
||||
device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _PRS data - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
/* this is not fatal, since it may be hardwired */
|
||||
}
|
||||
DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
|
||||
@ -477,7 +477,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
|
||||
crsres->Data.Irq.NumberOfInterrupts = 1;
|
||||
if (ACPI_FAILURE(status = AcpiSetCurrentResources(lnkdev, &crsbuf))) {
|
||||
device_printf(sc->ap_dev, "couldn't route interrupt %d via %s - %s\n",
|
||||
prsres->Data.Irq.Interrupts[0], acpi_name(lnkdev), acpi_strerror(status));
|
||||
prsres->Data.Irq.Interrupts[0], acpi_name(lnkdev), AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ acpi_pcib_attach(device_t dev)
|
||||
*/
|
||||
if ((status = acpi_EvaluateInteger(sc->ap_handle, "_SEG", &sc->ap_segment)) != AE_OK) {
|
||||
if (status != AE_NOT_FOUND) {
|
||||
device_printf(dev, "could not evaluate _SEG - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not evaluate _SEG - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
/* if it's not found, assume 0 */
|
||||
@ -171,7 +171,7 @@ acpi_pcib_attach(device_t dev)
|
||||
*/
|
||||
if ((status = acpi_EvaluateInteger(sc->ap_handle, "_BBN", &sc->ap_bus)) != AE_OK) {
|
||||
if (status != AE_NOT_FOUND) {
|
||||
device_printf(dev, "could not evaluate _BBN - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not evaluate _BBN - %s\n", AcpiFormatException(status));
|
||||
return_VALUE(ENXIO);
|
||||
}
|
||||
/* if it's not found, assume 0 */
|
||||
@ -189,7 +189,7 @@ acpi_pcib_attach(device_t dev)
|
||||
* Get the PCI interrupt routing table.
|
||||
*/
|
||||
if ((status = acpi_GetIntoBuffer(sc->ap_handle, AcpiGetIrqRoutingTable, &sc->ap_prt)) != AE_OK) {
|
||||
device_printf(dev, "could not get PCI interrupt routing table - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "could not get PCI interrupt routing table - %s\n", AcpiFormatException(status));
|
||||
/* this is not an error, but it may reduce functionality */
|
||||
}
|
||||
|
||||
@ -385,12 +385,12 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
|
||||
*/
|
||||
if (ACPI_FAILURE(status = acpi_GetIntoBuffer(lnkdev, AcpiGetCurrentResources, &crsbuf))) {
|
||||
device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _CRS data - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
goto out; /* this is fatal */
|
||||
}
|
||||
if ((status = acpi_GetIntoBuffer(lnkdev, AcpiGetPossibleResources, &prsbuf)) != AE_OK) {
|
||||
device_printf(sc->ap_dev, "couldn't get PCI interrupt link device _PRS data - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
/* this is not fatal, since it may be hardwired */
|
||||
}
|
||||
DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
|
||||
@ -477,7 +477,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
|
||||
crsres->Data.Irq.NumberOfInterrupts = 1;
|
||||
if (ACPI_FAILURE(status = AcpiSetCurrentResources(lnkdev, &crsbuf))) {
|
||||
device_printf(sc->ap_dev, "couldn't route interrupt %d via %s - %s\n",
|
||||
prsres->Data.Irq.Interrupts[0], acpi_name(lnkdev), acpi_strerror(status));
|
||||
prsres->Data.Irq.Interrupts[0], acpi_name(lnkdev), AcpiFormatException(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ acpi_pwr_reference_resource(ACPI_OBJECT *obj, void *arg)
|
||||
/* create/look up the resource */
|
||||
if (ACPI_FAILURE(status = acpi_pwr_register_resource(res))) {
|
||||
DEBUG_PRINT(TRACE_OBJECTS, ("couldn't register power resource %s - %s\n",
|
||||
obj->String.Pointer, acpi_strerror(status)));
|
||||
obj->String.Pointer, AcpiFormatException(status)));
|
||||
return_VOID;
|
||||
}
|
||||
if ((rp = acpi_pwr_find_resource(res)) == NULL) {
|
||||
@ -534,7 +534,7 @@ acpi_pwr_switch_power(void)
|
||||
if (cur != ACPI_PWR_ON) {
|
||||
if (ACPI_FAILURE(status = AcpiEvaluateObject(rp->ap_resource, "_ON", NULL, NULL))) {
|
||||
DEBUG_PRINT(TRACE_OBJECTS, ("failed to switch %s on - %s\n",
|
||||
acpi_name(rp->ap_resource), acpi_strerror(status)));
|
||||
acpi_name(rp->ap_resource), AcpiFormatException(status)));
|
||||
} else {
|
||||
DEBUG_PRINT(TRACE_OBJECTS, ("switched %s on\n", acpi_name(rp->ap_resource)));
|
||||
}
|
||||
@ -568,7 +568,7 @@ acpi_pwr_switch_power(void)
|
||||
if (cur != ACPI_PWR_OFF) {
|
||||
if (ACPI_FAILURE(status = AcpiEvaluateObject(rp->ap_resource, "_OFF", NULL, NULL))) {
|
||||
DEBUG_PRINT(TRACE_OBJECTS, ("failed to switch %s off - %s\n",
|
||||
acpi_name(rp->ap_resource), acpi_strerror(status)));
|
||||
acpi_name(rp->ap_resource), AcpiFormatException(status)));
|
||||
} else {
|
||||
DEBUG_PRINT(TRACE_OBJECTS, ("switched %s off\n", acpi_name(rp->ap_resource)));
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resourc
|
||||
*/
|
||||
if (((status = acpi_GetIntoBuffer(handle, AcpiGetPossibleResources, &buf)) != AE_OK) &&
|
||||
((status = acpi_GetIntoBuffer(handle, AcpiGetCurrentResources, &buf)) != AE_OK)) {
|
||||
device_printf(dev, "can't fetch ACPI resources - %s\n", acpi_strerror(status));
|
||||
device_printf(dev, "can't fetch ACPI resources - %s\n", AcpiFormatException(status));
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes of resources\n", buf.Length));
|
||||
|
@ -513,7 +513,7 @@ acpi_tz_switch_cooler_on(ACPI_OBJECT *obj, void *arg)
|
||||
if (AcpiGetHandle(NULL, obj->String.Pointer, &cooler) == AE_OK) {
|
||||
if (ACPI_FAILURE(status = acpi_pwr_switch_consumer(cooler, ACPI_STATE_D0))) {
|
||||
device_printf(sc->tz_dev, "failed to activate %s - %s\n",
|
||||
obj->String.Pointer, acpi_strerror(status));
|
||||
obj->String.Pointer, AcpiFormatException(status));
|
||||
}
|
||||
} else {
|
||||
device_printf(sc->tz_dev, "couldn't find %s\n", obj->String.Pointer);
|
||||
@ -683,7 +683,7 @@ acpi_tz_powerprofile(void *arg)
|
||||
if (ACPI_FAILURE(status = AcpiEvaluateObject(sc->tz_handle, "_SCP", &args, NULL))) {
|
||||
if (status != AE_NOT_FOUND)
|
||||
device_printf(sc->tz_dev, "can't evaluate %s._SCP - %s\n", acpi_name(sc->tz_handle),
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
sc->tz_flags |= TZ_FLAG_NO_SCP;
|
||||
} else {
|
||||
/* we have to re-evaluate the entire zone now */
|
||||
|
@ -231,9 +231,6 @@ 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 hack to handle old code, should be fixed */
|
||||
#define acpi_strerror(e) AcpiFormatException(e)
|
||||
|
||||
/*
|
||||
* ACPI event handling
|
||||
*/
|
||||
|
@ -239,7 +239,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
||||
if ((status = AcpiEnterSleepState(state)) != AE_OK) {
|
||||
device_printf(sc->acpi_dev,
|
||||
"AcpiEnterSleepState failed - %s\n",
|
||||
acpi_strerror(status));
|
||||
AcpiFormatException(status));
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user