You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[ACPI] ACPICA 20050729 from Bob Moore
Implemented support to ignore an attempt to install/load a particular ACPI table more than once. Apparently there exists BIOS code that repeatedly attempts to load the same SSDT upon certain events. Thanks to Venkatesh Pallipadi. Restructured the main interface to the AML parser in order to correctly handle all exceptional conditions. This will prevent leakage of the OwnerId resource and should eliminate the AE_OWNER_ID_LIMIT exceptions seen on some machines. Thanks to Alexey Starikovskiy. Support for "module level code" has been disabled in this version due to a number of issues that have appeared on various machines. The support can be enabled by defining ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem compilation. When the issues are fully resolved, the code will be enabled by default again. Modified the internal functions for debug print support to define the FunctionName parameter as a (const char *) for compatibility with compiler built-in macros such as __FUNCTION__, etc. Linted the entire ACPICA source tree for both 32-bit and 64-bit. Signed-off-by: Robert Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
@@ -86,20 +86,20 @@ acpi_ds_init_one_object (
|
||||
void *context,
|
||||
void **return_value)
|
||||
{
|
||||
struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
|
||||
struct acpi_namespace_node *node = (struct acpi_namespace_node *) obj_handle;
|
||||
acpi_object_type type;
|
||||
acpi_status status;
|
||||
struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME ("ds_init_one_object");
|
||||
|
||||
|
||||
/*
|
||||
* We are only interested in objects owned by the table that
|
||||
* We are only interested in NS nodes owned by the table that
|
||||
* was just loaded
|
||||
*/
|
||||
if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
|
||||
info->table_desc->owner_id) {
|
||||
if (node->owner_id != info->table_desc->owner_id) {
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -126,8 +126,6 @@ acpi_ds_init_one_object (
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
info->method_count++;
|
||||
|
||||
/*
|
||||
* Print a dot for each method unless we are going to print
|
||||
* the entire pathname
|
||||
@@ -143,7 +141,7 @@ acpi_ds_init_one_object (
|
||||
* on a per-table basis. Currently, we just use a global for the width.
|
||||
*/
|
||||
if (info->table_desc->pointer->revision == 1) {
|
||||
((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
|
||||
node->flags |= ANOBJ_DATA_WIDTH_32;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -153,22 +151,14 @@ acpi_ds_init_one_object (
|
||||
status = acpi_ds_parse_method (obj_handle);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
|
||||
"Method %p [%4.4s] - parse failure, %s\n",
|
||||
"\n+Method %p [%4.4s] - parse failure, %s\n",
|
||||
obj_handle, acpi_ut_get_node_name (obj_handle),
|
||||
acpi_format_exception (status)));
|
||||
|
||||
/* This parse failed, but we will continue parsing more methods */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete the parse tree. We simply re-parse the method
|
||||
* for every execution since there isn't much overhead
|
||||
*/
|
||||
acpi_ns_delete_namespace_subtree (obj_handle);
|
||||
acpi_ns_delete_namespace_by_owner (
|
||||
((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
|
||||
info->method_count++;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
@@ -58,12 +58,11 @@
|
||||
*
|
||||
* FUNCTION: acpi_ds_parse_method
|
||||
*
|
||||
* PARAMETERS: obj_handle - Method node
|
||||
* PARAMETERS: Node - Method node
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Call the parser and parse the AML that is associated with the
|
||||
* method.
|
||||
* DESCRIPTION: Parse the AML that is associated with the method.
|
||||
*
|
||||
* MUTEX: Assumes parser is locked
|
||||
*
|
||||
@@ -71,30 +70,28 @@
|
||||
|
||||
acpi_status
|
||||
acpi_ds_parse_method (
|
||||
acpi_handle obj_handle)
|
||||
struct acpi_namespace_node *node)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *obj_desc;
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_namespace_node *node;
|
||||
struct acpi_walk_state *walk_state;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
|
||||
ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);
|
||||
|
||||
|
||||
/* Parameter Validation */
|
||||
|
||||
if (!obj_handle) {
|
||||
if (!node) {
|
||||
return_ACPI_STATUS (AE_NULL_ENTRY);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
|
||||
acpi_ut_get_node_name (obj_handle), obj_handle));
|
||||
acpi_ut_get_node_name (node), node));
|
||||
|
||||
/* Extract the method object from the method Node */
|
||||
|
||||
node = (struct acpi_namespace_node *) obj_handle;
|
||||
obj_desc = acpi_ns_get_attached_object (node);
|
||||
if (!obj_desc) {
|
||||
return_ACPI_STATUS (AE_NULL_OBJECT);
|
||||
@@ -169,10 +166,18 @@ acpi_ds_parse_method (
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
|
||||
acpi_ut_get_node_name (obj_handle), obj_handle, op));
|
||||
acpi_ut_get_node_name (node), node, op));
|
||||
|
||||
/*
|
||||
* Delete the parse tree. We simply re-parse the method for every
|
||||
* execution since there isn't much overhead (compared to keeping lots
|
||||
* of parse trees around)
|
||||
*/
|
||||
acpi_ns_delete_namespace_subtree (node);
|
||||
acpi_ns_delete_namespace_by_owner (obj_desc->method.owner_id);
|
||||
|
||||
cleanup2:
|
||||
(void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
|
||||
acpi_ut_release_owner_id (&obj_desc->method.owner_id);
|
||||
|
||||
cleanup:
|
||||
acpi_ps_delete_parse_tree (op);
|
||||
@@ -391,7 +396,7 @@ acpi_ds_call_control_method (
|
||||
/* On error, we must delete the new walk state */
|
||||
|
||||
cleanup:
|
||||
(void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
|
||||
acpi_ut_release_owner_id (&obj_desc->method.owner_id);
|
||||
if (next_walk_state && (next_walk_state->method_desc)) {
|
||||
/* Decrement the thread count on the method parse tree */
|
||||
|
||||
@@ -563,8 +568,7 @@ acpi_ds_terminate_control_method (
|
||||
*/
|
||||
if ((walk_state->method_desc->method.concurrency == 1) &&
|
||||
(!walk_state->method_desc->method.semaphore)) {
|
||||
status = acpi_os_create_semaphore (1,
|
||||
1,
|
||||
status = acpi_os_create_semaphore (1, 1,
|
||||
&walk_state->method_desc->method.semaphore);
|
||||
}
|
||||
|
||||
@@ -595,6 +599,8 @@ acpi_ds_terminate_control_method (
|
||||
*/
|
||||
acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
|
||||
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
|
||||
acpi_ut_release_owner_id (&walk_state->method_desc->method.owner_id);
|
||||
|
||||
if (ACPI_FAILURE (status)) {
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ acpi_ds_init_aml_walk (
|
||||
u8 *aml_start,
|
||||
u32 aml_length,
|
||||
struct acpi_parameter_info *info,
|
||||
u32 pass_number)
|
||||
u8 pass_number)
|
||||
{
|
||||
acpi_status status;
|
||||
struct acpi_parse_state *parser_state = &walk_state->parser_state;
|
||||
@@ -762,7 +762,7 @@ acpi_ds_init_aml_walk (
|
||||
/* The next_op of the next_walk will be the beginning of the method */
|
||||
|
||||
walk_state->next_op = NULL;
|
||||
walk_state->pass_number = (u8) pass_number;
|
||||
walk_state->pass_number = pass_number;
|
||||
|
||||
if (info) {
|
||||
if (info->parameter_type == ACPI_PARAM_GPE) {
|
||||
|
||||
@@ -411,6 +411,9 @@ acpi_ev_init_global_lock_handler (
|
||||
* with an error.
|
||||
*/
|
||||
if (status == AE_NO_HARDWARE_RESPONSE) {
|
||||
ACPI_REPORT_ERROR ((
|
||||
"No response from Global Lock hardware, disabling lock\n"));
|
||||
|
||||
acpi_gbl_global_lock_present = FALSE;
|
||||
status = AE_OK;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,11 @@ acpi_ex_add_table (
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Init the table handle */
|
||||
|
||||
obj_desc->reference.opcode = AML_LOAD_OP;
|
||||
*ddb_handle = obj_desc;
|
||||
|
||||
/* Install the new table into the local data structures */
|
||||
|
||||
ACPI_MEMSET (&table_info, 0, sizeof (struct acpi_table_desc));
|
||||
@@ -109,7 +114,14 @@ acpi_ex_add_table (
|
||||
table_info.allocation = ACPI_MEM_ALLOCATED;
|
||||
|
||||
status = acpi_tb_install_table (&table_info);
|
||||
obj_desc->reference.object = table_info.installed_desc;
|
||||
|
||||
if (ACPI_FAILURE (status)) {
|
||||
if (status == AE_ALREADY_EXISTS) {
|
||||
/* Table already exists, just return the handle */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -123,16 +135,12 @@ acpi_ex_add_table (
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Init the table handle */
|
||||
|
||||
obj_desc->reference.opcode = AML_LOAD_OP;
|
||||
obj_desc->reference.object = table_info.installed_desc;
|
||||
*ddb_handle = obj_desc;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
||||
|
||||
cleanup:
|
||||
acpi_ut_remove_reference (obj_desc);
|
||||
*ddb_handle = NULL;
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
@@ -488,6 +496,7 @@ acpi_ex_unload_table (
|
||||
* (Offset contains the table_id)
|
||||
*/
|
||||
acpi_ns_delete_namespace_by_owner (table_info->owner_id);
|
||||
acpi_ut_release_owner_id (&table_info->owner_id);
|
||||
|
||||
/* Delete the table itself */
|
||||
|
||||
|
||||
@@ -598,7 +598,7 @@ acpi_ex_dump_reference (
|
||||
acpi_os_printf ("Could not convert name to pathname\n");
|
||||
}
|
||||
else {
|
||||
acpi_os_printf ("%s\n", ret_buf.pointer);
|
||||
acpi_os_printf ("%s\n", (char *) ret_buf.pointer);
|
||||
ACPI_MEM_FREE (ret_buf.pointer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ acpi_ex_opcode_1A_0T_1R (
|
||||
*/
|
||||
return_desc = *(operand[0]->reference.where);
|
||||
if (return_desc) {
|
||||
acpi_ut_add_reference (return_desc);
|
||||
acpi_ut_add_reference (return_desc);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -159,18 +159,19 @@ acpi_ns_root_initialize (
|
||||
obj_desc->method.param_count = (u8) ACPI_TO_INTEGER (val);
|
||||
obj_desc->common.flags |= AOPOBJ_DATA_VALID;
|
||||
|
||||
#if defined (ACPI_ASL_COMPILER) || defined (ACPI_DUMP_App)
|
||||
#if defined (ACPI_ASL_COMPILER)
|
||||
|
||||
/*
|
||||
* i_aSL Compiler cheats by putting parameter count
|
||||
* in the owner_iD (param_count max is 7)
|
||||
*/
|
||||
new_node->owner_id = obj_desc->method.param_count;
|
||||
/* save the parameter count for the i_aSL compiler */
|
||||
|
||||
new_node->value = obj_desc->method.param_count;
|
||||
#else
|
||||
/* Mark this as a very SPECIAL method */
|
||||
|
||||
obj_desc->method.method_flags = AML_METHOD_INTERNAL_ONLY;
|
||||
|
||||
#ifndef ACPI_DUMP_APP
|
||||
obj_desc->method.implementation = acpi_ut_osi_implementation;
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
@@ -176,10 +176,9 @@ acpi_ns_delete_node (
|
||||
* DESCRIPTION: Initialize a new namespace node and install it amongst
|
||||
* its peers.
|
||||
*
|
||||
* Note: Current namespace lookup is linear search. However, the
|
||||
* nodes are linked in alphabetical order to 1) put all reserved
|
||||
* names (start with underscore) first, and to 2) make a readable
|
||||
* namespace dump.
|
||||
* Note: Current namespace lookup is linear search. This appears
|
||||
* to be sufficient as namespace searches consume only a small
|
||||
* fraction of the execution time of the ACPI subsystem.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -192,10 +191,6 @@ acpi_ns_install_node (
|
||||
{
|
||||
acpi_owner_id owner_id = 0;
|
||||
struct acpi_namespace_node *child_node;
|
||||
#ifdef ACPI_ALPHABETIC_NAMESPACE
|
||||
|
||||
struct acpi_namespace_node *previous_child_node;
|
||||
#endif
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("ns_install_node");
|
||||
@@ -219,57 +214,6 @@ acpi_ns_install_node (
|
||||
node->peer = parent_node;
|
||||
}
|
||||
else {
|
||||
#ifdef ACPI_ALPHABETIC_NAMESPACE
|
||||
/*
|
||||
* Walk the list whilst searching for the correct
|
||||
* alphabetic placement.
|
||||
*/
|
||||
previous_child_node = NULL;
|
||||
while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node),
|
||||
acpi_ut_get_node_name (node)) < 0) {
|
||||
if (child_node->flags & ANOBJ_END_OF_PEER_LIST) {
|
||||
/* Last peer; Clear end-of-list flag */
|
||||
|
||||
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
|
||||
|
||||
/* This node is the new peer to the child node */
|
||||
|
||||
child_node->peer = node;
|
||||
|
||||
/* This node is the new end-of-list */
|
||||
|
||||
node->flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
node->peer = parent_node;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Get next peer */
|
||||
|
||||
previous_child_node = child_node;
|
||||
child_node = child_node->peer;
|
||||
}
|
||||
|
||||
/* Did the node get inserted at the end-of-list? */
|
||||
|
||||
if (!(node->flags & ANOBJ_END_OF_PEER_LIST)) {
|
||||
/*
|
||||
* Loop above terminated without reaching the end-of-list.
|
||||
* Insert the new node at the current location
|
||||
*/
|
||||
if (previous_child_node) {
|
||||
/* Insert node alphabetically */
|
||||
|
||||
node->peer = child_node;
|
||||
previous_child_node->peer = node;
|
||||
}
|
||||
else {
|
||||
/* Insert node alphabetically at start of list */
|
||||
|
||||
node->peer = child_node;
|
||||
parent_node->child = node;
|
||||
}
|
||||
}
|
||||
#else
|
||||
while (!(child_node->flags & ANOBJ_END_OF_PEER_LIST)) {
|
||||
child_node = child_node->peer;
|
||||
}
|
||||
@@ -279,9 +223,8 @@ acpi_ns_install_node (
|
||||
/* Clear end-of-list flag */
|
||||
|
||||
child_node->flags &= ~ANOBJ_END_OF_PEER_LIST;
|
||||
node->flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
node->flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
node->peer = parent_node;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Init the new entry */
|
||||
@@ -570,6 +513,10 @@ acpi_ns_delete_namespace_by_owner (
|
||||
ACPI_FUNCTION_TRACE_U32 ("ns_delete_namespace_by_owner", owner_id);
|
||||
|
||||
|
||||
if (owner_id == 0) {
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
parent_node = acpi_gbl_root_node;
|
||||
child_node = NULL;
|
||||
deletion_node = NULL;
|
||||
@@ -635,59 +582,7 @@ acpi_ns_delete_namespace_by_owner (
|
||||
}
|
||||
}
|
||||
|
||||
(void) acpi_ut_release_owner_id (owner_id);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACPI_ALPHABETIC_NAMESPACE
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ns_compare_names
|
||||
*
|
||||
* PARAMETERS: Name1 - First name to compare
|
||||
* Name2 - Second name to compare
|
||||
*
|
||||
* RETURN: value from strncmp
|
||||
*
|
||||
* DESCRIPTION: Compare two ACPI names. Names that are prefixed with an
|
||||
* underscore are forced to be alphabetically first.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int
|
||||
acpi_ns_compare_names (
|
||||
char *name1,
|
||||
char *name2)
|
||||
{
|
||||
char reversed_name1[ACPI_NAME_SIZE];
|
||||
char reversed_name2[ACPI_NAME_SIZE];
|
||||
u32 i;
|
||||
u32 j;
|
||||
|
||||
|
||||
/*
|
||||
* Replace all instances of "underscore" with a value that is smaller so
|
||||
* that all names that are prefixed with underscore(s) are alphabetically
|
||||
* first.
|
||||
*
|
||||
* Reverse the name bytewise so we can just do a 32-bit compare instead
|
||||
* of a strncmp.
|
||||
*/
|
||||
for (i = 0, j= (ACPI_NAME_SIZE - 1); i < ACPI_NAME_SIZE; i++, j--) {
|
||||
reversed_name1[j] = name1[i];
|
||||
if (name1[i] == '_') {
|
||||
reversed_name1[j] = '*';
|
||||
}
|
||||
|
||||
reversed_name2[j] = name2[i];
|
||||
if (name2[i] == '_') {
|
||||
reversed_name2[j] = '*';
|
||||
}
|
||||
}
|
||||
|
||||
return (*(int *) reversed_name1 - *(int *) reversed_name2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,9 @@ acpi_ns_print_pathname (
|
||||
u32 num_segments,
|
||||
char *pathname)
|
||||
{
|
||||
acpi_native_uint i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME ("ns_print_pathname");
|
||||
|
||||
|
||||
@@ -97,9 +100,13 @@ acpi_ns_print_pathname (
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "["));
|
||||
|
||||
while (num_segments) {
|
||||
acpi_os_printf ("%4.4s", pathname);
|
||||
pathname += ACPI_NAME_SIZE;
|
||||
for (i = 0; i < 4; i++) {
|
||||
ACPI_IS_PRINT (pathname[i]) ?
|
||||
acpi_os_printf ("%c", pathname[i]) :
|
||||
acpi_os_printf ("?");
|
||||
}
|
||||
|
||||
pathname += ACPI_NAME_SIZE;
|
||||
num_segments--;
|
||||
if (num_segments) {
|
||||
acpi_os_printf (".");
|
||||
|
||||
@@ -365,6 +365,7 @@ acpi_ns_evaluate_by_handle (
|
||||
*
|
||||
* PARAMETERS: Info - Method info block, contains:
|
||||
* Node - Method Node to execute
|
||||
* obj_desc - Method object
|
||||
* Parameters - List of parameters to pass to the method,
|
||||
* terminated by NULL. Params itself may be
|
||||
* NULL if no parameters are being passed.
|
||||
@@ -387,7 +388,6 @@ acpi_ns_execute_control_method (
|
||||
struct acpi_parameter_info *info)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *obj_desc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("ns_execute_control_method");
|
||||
@@ -395,8 +395,8 @@ acpi_ns_execute_control_method (
|
||||
|
||||
/* Verify that there is a method associated with this object */
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object (info->node);
|
||||
if (!obj_desc) {
|
||||
info->obj_desc = acpi_ns_get_attached_object (info->node);
|
||||
if (!info->obj_desc) {
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No attached method object\n"));
|
||||
|
||||
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
|
||||
@@ -407,7 +407,7 @@ acpi_ns_execute_control_method (
|
||||
ACPI_LV_INFO, _COMPONENT);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Method at AML address %p Length %X\n",
|
||||
obj_desc->method.aml_start + 1, obj_desc->method.aml_length - 1));
|
||||
info->obj_desc->method.aml_start + 1, info->obj_desc->method.aml_length - 1));
|
||||
|
||||
/*
|
||||
* Unlock the namespace before execution. This allows namespace access
|
||||
@@ -430,7 +430,7 @@ acpi_ns_execute_control_method (
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
status = acpi_psx_execute (info);
|
||||
status = acpi_ps_execute_method (info);
|
||||
acpi_ex_exit_interpreter ();
|
||||
|
||||
return_ACPI_STATUS (status);
|
||||
|
||||
@@ -198,7 +198,7 @@ acpi_ns_load_table_by_type (
|
||||
switch (table_type) {
|
||||
case ACPI_TABLE_DSDT:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading DSDT\n"));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: DSDT\n"));
|
||||
|
||||
table_desc = acpi_gbl_table_lists[ACPI_TABLE_DSDT].next;
|
||||
|
||||
@@ -218,46 +218,20 @@ acpi_ns_load_table_by_type (
|
||||
|
||||
|
||||
case ACPI_TABLE_SSDT:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d SSDTs\n",
|
||||
acpi_gbl_table_lists[ACPI_TABLE_SSDT].count));
|
||||
|
||||
/*
|
||||
* Traverse list of SSDT tables
|
||||
*/
|
||||
table_desc = acpi_gbl_table_lists[ACPI_TABLE_SSDT].next;
|
||||
for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_SSDT].count; i++) {
|
||||
/*
|
||||
* Only attempt to load table if it is not
|
||||
* already loaded!
|
||||
*/
|
||||
if (!table_desc->loaded_into_namespace) {
|
||||
status = acpi_ns_load_table (table_desc, acpi_gbl_root_node);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
break;
|
||||
}
|
||||
|
||||
table_desc->loaded_into_namespace = TRUE;
|
||||
}
|
||||
|
||||
table_desc = table_desc->next;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TABLE_PSDT:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Loading %d PSDTs\n",
|
||||
acpi_gbl_table_lists[ACPI_TABLE_PSDT].count));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace load: %d SSDT or PSDTs\n",
|
||||
acpi_gbl_table_lists[table_type].count));
|
||||
|
||||
/*
|
||||
* Traverse list of PSDT tables
|
||||
* Traverse list of SSDT or PSDT tables
|
||||
*/
|
||||
table_desc = acpi_gbl_table_lists[ACPI_TABLE_PSDT].next;
|
||||
|
||||
for (i = 0; i < acpi_gbl_table_lists[ACPI_TABLE_PSDT].count; i++) {
|
||||
/* Only attempt to load table if it is not already loaded! */
|
||||
|
||||
table_desc = acpi_gbl_table_lists[table_type].next;
|
||||
for (i = 0; i < acpi_gbl_table_lists[table_type].count; i++) {
|
||||
/*
|
||||
* Only attempt to load table into namespace if it is not
|
||||
* already loaded!
|
||||
*/
|
||||
if (!table_desc->loaded_into_namespace) {
|
||||
status = acpi_ns_load_table (table_desc, acpi_gbl_root_node);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
acpi_status
|
||||
acpi_ns_one_complete_parse (
|
||||
u32 pass_number,
|
||||
u8 pass_number,
|
||||
struct acpi_table_desc *table_desc)
|
||||
{
|
||||
union acpi_parse_object *parse_root;
|
||||
|
||||
@@ -55,8 +55,6 @@
|
||||
#include <acpi/acparser.h>
|
||||
#include <acpi/acdispat.h>
|
||||
#include <acpi/amlcode.h>
|
||||
#include <acpi/acnamesp.h>
|
||||
#include <acpi/acinterp.h>
|
||||
|
||||
#define _COMPONENT ACPI_PARSER
|
||||
ACPI_MODULE_NAME ("psloop")
|
||||
@@ -410,11 +408,9 @@ acpi_ps_parse_loop (
|
||||
|
||||
/* Special processing for certain opcodes */
|
||||
|
||||
#define ACPI_NO_MODULE_LEVEL_CODE
|
||||
|
||||
/* TBD (remove): Temporary mechanism to disable this code if needed */
|
||||
|
||||
#ifndef ACPI_NO_MODULE_LEVEL_CODE
|
||||
#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
|
||||
|
||||
if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS1) &&
|
||||
((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
|
||||
@@ -431,6 +427,9 @@ acpi_ps_parse_loop (
|
||||
case AML_ELSE_OP:
|
||||
case AML_WHILE_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Pass1: Skipping an If/Else/While body\n"));
|
||||
|
||||
/* Skip body of if/else/while in pass 1 */
|
||||
|
||||
parser_state->aml = parser_state->pkg_end;
|
||||
|
||||
@@ -200,10 +200,10 @@ acpi_ps_free_op (
|
||||
}
|
||||
|
||||
if (op->common.flags & ACPI_PARSEOP_GENERIC) {
|
||||
acpi_os_release_object (acpi_gbl_ps_node_cache, op);
|
||||
(void) acpi_os_release_object (acpi_gbl_ps_node_cache, op);
|
||||
}
|
||||
else {
|
||||
acpi_os_release_object (acpi_gbl_ps_node_ext_cache, op);
|
||||
(void) acpi_os_release_object (acpi_gbl_ps_node_ext_cache, op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+149
-117
@@ -46,19 +46,30 @@
|
||||
#include <acpi/acparser.h>
|
||||
#include <acpi/acdispat.h>
|
||||
#include <acpi/acinterp.h>
|
||||
#include <acpi/acnamesp.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_PARSER
|
||||
ACPI_MODULE_NAME ("psxface")
|
||||
|
||||
/* Local Prototypes */
|
||||
|
||||
static acpi_status
|
||||
acpi_ps_execute_pass (
|
||||
struct acpi_parameter_info *info);
|
||||
|
||||
static void
|
||||
acpi_ps_update_parameter_list (
|
||||
struct acpi_parameter_info *info,
|
||||
u16 action);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_psx_execute
|
||||
* FUNCTION: acpi_ps_execute_method
|
||||
*
|
||||
* PARAMETERS: Info - Method info block, contains:
|
||||
* Node - Method Node to execute
|
||||
* obj_desc - Method object
|
||||
* Parameters - List of parameters to pass to the method,
|
||||
* terminated by NULL. Params itself may be
|
||||
* NULL if no parameters are being passed.
|
||||
@@ -67,6 +78,7 @@
|
||||
* parameter_type - Type of Parameter list
|
||||
* return_object - Where to put method's return value (if
|
||||
* any). If NULL, no value is returned.
|
||||
* pass_number - Parse or execute pass
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -75,157 +87,79 @@
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_psx_execute (
|
||||
acpi_ps_execute_method (
|
||||
struct acpi_parameter_info *info)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_operand_object *obj_desc;
|
||||
u32 i;
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_walk_state *walk_state;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("psx_execute");
|
||||
ACPI_FUNCTION_TRACE ("ps_execute_method");
|
||||
|
||||
|
||||
/* Validate the Node and get the attached object */
|
||||
/* Validate the Info and method Node */
|
||||
|
||||
if (!info || !info->node) {
|
||||
return_ACPI_STATUS (AE_NULL_ENTRY);
|
||||
}
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object (info->node);
|
||||
if (!obj_desc) {
|
||||
return_ACPI_STATUS (AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
/* Init for new method, wait on concurrency semaphore */
|
||||
|
||||
status = acpi_ds_begin_method_execution (info->node, obj_desc, NULL);
|
||||
status = acpi_ds_begin_method_execution (info->node, info->obj_desc, NULL);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
if ((info->parameter_type == ACPI_PARAM_ARGS) &&
|
||||
(info->parameters)) {
|
||||
/*
|
||||
* The caller "owns" the parameters, so give each one an extra
|
||||
* reference
|
||||
*/
|
||||
for (i = 0; info->parameters[i]; i++) {
|
||||
acpi_ut_add_reference (info->parameters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 1) Perform the first pass parse of the method to enter any
|
||||
* named objects that it creates into the namespace
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"**** Begin Method Parse **** Entry=%p obj=%p\n",
|
||||
info->node, obj_desc));
|
||||
|
||||
/* Create and init a Root Node */
|
||||
|
||||
op = acpi_ps_create_scope_op ();
|
||||
if (!op) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a new owner_id for objects created by this method. Namespace
|
||||
* objects (such as Operation Regions) can be created during the
|
||||
* first pass parse.
|
||||
*/
|
||||
status = acpi_ut_allocate_owner_id (&obj_desc->method.owner_id);
|
||||
status = acpi_ut_allocate_owner_id (&info->obj_desc->method.owner_id);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
walk_state = acpi_ds_create_walk_state (obj_desc->method.owner_id,
|
||||
NULL, NULL, NULL);
|
||||
if (!walk_state) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
status = acpi_ds_init_aml_walk (walk_state, op, info->node,
|
||||
obj_desc->method.aml_start,
|
||||
obj_desc->method.aml_length, NULL, 1);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto cleanup3;
|
||||
}
|
||||
|
||||
/* Parse the AML */
|
||||
|
||||
status = acpi_ps_parse_aml (walk_state);
|
||||
acpi_ps_delete_parse_tree (op);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto cleanup1; /* Walk state is already deleted */
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
/*
|
||||
* 2) Execute the method. Performs second pass parse simultaneously
|
||||
* The caller "owns" the parameters, so give each one an extra
|
||||
* reference
|
||||
*/
|
||||
acpi_ps_update_parameter_list (info, REF_INCREMENT);
|
||||
|
||||
/*
|
||||
* 1) Perform the first pass parse of the method to enter any
|
||||
* named objects that it creates into the namespace
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"**** Begin Method Parse **** Entry=%p obj=%p\n",
|
||||
info->node, info->obj_desc));
|
||||
|
||||
info->pass_number = 1;
|
||||
status = acpi_ps_execute_pass (info);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* 2) Execute the method. Performs second pass parse simultaneously
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"**** Begin Method Execution **** Entry=%p obj=%p\n",
|
||||
info->node, obj_desc));
|
||||
info->node, info->obj_desc));
|
||||
|
||||
/* Create and init a Root Node */
|
||||
info->pass_number = 3;
|
||||
status = acpi_ps_execute_pass (info);
|
||||
|
||||
op = acpi_ps_create_scope_op ();
|
||||
if (!op) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup1;
|
||||
|
||||
cleanup:
|
||||
if (info->obj_desc->method.owner_id) {
|
||||
acpi_ut_release_owner_id (&info->obj_desc->method.owner_id);
|
||||
}
|
||||
|
||||
/* Init new op with the method name and pointer back to the NS node */
|
||||
/* Take away the extra reference that we gave the parameters above */
|
||||
|
||||
acpi_ps_set_name (op, info->node->name.integer);
|
||||
op->common.node = info->node;
|
||||
acpi_ps_update_parameter_list (info, REF_DECREMENT);
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL);
|
||||
if (!walk_state) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup2;
|
||||
}
|
||||
|
||||
status = acpi_ds_init_aml_walk (walk_state, op, info->node,
|
||||
obj_desc->method.aml_start,
|
||||
obj_desc->method.aml_length, info, 3);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto cleanup3;
|
||||
}
|
||||
|
||||
/* The walk of the parse tree is where we actually execute the method */
|
||||
|
||||
status = acpi_ps_parse_aml (walk_state);
|
||||
goto cleanup2; /* Walk state already deleted */
|
||||
|
||||
|
||||
cleanup3:
|
||||
acpi_ds_delete_walk_state (walk_state);
|
||||
|
||||
cleanup2:
|
||||
acpi_ps_delete_parse_tree (op);
|
||||
|
||||
cleanup1:
|
||||
if ((info->parameter_type == ACPI_PARAM_ARGS) &&
|
||||
(info->parameters)) {
|
||||
/* Take away the extra reference that we gave the parameters above */
|
||||
|
||||
for (i = 0; info->parameters[i]; i++) {
|
||||
/* Ignore errors, just do them all */
|
||||
|
||||
(void) acpi_ut_update_object_reference (
|
||||
info->parameters[i], REF_DECREMENT);
|
||||
}
|
||||
}
|
||||
/* Exit now if error above */
|
||||
|
||||
if (ACPI_FAILURE (status)) {
|
||||
return_ACPI_STATUS (status);
|
||||
@@ -247,3 +181,101 @@ cleanup1:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_update_parameter_list
|
||||
*
|
||||
* PARAMETERS: Info - See struct acpi_parameter_info
|
||||
* (Used: parameter_type and Parameters)
|
||||
* Action - Add or Remove reference
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Update reference count on all method parameter objects
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
acpi_ps_update_parameter_list (
|
||||
struct acpi_parameter_info *info,
|
||||
u16 action)
|
||||
{
|
||||
acpi_native_uint i;
|
||||
|
||||
|
||||
if ((info->parameter_type == ACPI_PARAM_ARGS) &&
|
||||
(info->parameters)) {
|
||||
/* Update reference count for each parameter */
|
||||
|
||||
for (i = 0; info->parameters[i]; i++) {
|
||||
/* Ignore errors, just do them all */
|
||||
|
||||
(void) acpi_ut_update_object_reference (info->parameters[i], action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ps_execute_pass
|
||||
*
|
||||
* PARAMETERS: Info - See struct acpi_parameter_info
|
||||
* (Used: pass_number, Node, and obj_desc)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Single AML pass: Parse or Execute a control method
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static acpi_status
|
||||
acpi_ps_execute_pass (
|
||||
struct acpi_parameter_info *info)
|
||||
{
|
||||
acpi_status status;
|
||||
union acpi_parse_object *op;
|
||||
struct acpi_walk_state *walk_state;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("ps_execute_pass");
|
||||
|
||||
|
||||
/* Create and init a Root Node */
|
||||
|
||||
op = acpi_ps_create_scope_op ();
|
||||
if (!op) {
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
walk_state = acpi_ds_create_walk_state (
|
||||
info->obj_desc->method.owner_id, NULL, NULL, NULL);
|
||||
if (!walk_state) {
|
||||
status = AE_NO_MEMORY;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
status = acpi_ds_init_aml_walk (walk_state, op, info->node,
|
||||
info->obj_desc->method.aml_start,
|
||||
info->obj_desc->method.aml_length,
|
||||
info->pass_number == 1 ? NULL : info,
|
||||
info->pass_number);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
acpi_ds_delete_walk_state (walk_state);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Parse the AML */
|
||||
|
||||
status = acpi_ps_parse_aml (walk_state);
|
||||
|
||||
/* Walk state was deleted by parse_aml */
|
||||
|
||||
cleanup:
|
||||
acpi_ps_delete_parse_tree (op);
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -124,9 +124,7 @@ acpi_tb_match_signature (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must
|
||||
* already be loaded and validated.
|
||||
* Install the table into the global data structs.
|
||||
* DESCRIPTION: Install the table into the global data structures.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -136,6 +134,7 @@ acpi_tb_install_table (
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("tb_install_table");
|
||||
|
||||
|
||||
@@ -143,22 +142,33 @@ acpi_tb_install_table (
|
||||
|
||||
status = acpi_ut_acquire_mutex (ACPI_MTX_TABLES);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
ACPI_REPORT_ERROR (("Could not acquire table mutex for [%4.4s], %s\n",
|
||||
table_info->pointer->signature, acpi_format_exception (status)));
|
||||
ACPI_REPORT_ERROR (("Could not acquire table mutex, %s\n",
|
||||
acpi_format_exception (status)));
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Ignore a table that is already installed. For example, some BIOS
|
||||
* ASL code will repeatedly attempt to load the same SSDT.
|
||||
*/
|
||||
status = acpi_tb_is_table_installed (table_info);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
goto unlock_and_exit;
|
||||
}
|
||||
|
||||
/* Install the table into the global data structure */
|
||||
|
||||
status = acpi_tb_init_table_descriptor (table_info->type, table_info);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
ACPI_REPORT_ERROR (("Could not install ACPI table [%4.4s], %s\n",
|
||||
ACPI_REPORT_ERROR (("Could not install table [%4.4s], %s\n",
|
||||
table_info->pointer->signature, acpi_format_exception (status)));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s located at %p\n",
|
||||
acpi_gbl_table_data[table_info->type].name, table_info->pointer));
|
||||
|
||||
|
||||
unlock_and_exit:
|
||||
(void) acpi_ut_release_mutex (ACPI_MTX_TABLES);
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,67 @@ acpi_tb_handle_to_object (
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_tb_is_table_installed
|
||||
*
|
||||
* PARAMETERS: new_table_desc - Descriptor for new table being installed
|
||||
*
|
||||
* RETURN: Status - AE_ALREADY_EXISTS if the table is already installed
|
||||
*
|
||||
* DESCRIPTION: Determine if an ACPI table is already installed
|
||||
*
|
||||
* MUTEX: Table data structures should be locked
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
acpi_status
|
||||
acpi_tb_is_table_installed (
|
||||
struct acpi_table_desc *new_table_desc)
|
||||
{
|
||||
struct acpi_table_desc *table_desc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("tb_is_table_installed");
|
||||
|
||||
|
||||
/* Get the list descriptor and first table descriptor */
|
||||
|
||||
table_desc = acpi_gbl_table_lists[new_table_desc->type].next;
|
||||
|
||||
/* Examine all installed tables of this type */
|
||||
|
||||
while (table_desc) {
|
||||
/* Compare Revision and oem_table_id */
|
||||
|
||||
if ((table_desc->loaded_into_namespace) &&
|
||||
(table_desc->pointer->revision ==
|
||||
new_table_desc->pointer->revision) &&
|
||||
(!ACPI_MEMCMP (table_desc->pointer->oem_table_id,
|
||||
new_table_desc->pointer->oem_table_id, 8))) {
|
||||
/* This table is already installed */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
|
||||
"Table [%4.4s] already installed: Rev %X oem_table_id [%8.8s]\n",
|
||||
new_table_desc->pointer->signature,
|
||||
new_table_desc->pointer->revision,
|
||||
new_table_desc->pointer->oem_table_id));
|
||||
|
||||
new_table_desc->owner_id = table_desc->owner_id;
|
||||
new_table_desc->installed_desc = table_desc;
|
||||
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
/* Get next table on the list */
|
||||
|
||||
table_desc = table_desc->next;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_tb_validate_table_header
|
||||
@@ -157,7 +218,7 @@ acpi_tb_verify_table_checksum (
|
||||
|
||||
/* Compute the checksum on the table */
|
||||
|
||||
checksum = acpi_tb_checksum (table_header, table_header->length);
|
||||
checksum = acpi_tb_generate_checksum (table_header, table_header->length);
|
||||
|
||||
/* Return the appropriate exception */
|
||||
|
||||
@@ -175,7 +236,7 @@ acpi_tb_verify_table_checksum (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_tb_checksum
|
||||
* FUNCTION: acpi_tb_generate_checksum
|
||||
*
|
||||
* PARAMETERS: Buffer - Buffer to checksum
|
||||
* Length - Size of the buffer
|
||||
@@ -187,7 +248,7 @@ acpi_tb_verify_table_checksum (
|
||||
******************************************************************************/
|
||||
|
||||
u8
|
||||
acpi_tb_checksum (
|
||||
acpi_tb_generate_checksum (
|
||||
void *buffer,
|
||||
u32 length)
|
||||
{
|
||||
|
||||
@@ -182,10 +182,23 @@ acpi_load_table (
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
/* Check signature for a valid table type */
|
||||
|
||||
status = acpi_tb_recognize_table (&table_info, ACPI_TABLE_ALL);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
return_ACPI_STATUS (status);
|
||||
}
|
||||
|
||||
/* Install the new table into the local data structures */
|
||||
|
||||
status = acpi_tb_install_table (&table_info);
|
||||
if (ACPI_FAILURE (status)) {
|
||||
if (status == AE_ALREADY_EXISTS) {
|
||||
/* Table already exists, no error */
|
||||
|
||||
status = AE_OK;
|
||||
}
|
||||
|
||||
/* Free table allocated by acpi_tb_get_table_body */
|
||||
|
||||
acpi_tb_delete_single_table (&table_info);
|
||||
@@ -261,6 +274,7 @@ acpi_unload_table (
|
||||
* simply a position within the hierarchy
|
||||
*/
|
||||
acpi_ns_delete_namespace_by_owner (table_desc->owner_id);
|
||||
acpi_ut_release_owner_id (&table_desc->owner_id);
|
||||
table_desc = table_desc->next;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@ acpi_tb_validate_rsdp (
|
||||
|
||||
/* Check the standard checksum */
|
||||
|
||||
if (acpi_tb_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
|
||||
if (acpi_tb_generate_checksum (rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
|
||||
return (AE_BAD_CHECKSUM);
|
||||
}
|
||||
|
||||
/* Check extended checksum if table version >= 2 */
|
||||
|
||||
if ((rsdp->revision >= 2) &&
|
||||
(acpi_tb_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
|
||||
(acpi_tb_generate_checksum (rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
|
||||
return (AE_BAD_CHECKSUM);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user