aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/namespace
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-01-27 16:43:00 -0500
committerLen Brown <len.brown@intel.com>2006-01-31 03:25:09 -0500
commitb8e4d89357fc434618a59c1047cac72641191805 (patch)
treeac97fcc6fdc277c682365900663872c96f2420bd /drivers/acpi/namespace
parent292dd876ee765c478b27c93cc51e93a558ed58bf (diff)
[ACPI] ACPICA 20060127
Implemented support in the Resource Manager to allow unresolved namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support within the AML parser. If the interpreter slack mode is enabled (true on Linux unless acpi=strict), these unresolved references will be passed through to the caller as a NULL package entry. http://bugzilla.kernel.org/show_bug.cgi?id=5741 Implemented and deployed new macros and functions for error and warning messages across the subsystem. These macros are simpler and generate less code than their predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION, ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. Implemented the acpi_cpu_flags type to simplify host OS integration of the Acquire/Release Lock OSL interfaces. Suggested by Steven Rostedt and Andrew Morton. Fixed a problem where Alias ASL operators are sometimes not correctly resolved. causing AE_AML_INTERNAL http://bugzilla.kernel.org/show_bug.cgi?id=5189 http://bugzilla.kernel.org/show_bug.cgi?id=5674 Fixed several problems with the implementation of the ConcatenateResTemplate ASL operator. As per the ACPI specification, zero length buffers are now treated as a single EndTag. One-length buffers always cause a fatal exception. Non-zero length buffers that do not end with a full 2-byte EndTag cause a fatal exception. Fixed a possible structure overwrite in the AcpiGetObjectInfo external interface. (With assistance from Thomas Renninger) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace')
-rw-r--r--drivers/acpi/namespace/nsaccess.c29
-rw-r--r--drivers/acpi/namespace/nsalloc.c8
-rw-r--r--drivers/acpi/namespace/nsdump.c8
-rw-r--r--drivers/acpi/namespace/nseval.c2
-rw-r--r--drivers/acpi/namespace/nsinit.c18
-rw-r--r--drivers/acpi/namespace/nsload.c8
-rw-r--r--drivers/acpi/namespace/nsnames.c6
-rw-r--r--drivers/acpi/namespace/nsobject.c11
-rw-r--r--drivers/acpi/namespace/nssearch.c8
-rw-r--r--drivers/acpi/namespace/nsutils.c12
-rw-r--r--drivers/acpi/namespace/nsxfeval.c18
-rw-r--r--drivers/acpi/namespace/nsxfname.c3
12 files changed, 75 insertions, 56 deletions
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c
index c2db93e25b7..1149bc18fb3 100644
--- a/drivers/acpi/namespace/nsaccess.c
+++ b/drivers/acpi/namespace/nsaccess.c
@@ -110,7 +110,9 @@ acpi_status acpi_ns_root_initialize(void)
ACPI_NS_NO_UPSEARCH, NULL, &new_node);
if (ACPI_FAILURE(status) || (!new_node)) { /* Must be on same line for code converter */
- ACPI_REPORT_ERROR(("Could not create predefined name %s, %s\n", init_val->name, acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not create predefined name %s",
+ init_val->name));
}
/*
@@ -121,7 +123,9 @@ acpi_status acpi_ns_root_initialize(void)
if (init_val->val) {
status = acpi_os_predefined_override(init_val, &val);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("Could not override predefined %s\n", init_val->name));
+ ACPI_ERROR((AE_INFO,
+ "Could not override predefined %s",
+ init_val->name));
}
if (!val) {
@@ -228,7 +232,9 @@ acpi_status acpi_ns_root_initialize(void)
default:
- ACPI_REPORT_ERROR(("Unsupported initial type value %X\n", init_val->type));
+ ACPI_ERROR((AE_INFO,
+ "Unsupported initial type value %X",
+ init_val->type));
acpi_ut_remove_reference(obj_desc);
obj_desc = NULL;
continue;
@@ -334,10 +340,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
prefix_node = scope_info->scope.node;
if (ACPI_GET_DESCRIPTOR_TYPE(prefix_node) !=
ACPI_DESC_TYPE_NAMED) {
- ACPI_REPORT_ERROR(("%p is not a namespace node [%s]\n",
- prefix_node,
- acpi_ut_get_descriptor_name
- (prefix_node)));
+ ACPI_ERROR((AE_INFO, "%p is not a namespace node [%s]",
+ prefix_node,
+ acpi_ut_get_descriptor_name(prefix_node)));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -427,7 +432,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
if (!this_node) {
/* Current scope has no parent scope */
- ACPI_REPORT_ERROR(("ACPI path has too many parent prefixes (^) - reached beyond root node\n"));
+ ACPI_ERROR((AE_INFO,
+ "ACPI path has too many parent prefixes (^) - reached beyond root node"));
return_ACPI_STATUS(AE_NOT_FOUND);
}
}
@@ -598,7 +604,12 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
(this_node->type != type_to_check_for)) {
/* Complain about a type mismatch */
- ACPI_REPORT_WARNING(("ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n", ACPI_CAST_PTR(char, &simple_name), acpi_ut_get_type_name(this_node->type), acpi_ut_get_type_name(type_to_check_for)));
+ ACPI_WARNING((AE_INFO,
+ "ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)",
+ ACPI_CAST_PTR(char, &simple_name),
+ acpi_ut_get_type_name(this_node->type),
+ acpi_ut_get_type_name
+ (type_to_check_for)));
}
/*
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index 3db950f5d5a..9b871f38b61 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -272,8 +272,8 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
/* Grandchildren should have all been deleted already */
if (child_node->child) {
- ACPI_REPORT_ERROR(("Found a grandchild! P=%p C=%p\n",
- parent_node, child_node));
+ ACPI_ERROR((AE_INFO, "Found a grandchild! P=%p C=%p",
+ parent_node, child_node));
}
/* Now we can free this child object */
@@ -301,7 +301,9 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
/* There should be only one reference remaining on this node */
if (child_node->reference_count != 1) {
- ACPI_REPORT_WARNING(("Existing references (%d) on node being deleted (%p)\n", child_node->reference_count, child_node));
+ ACPI_WARNING((AE_INFO,
+ "Existing references (%d) on node being deleted (%p)",
+ child_node->reference_count, child_node));
}
/* Now we can delete the node */
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 2f0b70e3e88..a2807317a84 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -198,13 +198,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
/* Check the node type and name */
if (type > ACPI_TYPE_LOCAL_MAX) {
- ACPI_REPORT_WARNING(("Invalid ACPI Object Type %08X\n",
- type));
+ ACPI_WARNING((AE_INFO, "Invalid ACPI Object Type %08X",
+ type));
}
if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
- ACPI_REPORT_WARNING(("Invalid ACPI Name %08X\n",
- this_node->name.integer));
+ ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X",
+ this_node->name.integer));
}
acpi_os_printf("%4.4s", acpi_ut_get_node_name(this_node));
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c
index e3c667072e2..19d7b94d40c 100644
--- a/drivers/acpi/namespace/nseval.c
+++ b/drivers/acpi/namespace/nseval.c
@@ -373,7 +373,7 @@ acpi_ns_execute_control_method(struct acpi_parameter_info *info)
info->obj_desc = acpi_ns_get_attached_object(info->node);
if (!info->obj_desc) {
- ACPI_REPORT_ERROR(("No attached method object\n"));
+ ACPI_ERROR((AE_INFO, "No attached method object"));
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
return_ACPI_STATUS(AE_NULL_OBJECT);
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c
index 6c117893f30..9f929e479fd 100644
--- a/drivers/acpi/namespace/nsinit.c
+++ b/drivers/acpi/namespace/nsinit.c
@@ -93,8 +93,7 @@ acpi_status acpi_ns_initialize_objects(void)
ACPI_UINT32_MAX, acpi_ns_init_one_object,
&info, NULL);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("walk_namespace failed! %s\n",
- acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status, "During walk_namespace"));
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
@@ -159,12 +158,11 @@ acpi_status acpi_ns_initialize_devices(void)
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("walk_namespace failed! %s\n",
- acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status, "During walk_namespace"));
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
- "\n%hd Devices found containing: %hd _STA, %hd _INI methods\n",
+ "\n%hd Devices found - executed %hd _STA, %hd _INI methods\n",
info.device_count, info.num_STA, info.num_INI));
return_ACPI_STATUS(status);
@@ -289,7 +287,10 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
}
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("\nCould not execute arguments for [%4.4s] (%s), %s\n", acpi_ut_get_node_name(node), acpi_ut_get_type_name(type), acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not execute arguments for [%4.4s] (%s)",
+ acpi_ut_get_node_name(node),
+ acpi_ut_get_type_name(type)));
}
/*
@@ -416,9 +417,8 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
#ifdef ACPI_DEBUG_OUTPUT
char *scope_name = acpi_ns_get_external_pathname(ini_node);
- ACPI_REPORT_WARNING(("%s._INI failed: %s\n",
- scope_name,
- acpi_format_exception(status)));
+ ACPI_WARNING((AE_INFO, "%s._INI failed: %s",
+ scope_name, acpi_format_exception(status)));
ACPI_MEM_FREE(scope_name);
#endif
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 0b4a866ef5a..4e0b0524c18 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -92,7 +92,7 @@ acpi_ns_load_table(struct acpi_table_desc *table_desc,
/* Check validity of the AML start and length */
if (!table_desc->aml_start) {
- ACPI_REPORT_ERROR(("Null AML pointer\n"));
+ ACPI_ERROR((AE_INFO, "Null AML pointer"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
@@ -102,8 +102,8 @@ acpi_ns_load_table(struct acpi_table_desc *table_desc,
/* Ignore table if there is no AML contained within */
if (!table_desc->aml_length) {
- ACPI_REPORT_WARNING(("Zero-length AML block in table [%4.4s]\n",
- table_desc->pointer->signature));
+ ACPI_WARNING((AE_INFO, "Zero-length AML block in table [%4.4s]",
+ table_desc->pointer->signature));
return_ACPI_STATUS(AE_OK);
}
@@ -263,7 +263,7 @@ acpi_status acpi_ns_load_namespace(void)
/* There must be at least a DSDT installed */
if (acpi_gbl_DSDT == NULL) {
- ACPI_REPORT_ERROR(("DSDT is not in memory\n"));
+ ACPI_ERROR((AE_INFO, "DSDT is not in memory"));
return_ACPI_STATUS(AE_NO_ACPI_TABLES);
}
diff --git a/drivers/acpi/namespace/nsnames.c b/drivers/acpi/namespace/nsnames.c
index 411e1f8b11d..639f653b4b6 100644
--- a/drivers/acpi/namespace/nsnames.c
+++ b/drivers/acpi/namespace/nsnames.c
@@ -110,7 +110,9 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
name_buffer[index] = AML_ROOT_PREFIX;
if (index != 0) {
- ACPI_REPORT_ERROR(("Could not construct pathname; index=%X, size=%X, Path=%s\n", (u32) index, (u32) size, &name_buffer[size]));
+ ACPI_ERROR((AE_INFO,
+ "Could not construct pathname; index=%X, size=%X, Path=%s",
+ (u32) index, (u32) size, &name_buffer[size]));
}
return;
@@ -146,7 +148,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
name_buffer = ACPI_MEM_CALLOCATE(size);
if (!name_buffer) {
- ACPI_REPORT_ERROR(("Allocation failure\n"));
+ ACPI_ERROR((AE_INFO, "Allocation failure"));
return_PTR(NULL);
}
diff --git a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c
index 86113093f7b..10ae6292bca 100644
--- a/drivers/acpi/namespace/nsobject.c
+++ b/drivers/acpi/namespace/nsobject.c
@@ -84,22 +84,23 @@ acpi_ns_attach_object(struct acpi_namespace_node *node,
if (!node) {
/* Invalid handle */
- ACPI_REPORT_ERROR(("Null named_obj handle\n"));
+ ACPI_ERROR((AE_INFO, "Null named_obj handle"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
if (!object && (ACPI_TYPE_ANY != type)) {
/* Null object */
- ACPI_REPORT_ERROR(("Null object, but type not ACPI_TYPE_ANY\n"));
+ ACPI_ERROR((AE_INFO,
+ "Null object, but type not ACPI_TYPE_ANY"));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
/* Not a name handle */
- ACPI_REPORT_ERROR(("Invalid handle %p [%s]\n",
- node, acpi_ut_get_descriptor_name(node)));
+ ACPI_ERROR((AE_INFO, "Invalid handle %p [%s]",
+ node, acpi_ut_get_descriptor_name(node)));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
@@ -254,7 +255,7 @@ union acpi_operand_object *acpi_ns_get_attached_object(struct
ACPI_FUNCTION_TRACE_PTR("ns_get_attached_object", node);
if (!node) {
- ACPI_REPORT_WARNING(("Null Node ptr\n"));
+ ACPI_WARNING((AE_INFO, "Null Node ptr"));
return_PTR(NULL);
}
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
index f094a2eb851..d64b78952f2 100644
--- a/drivers/acpi/namespace/nssearch.c
+++ b/drivers/acpi/namespace/nssearch.c
@@ -298,15 +298,17 @@ acpi_ns_search_and_enter(u32 target_name,
/* Parameter validation */
if (!node || !target_name || !return_node) {
- ACPI_REPORT_ERROR(("Null param: Node %p Name %X return_node %p\n", node, target_name, return_node));
+ ACPI_ERROR((AE_INFO,
+ "Null param: Node %p Name %X return_node %p",
+ node, target_name, return_node));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
/* Name must consist of printable characters */
if (!acpi_ut_valid_acpi_name(target_name)) {
- ACPI_REPORT_ERROR(("Bad character in ACPI Name: %X\n",
- target_name));
+ ACPI_ERROR((AE_INFO, "Bad character in ACPI Name: %X",
+ target_name));
return_ACPI_STATUS(AE_BAD_CHARACTER);
}
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
index bc779fdd3ca..3e7cad549a3 100644
--- a/drivers/acpi/namespace/nsutils.c
+++ b/drivers/acpi/namespace/nsutils.c
@@ -85,7 +85,7 @@ acpi_ns_report_error(char *module_name,
if (lookup_status == AE_BAD_CHARACTER) {
/* There is a non-ascii character in the name */
- acpi_os_printf("[0x%4.4X] (NON-ASCII)\n",
+ acpi_os_printf("[0x%4.4X] (NON-ASCII)",
*(ACPI_CAST_PTR(u32, internal_name)));
} else {
/* Convert path to external format */
@@ -106,7 +106,7 @@ acpi_ns_report_error(char *module_name,
}
}
- acpi_os_printf("Namespace lookup failure, %s\n",
+ acpi_os_printf(" Namespace lookup failure, %s\n",
acpi_format_exception(lookup_status));
}
@@ -242,7 +242,7 @@ acpi_object_type acpi_ns_get_type(struct acpi_namespace_node * node)
ACPI_FUNCTION_TRACE("ns_get_type");
if (!node) {
- ACPI_REPORT_WARNING(("Null Node parameter\n"));
+ ACPI_WARNING((AE_INFO, "Null Node parameter"));
return_UINT32(ACPI_TYPE_ANY);
}
@@ -269,7 +269,7 @@ u32 acpi_ns_local(acpi_object_type type)
if (!acpi_ut_valid_object_type(type)) {
/* Type code out of range */
- ACPI_REPORT_WARNING(("Invalid Object Type %X\n", type));
+ ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type));
return_UINT32(ACPI_NS_NORMAL);
}
@@ -621,7 +621,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
* with internal_name (invalid format).
*/
if (required_length > internal_name_length) {
- ACPI_REPORT_ERROR(("Invalid internal name\n"));
+ ACPI_ERROR((AE_INFO, "Invalid internal name"));
return_ACPI_STATUS(AE_BAD_PATHNAME);
}
@@ -797,7 +797,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
if (!acpi_ut_valid_object_type(type)) {
/* type code out of range */
- ACPI_REPORT_WARNING(("Invalid Object Type %X\n", type));
+ ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type));
return_UINT32(ACPI_NS_NORMAL);
}
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index de13add43ef..a95f636dc35 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -112,7 +112,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
if (return_buffer->length == 0) {
/* Error because caller specifically asked for a return value */
- ACPI_REPORT_ERROR(("No return value\n"));
+ ACPI_ERROR((AE_INFO, "No return value"));
return_ACPI_STATUS(AE_NULL_OBJECT);
}
@@ -124,11 +124,11 @@ acpi_evaluate_object_typed(acpi_handle handle,
/* Return object type does not match requested type */
- ACPI_REPORT_ERROR(("Incorrect return type [%s] requested [%s]\n",
- acpi_ut_get_type_name(((union acpi_object *)
- return_buffer->pointer)->
- type),
- acpi_ut_get_type_name(return_type)));
+ ACPI_ERROR((AE_INFO,
+ "Incorrect return type [%s] requested [%s]",
+ acpi_ut_get_type_name(((union acpi_object *)return_buffer->
+ pointer)->type),
+ acpi_ut_get_type_name(return_type)));
if (must_free) {
/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
@@ -235,9 +235,11 @@ acpi_evaluate_object(acpi_handle handle,
* qualified names above, this is an error
*/
if (!pathname) {
- ACPI_REPORT_ERROR(("Both Handle and Pathname are NULL\n"));
+ ACPI_ERROR((AE_INFO,
+ "Both Handle and Pathname are NULL"));
} else {
- ACPI_REPORT_ERROR(("Handle is NULL and Pathname is relative\n"));
+ ACPI_ERROR((AE_INFO,
+ "Handle is NULL and Pathname is relative"));
}
status = AE_BAD_PARAMETER;
diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c
index 853e6d170c9..8cd8675a47c 100644
--- a/drivers/acpi/namespace/nsxfname.c
+++ b/drivers/acpi/namespace/nsxfname.c
@@ -300,8 +300,7 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer)
status = acpi_ut_execute_CID(node, &cid_list);
if (ACPI_SUCCESS(status)) {
- size += ((acpi_size) cid_list->count - 1) *
- sizeof(struct acpi_compatible_id);
+ size += cid_list->size;
info->valid |= ACPI_VALID_CID;
}