mirror of https://gitee.com/openkylin/linux.git
ACPICA: Debugger: Add Package support for "test objects" command
This was missing in the initial implementation of "test objects". Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
4032cc3e51
commit
db2e11a7c2
|
@ -30,6 +30,8 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length);
|
||||||
static acpi_status
|
static acpi_status
|
||||||
acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
|
acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
|
||||||
|
|
||||||
|
static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node);
|
||||||
|
|
||||||
static acpi_status
|
static acpi_status
|
||||||
acpi_db_read_from_object(struct acpi_namespace_node *node,
|
acpi_db_read_from_object(struct acpi_namespace_node *node,
|
||||||
acpi_object_type expected_type,
|
acpi_object_type expected_type,
|
||||||
|
@ -273,6 +275,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
|
||||||
bit_length = byte_length * 8;
|
bit_length = byte_length * 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ACPI_TYPE_PACKAGE:
|
||||||
|
|
||||||
|
local_type = ACPI_TYPE_PACKAGE;
|
||||||
|
break;
|
||||||
|
|
||||||
case ACPI_TYPE_FIELD_UNIT:
|
case ACPI_TYPE_FIELD_UNIT:
|
||||||
case ACPI_TYPE_BUFFER_FIELD:
|
case ACPI_TYPE_BUFFER_FIELD:
|
||||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||||
|
@ -305,6 +312,7 @@ acpi_db_test_one_object(acpi_handle obj_handle,
|
||||||
|
|
||||||
acpi_os_printf("%14s: %4.4s",
|
acpi_os_printf("%14s: %4.4s",
|
||||||
acpi_ut_get_type_name(node->type), node->name.ascii);
|
acpi_ut_get_type_name(node->type), node->name.ascii);
|
||||||
|
|
||||||
if (!obj_desc) {
|
if (!obj_desc) {
|
||||||
acpi_os_printf(" Ignoring, no attached object\n");
|
acpi_os_printf(" Ignoring, no attached object\n");
|
||||||
return (AE_OK);
|
return (AE_OK);
|
||||||
|
@ -359,6 +367,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
|
||||||
status = acpi_db_test_buffer_type(node, bit_length);
|
status = acpi_db_test_buffer_type(node, bit_length);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ACPI_TYPE_PACKAGE:
|
||||||
|
|
||||||
|
status = acpi_db_test_package_type(node);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
|
acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
|
||||||
|
@ -366,6 +379,13 @@ acpi_db_test_one_object(acpi_handle obj_handle,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Exit on error, but don't abort the namespace walk */
|
||||||
|
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
status = AE_OK;
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||||
|
|
||||||
|
@ -373,12 +393,14 @@ acpi_db_test_one_object(acpi_handle obj_handle,
|
||||||
acpi_os_printf(" (%s)",
|
acpi_os_printf(" (%s)",
|
||||||
acpi_ut_get_region_name(region_obj->region.
|
acpi_ut_get_region_name(region_obj->region.
|
||||||
space_id));
|
space_id));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit:
|
||||||
acpi_os_printf("\n");
|
acpi_os_printf("\n");
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
@ -431,7 +453,6 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
|
||||||
if (temp1->integer.value == value_to_write) {
|
if (temp1->integer.value == value_to_write) {
|
||||||
value_to_write = 0;
|
value_to_write = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a new value */
|
/* Write a new value */
|
||||||
|
|
||||||
write_value.type = ACPI_TYPE_INTEGER;
|
write_value.type = ACPI_TYPE_INTEGER;
|
||||||
|
@ -706,6 +727,35 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* FUNCTION: acpi_db_test_package_type
|
||||||
|
*
|
||||||
|
* PARAMETERS: node - Parent NS node for the object
|
||||||
|
*
|
||||||
|
* RETURN: Status
|
||||||
|
*
|
||||||
|
* DESCRIPTION: Test read for a Package object.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node)
|
||||||
|
{
|
||||||
|
union acpi_object *temp1 = NULL;
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
|
/* Read the original value */
|
||||||
|
|
||||||
|
status = acpi_db_read_from_object(node, ACPI_TYPE_PACKAGE, &temp1);
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
return (status);
|
||||||
|
}
|
||||||
|
|
||||||
|
acpi_os_printf(" %8.8X Elements", temp1->package.count);
|
||||||
|
acpi_os_free(temp1);
|
||||||
|
return (status);
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* FUNCTION: acpi_db_read_from_object
|
* FUNCTION: acpi_db_read_from_object
|
||||||
|
@ -746,8 +796,8 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
|
||||||
acpi_gbl_method_executing = TRUE;
|
acpi_gbl_method_executing = TRUE;
|
||||||
status = acpi_evaluate_object(read_handle, NULL,
|
status = acpi_evaluate_object(read_handle, NULL,
|
||||||
¶m_objects, &return_obj);
|
¶m_objects, &return_obj);
|
||||||
acpi_gbl_method_executing = FALSE;
|
|
||||||
|
|
||||||
|
acpi_gbl_method_executing = FALSE;
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
acpi_os_printf("Could not read from object, %s",
|
acpi_os_printf("Could not read from object, %s",
|
||||||
acpi_format_exception(status));
|
acpi_format_exception(status));
|
||||||
|
@ -760,6 +810,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
|
||||||
case ACPI_TYPE_INTEGER:
|
case ACPI_TYPE_INTEGER:
|
||||||
case ACPI_TYPE_BUFFER:
|
case ACPI_TYPE_BUFFER:
|
||||||
case ACPI_TYPE_STRING:
|
case ACPI_TYPE_STRING:
|
||||||
|
case ACPI_TYPE_PACKAGE:
|
||||||
/*
|
/*
|
||||||
* Did we receive the type we wanted? Most important for the
|
* Did we receive the type we wanted? Most important for the
|
||||||
* Integer/Buffer case (when a field is larger than an Integer,
|
* Integer/Buffer case (when a field is larger than an Integer,
|
||||||
|
@ -771,6 +822,7 @@ acpi_db_read_from_object(struct acpi_namespace_node *node,
|
||||||
acpi_ut_get_type_name(expected_type),
|
acpi_ut_get_type_name(expected_type),
|
||||||
acpi_ut_get_type_name(ret_value->type));
|
acpi_ut_get_type_name(ret_value->type));
|
||||||
|
|
||||||
|
acpi_os_free(return_obj.pointer);
|
||||||
return (AE_TYPE);
|
return (AE_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue