1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

Updates to match the ACPI CA 20010816 import:

- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
 - New debug level/subsystem codes.
This commit is contained in:
Mike Smith 2001-08-26 22:50:15 +00:00
parent 2780a616d6
commit 4c1cdee628
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82372
10 changed files with 163 additions and 162 deletions

View File

@ -612,7 +612,7 @@ acpi_probe_children(device_t bus)
/*
* Create any static children by calling device identify methods.
*/
DEBUG_PRINT(TRACE_OBJECTS, ("device identify routines\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n"));
bus_generic_probe(bus);
/*
@ -624,7 +624,7 @@ acpi_probe_children(device_t bus)
* present. (This assumes that we don't want to create/remove devices as they
* appear, which might be smarter.)
*/
DEBUG_PRINT(TRACE_OBJECTS, ("namespace scan\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "namespace scan\n"));
for (i = 0; scopes[i] != NULL; i++)
if ((AcpiGetHandle(ACPI_ROOT_OBJECT, scopes[i], &parent)) == AE_OK)
AcpiWalkNamespace(ACPI_TYPE_ANY, parent, 100, acpi_probe_child, bus, NULL);
@ -632,14 +632,14 @@ acpi_probe_children(device_t bus)
/*
* Scan all of the child devices we have created and let them probe/attach.
*/
DEBUG_PRINT(TRACE_OBJECTS, ("first bus_generic_attach\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "first bus_generic_attach\n"));
bus_generic_attach(bus);
/*
* Some of these children may have attached others as part of their attach
* process (eg. the root PCI bus driver), so rescan.
*/
DEBUG_PRINT(TRACE_OBJECTS, ("second bus_generic_attach\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "second bus_generic_attach\n"));
bus_generic_attach(bus);
return_VOID;
@ -675,7 +675,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
* Create a placeholder device for this node. Sort the placeholder
* so that the probe/attach passes will run breadth-first.
*/
DEBUG_PRINT(TRACE_OBJECTS, ("scanning '%s'\n", acpi_name(handle)))
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", acpi_name(handle)));
child = BUS_ADD_CHILD(bus, level * 10, NULL, -1);
acpi_set_handle(child, handle);
DEBUG_EXEC(device_probe_and_attach(child));
@ -1110,32 +1110,32 @@ acpi_wakeup(UINT8 state)
* In many BIOSes, _WAK doesn't return a result code.
* We don't need to worry about it too much :-).
*/
DEBUG_PRINT(ACPI_INFO,
("acpi_wakeup: _WAK result code is corrupted, "
"but should be OK.\n"));
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"acpi_wakeup: _WAK result code is corrupted, "
"but should be OK.\n"));
} else {
/* evaluate status code */
switch (Objects[1].Integer.Value) {
case 0x00000001:
DEBUG_PRINT(ACPI_ERROR,
("acpi_wakeup: Wake was signaled "
"but failed due to lack of power.\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_wakeup: Wake was signaled "
"but failed due to lack of power.\n"));
Status = AE_ERROR;
break;
case 0x00000002:
DEBUG_PRINT(ACPI_ERROR,
("acpi_wakeup: Wake was signaled "
"but failed due to thermal condition.\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_wakeup: Wake was signaled "
"but failed due to thermal condition.\n"));
Status = AE_ERROR;
break;
}
/* evaluate PSS code */
if (Objects[2].Integer.Value == 0) {
DEBUG_PRINT(ACPI_ERROR,
("acpi_wakeup: The targeted S-state "
"was not entered because of too much current "
"being drawn from the power supply.\n"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"acpi_wakeup: The targeted S-state "
"was not entered because of too much current "
"being drawn from the power supply.\n"));
Status = AE_ERROR;
}
}
@ -1416,10 +1416,8 @@ acpi_avoid(ACPI_HANDLE handle)
len = 0;
while ((cp[len] != 0) && !isspace(cp[len]))
len++;
if (!strncmp(cp, np, len)) {
DEBUG_PRINT(TRACE_OBJECTS, ("avoiding '%s'\n", np));
if (!strncmp(cp, np, len))
return(1);
}
cp += len;
}
return(0);
@ -1448,10 +1446,8 @@ acpi_disabled(char *subsys)
len = 0;
while ((cp[len] != 0) && !isspace(cp[len]))
len++;
if (!strncmp(cp, subsys, len)) {
DEBUG_PRINT(TRACE_OBJECTS, ("disabled '%s'\n", subsys));
if (!strncmp(cp, subsys, len))
return(1);
}
cp += len;
}
return(0);
@ -1645,57 +1641,59 @@ static struct debugtag dbg_layer[] = {
{"ACPI_DISPATCHER", ACPI_DISPATCHER},
{"ACPI_EXECUTER", ACPI_EXECUTER},
{"ACPI_RESOURCES", ACPI_RESOURCES},
{"ACPI_POWER", ACPI_POWER},
{"ACPI_DEBUGGER", ACPI_DEBUGGER},
{"ACPI_OS_SERVICES", ACPI_OS_SERVICES},
{"ACPI_BUS", ACPI_BUS},
{"ACPI_SYSTEM", ACPI_SYSTEM},
{"ACPI_POWER", ACPI_POWER},
{"ACPI_EC", ACPI_EC},
{"ACPI_PROCESSOR", ACPI_PROCESSOR},
{"ACPI_AC_ADAPTER", ACPI_AC_ADAPTER},
{"ACPI_BATTERY", ACPI_BATTERY},
{"ACPI_BUTTON", ACPI_BUTTON},
{"ACPI_SYSTEM", ACPI_SYSTEM},
{"ACPI_PROCESSOR", ACPI_PROCESSOR},
{"ACPI_THERMAL", ACPI_THERMAL},
{"ACPI_DEBUGGER", ACPI_DEBUGGER},
{"ACPI_OS_SERVICES", ACPI_OS_SERVICES},
{"ACPI_FAN", ACPI_FAN},
{"ACPI_ALL_COMPONENTS", ACPI_ALL_COMPONENTS},
{NULL, 0}
};
static struct debugtag dbg_level[] = {
{"ACPI_OK", ACPI_OK},
{"ACPI_INFO", ACPI_INFO},
{"ACPI_WARN", ACPI_WARN},
{"ACPI_ERROR", ACPI_ERROR},
{"ACPI_FATAL", ACPI_FATAL},
{"ACPI_DEBUG_OBJECT", ACPI_DEBUG_OBJECT},
{"ACPI_ALL", ACPI_ALL},
{"TRACE_THREADS", TRACE_THREADS},
{"TRACE_PARSE", TRACE_PARSE},
{"TRACE_DISPATCH", TRACE_DISPATCH},
{"TRACE_LOAD", TRACE_LOAD},
{"TRACE_EXEC", TRACE_EXEC},
{"TRACE_NAMES", TRACE_NAMES},
{"TRACE_OPREGION", TRACE_OPREGION},
{"TRACE_BFIELD", TRACE_BFIELD},
{"TRACE_TRASH", TRACE_TRASH},
{"TRACE_TABLES", TRACE_TABLES},
{"TRACE_FUNCTIONS", TRACE_FUNCTIONS},
{"TRACE_VALUES", TRACE_VALUES},
{"TRACE_OBJECTS", TRACE_OBJECTS},
{"TRACE_ALLOCATIONS", TRACE_ALLOCATIONS},
{"TRACE_RESOURCES", TRACE_RESOURCES},
{"TRACE_IO", TRACE_IO},
{"TRACE_INTERRUPTS", TRACE_INTERRUPTS},
{"TRACE_USER_REQUESTS", TRACE_USER_REQUESTS},
{"TRACE_PACKAGE", TRACE_PACKAGE},
{"TRACE_MUTEX", TRACE_MUTEX},
{"TRACE_INIT", TRACE_INIT},
{"TRACE_ALL", TRACE_ALL},
{"VERBOSE_AML_DISASSEMBLE", VERBOSE_AML_DISASSEMBLE},
{"VERBOSE_INFO", VERBOSE_INFO},
{"VERBOSE_TABLES", VERBOSE_TABLES},
{"VERBOSE_EVENTS", VERBOSE_EVENTS},
{"VERBOSE_ALL", VERBOSE_ALL},
{"ACPI_LV_OK", ACPI_LV_OK},
{"ACPI_LV_INFO", ACPI_LV_INFO},
{"ACPI_LV_WARN", ACPI_LV_WARN},
{"ACPI_LV_ERROR", ACPI_LV_ERROR},
{"ACPI_LV_FATAL", ACPI_LV_FATAL},
{"ACPI_LV_DEBUG_OBJECT", ACPI_LV_DEBUG_OBJECT},
{"ACPI_LV_ALL_EXCEPTIONS", ACPI_LV_ALL_EXCEPTIONS},
{"ACPI_LV_THREADS", ACPI_LV_THREADS},
{"ACPI_LV_PARSE", ACPI_LV_PARSE},
{"ACPI_LV_DISPATCH", ACPI_LV_DISPATCH},
{"ACPI_LV_LOAD", ACPI_LV_LOAD},
{"ACPI_LV_EXEC", ACPI_LV_EXEC},
{"ACPI_LV_NAMES", ACPI_LV_NAMES},
{"ACPI_LV_OPREGION", ACPI_LV_OPREGION},
{"ACPI_LV_BFIELD", ACPI_LV_BFIELD},
{"ACPI_LV_TRASH", ACPI_LV_TRASH},
{"ACPI_LV_TABLES", ACPI_LV_TABLES},
{"ACPI_LV_FUNCTIONS", ACPI_LV_FUNCTIONS},
{"ACPI_LV_VALUES", ACPI_LV_VALUES},
{"ACPI_LV_OBJECTS", ACPI_LV_OBJECTS},
{"ACPI_LV_ALLOCATIONS", ACPI_LV_ALLOCATIONS},
{"ACPI_LV_RESOURCES", ACPI_LV_RESOURCES},
{"ACPI_LV_IO", ACPI_LV_IO},
{"ACPI_LV_INTERRUPTS", ACPI_LV_INTERRUPTS},
{"ACPI_LV_USER_REQUESTS", ACPI_LV_USER_REQUESTS},
{"ACPI_LV_PACKAGE", ACPI_LV_PACKAGE},
{"ACPI_LV_MUTEX", ACPI_LV_MUTEX},
{"ACPI_LV_INIT", ACPI_LV_INIT},
{"ACPI_LV_ALL", ACPI_LV_ALL},
{"ACPI_DB_AML_DISASSEMBLE", ACPI_DB_AML_DISASSEMBLE},
{"ACPI_DB_VERBOSE_INFO", ACPI_DB_VERBOSE_INFO},
{"ACPI_DB_FULL_TABLES", ACPI_DB_FULL_TABLES},
{"ACPI_DB_EVENTS", ACPI_DB_EVENTS},
{"ACPI_DB_VERBOSE", ACPI_DB_VERBOSE},
{NULL, 0}
};

View File

@ -49,8 +49,7 @@
#include <dev/acpica/acpivar.h>
#include <dev/acpica/acpiio.h>
/* XXX should use our own malloc class */
MALLOC_DECLARE(M_ACPIDEV);
MALLOC_DEFINE(M_ACPIBATT, "acpibatt", "ACPI generic battery data");
/*
* ACPI Battery Abstruction Layer.
@ -231,7 +230,7 @@ acpi_battery_register(int type, int phys_unit)
struct acpi_batteries *bp;
error = 0;
if ((bp = malloc(sizeof(*bp), M_ACPIDEV, M_NOWAIT)) == NULL) {
if ((bp = malloc(sizeof(*bp), M_ACPIBATT, M_NOWAIT)) == NULL) {
return(ENOMEM);
}
@ -239,7 +238,7 @@ acpi_battery_register(int type, int phys_unit)
bp->battdesc.phys_unit = phys_unit;
if (acpi_batteries_initted == 0) {
if ((error = acpi_battery_init()) != 0) {
free(bp, M_ACPIDEV);
free(bp, M_ACPIBATT);
return(error);
}
}

View File

@ -237,9 +237,9 @@ acpi_cpu_attach(device_t dev)
sc->cpu_p_blk = bus_alloc_resource(sc->cpu_dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
RF_ACTIVE);
DEBUG_PRINT(TRACE_IO, ("acpi_cpu%d: throttling with P_BLK at 0x%x/%d%s\n",
device_get_unit(sc->cpu_dev), p_blk, p_blk_length,
sc->cpu_p_blk ? "" : " (shadowed)"));
ACPI_DEBUG_PRINT((ACPI_DB_IO, "acpi_cpu%d: throttling with P_BLK at 0x%x/%d%s\n",
device_get_unit(sc->cpu_dev), p_blk, p_blk_length,
sc->cpu_p_blk ? "" : " (shadowed)"));
}
}
return_VALUE(0);

View File

@ -367,7 +367,7 @@ acpi_ec_attach(device_t dev)
/*
* Evaluate resources
*/
DEBUG_PRINT(TRACE_RESOURCES, ("parsing EC resources\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "parsing EC resources\n"));
acpi_parse_resources(sc->ec_dev, sc->ec_handle, &acpi_res_parse_set);
/*
@ -397,7 +397,7 @@ acpi_ec_attach(device_t dev)
* Evaluate the _GPE method to find the GPE bit used by the EC to signal
* status (SCI).
*/
DEBUG_PRINT(TRACE_RESOURCES, ("attaching GPE\n"));
ACPI_DEBUG_PRINT((ACPI_DB_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", AcpiFormatException(Status));
return_VALUE(ENXIO);
@ -421,7 +421,7 @@ acpi_ec_attach(device_t dev)
/*
* Install address space handler
*/
DEBUG_PRINT(TRACE_RESOURCES, ("attaching address space handler\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "attaching address space handler\n"));
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",
@ -429,7 +429,7 @@ acpi_ec_attach(device_t dev)
panic("very suck");
return_VALUE(ENXIO);
}
DEBUG_PRINT(TRACE_RESOURCES, ("attach complete\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "attach complete\n"));
return_VALUE(0);
}

View File

@ -247,7 +247,7 @@ acpi_isa_identify_child(ACPI_HANDLE handle, UINT32 level, void *context, void **
if (!device_get_desc(child))
device_set_desc_copy(child, devinfo.HardwareId);
DEBUG_PRINT(TRACE_OBJECTS, ("added ISA PnP info for %s\n", acpi_name(handle)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "added ISA PnP info for %s\n", acpi_name(handle)));
/*
* XXX Parse configuration data and _CID list to find compatible IDs

View File

@ -292,6 +292,8 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
int bus;
int interrupt;
int i;
FUNCTION_TRACE(__func__);
crsbuf.Pointer = NULL;
prsbuf.Pointer = NULL;
@ -393,8 +395,8 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
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)));
DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
/*
* The interrupt may already be routed, so check _CRS first. We don't check the
@ -508,6 +510,6 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
AcpiOsFree(prsbuf.Pointer);
/* XXX APIC_IO interrupt mapping? */
return(interrupt);
return_VALUE(interrupt);
}

View File

@ -292,6 +292,8 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
int bus;
int interrupt;
int i;
FUNCTION_TRACE(__func__);
crsbuf.Pointer = NULL;
prsbuf.Pointer = NULL;
@ -393,8 +395,8 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
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)));
DEBUG_PRINT(TRACE_RESOURCES, ("got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._CRS\n", crsbuf.Length, acpi_name(lnkdev)));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes for %s._PRS\n", prsbuf.Length, acpi_name(lnkdev)));
/*
* The interrupt may already be routed, so check _CRS first. We don't check the
@ -508,6 +510,6 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
AcpiOsFree(prsbuf.Pointer);
/* XXX APIC_IO interrupt mapping? */
return(interrupt);
return_VALUE(interrupt);
}

View File

@ -167,12 +167,12 @@ acpi_pwr_register_resource(ACPI_HANDLE res)
/* get the Power Resource object */
if ((status = acpi_EvaluateIntoBuffer(res, NULL, NULL, &buf)) != AE_OK) {
DEBUG_PRINT(TRACE_OBJECTS, ("no power resource object\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "no power resource object\n"));
goto out;
}
obj = buf.Pointer;
if (obj->Type != ACPI_TYPE_POWER) {
DEBUG_PRINT(TRACE_OBJECTS, ("questionable power resource object %s\n", acpi_name(res)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "questionable power resource object %s\n", acpi_name(res)));
status = AE_TYPE;
goto out;
}
@ -194,7 +194,7 @@ acpi_pwr_register_resource(ACPI_HANDLE res)
TAILQ_INSERT_TAIL(&acpi_powerresources, rp, ap_link);
done:
DEBUG_PRINT(TRACE_OBJECTS, ("registered power resource %s\n", acpi_name(res)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "registered power resource %s\n", acpi_name(res)));
out:
if (obj != NULL)
AcpiOsFree(obj);
@ -227,7 +227,7 @@ acpi_pwr_deregister_resource(ACPI_HANDLE res)
TAILQ_REMOVE(&acpi_powerresources, rp, ap_link);
free(rp, M_ACPIPWR);
DEBUG_PRINT(TRACE_OBJECTS, ("deregistered power resource %s\n", acpi_name(res)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "deregistered power resource %s\n", acpi_name(res)));
return_ACPI_STATUS(AE_OK);
}
@ -257,7 +257,7 @@ acpi_pwr_register_consumer(ACPI_HANDLE consumer)
pc->ac_state = ACPI_STATE_UNKNOWN; /* XXX we should try to find its current state */
DEBUG_PRINT(TRACE_OBJECTS, ("registered power consumer %s\n", acpi_name(consumer)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "registered power consumer %s\n", acpi_name(consumer)));
return_ACPI_STATUS(AE_OK);
}
@ -286,7 +286,7 @@ acpi_pwr_deregister_consumer(ACPI_HANDLE consumer)
/* pull the consumer off the list and free it */
TAILQ_REMOVE(&acpi_powerconsumers, pc, ac_link);
DEBUG_PRINT(TRACE_OBJECTS, ("deregistered power consumer %s\n", acpi_name(consumer)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "deregistered power consumer %s\n", acpi_name(consumer)));
return_ACPI_STATUS(AE_OK);
}
@ -342,8 +342,8 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
default:
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
DEBUG_PRINT(TRACE_OBJECTS, ("setup to switch %s D%d -> D%d\n",
acpi_name(consumer), pc->ac_state, state));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "setup to switch %s D%d -> D%d\n",
acpi_name(consumer), pc->ac_state, state));
/*
* Verify that this state is supported, ie. one of method or
@ -390,14 +390,14 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
*/
if (reslist_handle != NULL) {
if ((status = acpi_EvaluateIntoBuffer(reslist_handle, NULL, NULL, &reslist_buffer)) != AE_OK) {
DEBUG_PRINT(TRACE_OBJECTS, ("can't evaluate resource list %s\n",
acpi_name(reslist_handle)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't evaluate resource list %s\n",
acpi_name(reslist_handle)));
return_ACPI_STATUS(status);
}
reslist_object = (ACPI_OBJECT *)reslist_buffer.Pointer;
if (reslist_object->Type != ACPI_TYPE_PACKAGE) {
DEBUG_PRINT(TRACE_OBJECTS, ("resource list is not ACPI_TYPE_PACKAGE (%d)\n",
reslist_object->Type));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "resource list is not ACPI_TYPE_PACKAGE (%d)\n",
reslist_object->Type));
return_ACPI_STATUS(AE_TYPE);
}
} else {
@ -410,7 +410,7 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
res_changed = 0;
while((pr = TAILQ_FIRST(&pc->ac_references)) != NULL) {
res_changed = 1;
DEBUG_PRINT(TRACE_OBJECTS, ("removing reference to %s\n", acpi_name(pr->ar_resource->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "removing reference to %s\n", acpi_name(pr->ar_resource->ap_resource)));
TAILQ_REMOVE(&pr->ar_resource->ap_references, pr, ar_rlink);
TAILQ_REMOVE(&pc->ac_references, pr, ar_clink);
free(pr, M_ACPIPWR);
@ -422,8 +422,8 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
* of the resources that are referenced.
*/
if (reslist_object != NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("referencing %d new resources\n",
reslist_object->Package.Count));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "referencing %d new resources\n",
reslist_object->Package.Count));
acpi_ForeachPackageObject(reslist_object, acpi_pwr_reference_resource, pc);
res_changed = 1;
}
@ -433,15 +433,15 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
* pass now.
*/
if ((status = acpi_pwr_switch_power()) != AE_OK) {
DEBUG_PRINT(TRACE_OBJECTS, ("failed to correctly switch resources to move %s to D%d\n",
acpi_name(consumer), state));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to correctly switch resources to move %s to D%d\n",
acpi_name(consumer), state));
return_ACPI_STATUS(status); /* XXX is this appropriate? Should we return to previous state? */
}
/* invoke power state switch method (if present) */
if (method_handle != NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("invoking state transition method %s\n",
acpi_name(method_handle)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "invoking state transition method %s\n",
acpi_name(method_handle)));
if ((status = AcpiEvaluateObject(method_handle, NULL, NULL, NULL)) != AE_OK)
pc->ac_state = ACPI_STATE_UNKNOWN;
return_ACPI_STATUS(status); /* XXX is this appropriate? Should we return to previous state? */
@ -452,8 +452,8 @@ acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state)
return_ACPI_STATUS(AE_OK);
bad:
DEBUG_PRINT(TRACE_OBJECTS, ("attempt to set unsupported state D%d\n",
state));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "attempt to set unsupported state D%d\n",
state));
if (reslist_object)
AcpiOsFree(reslist_object);
return_ACPI_STATUS(AE_BAD_PARAMETER);
@ -476,36 +476,36 @@ acpi_pwr_reference_resource(ACPI_OBJECT *obj, void *arg)
/* check the object type */
if (obj->Type != ACPI_TYPE_STRING) {
DEBUG_PRINT(TRACE_OBJECTS, ("don't know how to create a power reference to object type %d\n",
obj->Type));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "don't know how to create a power reference to object type %d\n",
obj->Type));
return_VOID;
}
DEBUG_PRINT(TRACE_OBJECTS, ("building reference from %s to %s\n",
acpi_name(pc->ac_consumer), obj->String.Pointer));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n",
acpi_name(pc->ac_consumer), obj->String.Pointer));
/* get the handle of the resource */
if (ACPI_FAILURE(status = AcpiGetHandle(NULL, obj->String.Pointer, &res))) {
DEBUG_PRINT(TRACE_OBJECTS, ("couldn't find power resource %s\n",
obj->String.Pointer));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't find power resource %s\n",
obj->String.Pointer));
return_VOID;
}
/* 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, AcpiFormatException(status)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't register power resource %s - %s\n",
obj->String.Pointer, AcpiFormatException(status)));
return_VOID;
}
if ((rp = acpi_pwr_find_resource(res)) == NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("power resource list corrupted\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "power resource list corrupted\n"));
return_VOID;
}
DEBUG_PRINT(TRACE_OBJECTS, ("found power resource %s\n", acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "found power resource %s\n", acpi_name(rp->ap_resource)));
/* create a reference between the consumer and resource */
if ((pr = malloc(sizeof(*pr), M_ACPIPWR, M_NOWAIT | M_ZERO)) == NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("couldn't allocate memory for a power consumer reference\n"));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't allocate memory for a power consumer reference\n"));
return_VOID;
}
pr->ar_consumer = pc;
@ -537,15 +537,15 @@ acpi_pwr_switch_power(void)
*/
TAILQ_FOREACH(rp, &acpi_powerresources, ap_link) {
if (TAILQ_FIRST(&rp->ap_references) == NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("%s has no references, not turning on\n",
acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "%s has no references, not turning on\n",
acpi_name(rp->ap_resource)));
continue;
}
/* we could cache this if we trusted it not to change under us */
if ((status = acpi_EvaluateInteger(rp->ap_resource, "_STA", &cur)) != AE_OK) {
DEBUG_PRINT(TRACE_OBJECTS, ("can't get status of %s - %d\n",
acpi_name(rp->ap_resource), status));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n",
acpi_name(rp->ap_resource), status));
continue; /* XXX is this correct? Always switch if in doubt? */
}
@ -556,13 +556,13 @@ 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), AcpiFormatException(status)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to switch %s on - %s\n",
acpi_name(rp->ap_resource), AcpiFormatException(status)));
} else {
DEBUG_PRINT(TRACE_OBJECTS, ("switched %s on\n", acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s on\n", acpi_name(rp->ap_resource)));
}
} else {
DEBUG_PRINT(TRACE_OBJECTS, ("%s is already on\n", acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "%s is already on\n", acpi_name(rp->ap_resource)));
}
}
@ -571,15 +571,15 @@ acpi_pwr_switch_power(void)
*/
TAILQ_FOREACH_REVERSE(rp, &acpi_powerresources, acpi_powerresource_list, ap_link) {
if (TAILQ_FIRST(&rp->ap_references) != NULL) {
DEBUG_PRINT(TRACE_OBJECTS, ("%s has references, not turning off\n",
acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "%s has references, not turning off\n",
acpi_name(rp->ap_resource)));
continue;
}
/* we could cache this if we trusted it not to change under us */
if ((status = acpi_EvaluateInteger(rp->ap_resource, "_STA", &cur)) != AE_OK) {
DEBUG_PRINT(TRACE_OBJECTS, ("can't get status of %s - %d\n",
acpi_name(rp->ap_resource), status));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n",
acpi_name(rp->ap_resource), status));
continue; /* XXX is this correct? Always switch if in doubt? */
}
@ -590,13 +590,13 @@ 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), AcpiFormatException(status)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "failed to switch %s off - %s\n",
acpi_name(rp->ap_resource), AcpiFormatException(status)));
} else {
DEBUG_PRINT(TRACE_OBJECTS, ("switched %s off\n", acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s off\n", acpi_name(rp->ap_resource)));
}
} else {
DEBUG_PRINT(TRACE_OBJECTS, ("%s is already off\n", acpi_name(rp->ap_resource)));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "%s is already off\n", acpi_name(rp->ap_resource)));
}
}
return_ACPI_STATUS(AE_OK);

View File

@ -70,7 +70,7 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resourc
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));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "got %d bytes of resources\n", buf.Length));
set->set_init(dev, &context);
/*
@ -87,42 +87,42 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resourc
*/
switch(res->Id) {
case ACPI_RSTYPE_END_TAG:
DEBUG_PRINT(TRACE_RESOURCES, ("EndTag\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n"));
curr = last;
break;
case ACPI_RSTYPE_FIXED_IO:
DEBUG_PRINT(TRACE_RESOURCES, ("FixedIo 0x%x/%d\n", res->Data.FixedIo.BaseAddress, res->Data.FixedIo.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", res->Data.FixedIo.BaseAddress, res->Data.FixedIo.RangeLength));
set->set_ioport(dev, context, res->Data.FixedIo.BaseAddress, res->Data.FixedIo.RangeLength);
break;
case ACPI_RSTYPE_IO:
if (res->Data.Io.MinBaseAddress == res->Data.Io.MaxBaseAddress) {
DEBUG_PRINT(TRACE_RESOURCES, ("Io 0x%x/%d\n", res->Data.Io.MinBaseAddress, res->Data.Io.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", res->Data.Io.MinBaseAddress, res->Data.Io.RangeLength));
set->set_ioport(dev, context, res->Data.Io.MinBaseAddress, res->Data.Io.RangeLength);
} else {
DEBUG_PRINT(TRACE_RESOURCES, ("Io 0x%x-0x%x/%d\n", res->Data.Io.MinBaseAddress, res->Data.Io.MaxBaseAddress,
res->Data.Io.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", res->Data.Io.MinBaseAddress, res->Data.Io.MaxBaseAddress,
res->Data.Io.RangeLength));
set->set_iorange(dev, context, res->Data.Io.MinBaseAddress, res->Data.Io.MaxBaseAddress,
res->Data.Io.RangeLength, res->Data.Io.Alignment);
}
break;
case ACPI_RSTYPE_FIXED_MEM32:
DEBUG_PRINT(TRACE_RESOURCES, ("FixedMemory32 0x%x/%d\n", res->Data.FixedMemory32.RangeBaseAddress,
res->Data.FixedMemory32.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", res->Data.FixedMemory32.RangeBaseAddress,
res->Data.FixedMemory32.RangeLength));
set->set_memory(dev, context, res->Data.FixedMemory32.RangeBaseAddress,
res->Data.FixedMemory32.RangeLength);
break;
case ACPI_RSTYPE_MEM32:
if (res->Data.Memory32.MinBaseAddress == res->Data.Memory32.MaxBaseAddress) {
DEBUG_PRINT(TRACE_RESOURCES, ("Memory32 0x%x/%d\n", res->Data.Memory32.MinBaseAddress,
res->Data.Memory32.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", res->Data.Memory32.MinBaseAddress,
res->Data.Memory32.RangeLength));
set->set_memory(dev, context, res->Data.Memory32.MinBaseAddress, res->Data.Memory32.RangeLength);
} else {
DEBUG_PRINT(TRACE_RESOURCES, ("Memory32 0x%x-0x%x/%d\n", res->Data.Memory32.MinBaseAddress,
res->Data.Memory32.MaxBaseAddress, res->Data.Memory32.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", res->Data.Memory32.MinBaseAddress,
res->Data.Memory32.MaxBaseAddress, res->Data.Memory32.RangeLength));
set->set_memoryrange(dev, context, res->Data.Memory32.MinBaseAddress, res->Data.Memory32.MaxBaseAddress,
res->Data.Memory32.RangeLength, res->Data.Memory32.Alignment);
}
@ -130,12 +130,12 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resourc
case ACPI_RSTYPE_MEM24:
if (res->Data.Memory24.MinBaseAddress == res->Data.Memory24.MaxBaseAddress) {
DEBUG_PRINT(TRACE_RESOURCES, ("Memory24 0x%x/%d\n", res->Data.Memory24.MinBaseAddress,
res->Data.Memory24.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", res->Data.Memory24.MinBaseAddress,
res->Data.Memory24.RangeLength));
set->set_memory(dev, context, res->Data.Memory24.MinBaseAddress, res->Data.Memory24.RangeLength);
} else {
DEBUG_PRINT(TRACE_RESOURCES, ("Memory24 0x%x-0x%x/%d\n", res->Data.Memory24.MinBaseAddress,
res->Data.Memory24.MaxBaseAddress, res->Data.Memory24.RangeLength));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", res->Data.Memory24.MinBaseAddress,
res->Data.Memory24.MaxBaseAddress, res->Data.Memory24.RangeLength));
set->set_memoryrange(dev, context, res->Data.Memory24.MinBaseAddress, res->Data.Memory24.MaxBaseAddress,
res->Data.Memory24.RangeLength, res->Data.Memory24.Alignment);
}
@ -143,42 +143,42 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resourc
case ACPI_RSTYPE_IRQ:
for (i = 0; i < res->Data.Irq.NumberOfInterrupts; i++) {
DEBUG_PRINT(TRACE_RESOURCES, ("Irq %d\n", res->Data.Irq.Interrupts[i]));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Irq %d\n", res->Data.Irq.Interrupts[i]));
set->set_irq(dev, context, res->Data.Irq.Interrupts[i]);
}
break;
case ACPI_RSTYPE_DMA:
for (i = 0; i < res->Data.Dma.NumberOfChannels; i++) {
DEBUG_PRINT(TRACE_RESOURCES, ("Drq %d\n", res->Data.Dma.Channels[i]));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Drq %d\n", res->Data.Dma.Channels[i]));
set->set_drq(dev, context, res->Data.Dma.Channels[i]);
}
break;
case ACPI_RSTYPE_START_DPF:
DEBUG_PRINT(TRACE_RESOURCES, ("start dependant functions"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependant functions"));
set->set_start_dependant(dev, context, res->Data.StartDpf.CompatibilityPriority);
break;
case ACPI_RSTYPE_END_DPF:
DEBUG_PRINT(TRACE_RESOURCES, ("end dependant functions"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependant functions"));
set->set_end_dependant(dev, context);
break;
case ACPI_RSTYPE_ADDRESS32:
DEBUG_PRINT(TRACE_RESOURCES, ("unimplemented Address32 resource\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "unimplemented Address32 resource\n"));
break;
case ACPI_RSTYPE_ADDRESS16:
DEBUG_PRINT(TRACE_RESOURCES, ("unimplemented Address16 resource\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "unimplemented Address16 resource\n"));
break;
case ACPI_RSTYPE_EXT_IRQ:
DEBUG_PRINT(TRACE_RESOURCES, ("unimplemented ExtendedIrq resource\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "unimplemented ExtendedIrq resource\n"));
break;
case ACPI_RSTYPE_VENDOR:
DEBUG_PRINT(TRACE_RESOURCES, ("unimplemented VendorSpecific resource\n"));
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "unimplemented VendorSpecific resource\n"));
break;
default:
break;

View File

@ -346,7 +346,7 @@ acpi_tz_monitor(struct acpi_tz_softc *sc)
/* XXX disable zone? go to max cooling? */
return_VOID;
}
DEBUG_PRINT(TRACE_VALUES, ("got %d.%dC\n", TZ_KELVTOC(temp)));
ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "got %d.%dC\n", TZ_KELVTOC(temp)));
sc->tz_temperature = temp;
/*
@ -461,7 +461,7 @@ acpi_tz_switch_cooler_off(ACPI_OBJECT *obj, void *arg)
switch(obj->Type) {
case ACPI_TYPE_STRING:
DEBUG_PRINT(TRACE_OBJECTS, ("called to turn %s off\n", obj->String.Pointer));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s off\n", obj->String.Pointer));
/*
* Find the handle for the device and turn it off.
@ -475,8 +475,8 @@ acpi_tz_switch_cooler_off(ACPI_OBJECT *obj, void *arg)
break;
default:
DEBUG_PRINT(TRACE_OBJECTS, ("called to handle unsupported object type %d\n",
obj->Type));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to handle unsupported object type %d\n",
obj->Type));
break;
}
return_VOID;
@ -501,7 +501,7 @@ acpi_tz_switch_cooler_on(ACPI_OBJECT *obj, void *arg)
switch(obj->Type) {
case ACPI_TYPE_STRING:
DEBUG_PRINT(TRACE_OBJECTS, ("called to turn %s on\n", obj->String.Pointer));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s on\n", obj->String.Pointer));
/*
* Find the handle for the device and turn it off.
@ -521,8 +521,8 @@ acpi_tz_switch_cooler_on(ACPI_OBJECT *obj, void *arg)
break;
default:
DEBUG_PRINT(TRACE_OBJECTS, ("called to handle unsupported object type %d\n",
obj->Type));
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to handle unsupported object type %d\n",
obj->Type));
break;
}
return_VOID;
@ -542,8 +542,8 @@ acpi_tz_getparam(struct acpi_tz_softc *sc, char *node, int *data)
if (acpi_EvaluateInteger(sc->tz_handle, node, data) != AE_OK) {
*data = -1;
} else {
DEBUG_PRINT(TRACE_VALUES, ("%s.%s = %d\n", acpi_name(sc->tz_handle),
node, *data));
ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "%s.%s = %d\n", acpi_name(sc->tz_handle),
node, *data));
}
return_VOID;
}