Commit a308df02 authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] ACPICA 20040402 from Bob Moore

Fixed an interpreter problem where an indirect store through an
ArgX parameter was incorrectly applying the "implicit conversion
rules" during the store.  From the ACPI specification: "If the
target is a method local or argument (LocalX or ArgX), no
conversion is performed and the result is stored directly to the
target".  The new behavior is to disable implicit conversion
during ALL stores to an ArgX.

Changed the behavior of the _PRW method scan to ignore any and
all errors returned by a given _PRW.  This prevents the scan from
aborting from the failure of any single _PRW.

Moved the runtime configuration parameters from the global init
procedure to static variables in acglobal.h.  This will allow the
host to override the default values easily.
parent 8d640267
......@@ -656,11 +656,13 @@ acpi_ds_store_object_to_local (
new_obj_desc, current_obj_desc));
/*
* Store this object to the Node
* (perform the indirect store)
* Store this object to the Node (perform the indirect store)
* NOTE: No implicit conversion is performed, as per the ACPI
* specification rules on storing to Locals/Args.
*/
status = acpi_ex_store_object_to_node (new_obj_desc,
current_obj_desc->reference.object, walk_state);
current_obj_desc->reference.object, walk_state,
ACPI_NO_IMPLICIT_CONVERSION);
/* Remove local reference if we copied the object above */
......
......@@ -50,6 +50,9 @@
#include <acpi/acnamesp.h>
#include <acpi/acevents.h>
#ifdef _ACPI_ASL_COMPILER
#include <acpi/acdisasm.h>
#endif
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dswload")
......@@ -180,7 +183,17 @@ acpi_ds_load1_begin_op (
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
#ifdef _ACPI_ASL_COMPILER
if (status == AE_NOT_FOUND) {
acpi_dm_add_to_external_list (path);
status = AE_OK;
}
else {
ACPI_REPORT_NSERROR (path, status);
}
#else
ACPI_REPORT_NSERROR (path, status);
#endif
return (status);
}
......@@ -529,7 +542,16 @@ acpi_ds_load2_begin_op (
status = acpi_ns_lookup (walk_state->scope_info, buffer_ptr, object_type,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
if (ACPI_FAILURE (status)) {
#ifdef _ACPI_ASL_COMPILER
if (status == AE_NOT_FOUND) {
status = AE_OK;
}
else {
ACPI_REPORT_NSERROR (buffer_ptr, status);
}
#else
ACPI_REPORT_NSERROR (buffer_ptr, status);
#endif
return_ACPI_STATUS (status);
}
/*
......
......@@ -306,12 +306,11 @@ acpi_ev_get_gpe_type (
status = acpi_ut_evaluate_object (obj_handle, METHOD_NAME__PRW,
ACPI_BTYPE_PACKAGE, &pkg_desc);
if (status == AE_NOT_FOUND) {
if (ACPI_FAILURE (status)) {
/* Ignore all errors from _PRW, we don't want to abort the subsystem */
return_ACPI_STATUS (AE_OK);
}
else if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* The returned _PRW package must have at least two elements */
......@@ -378,8 +377,7 @@ acpi_ev_get_gpe_type (
cleanup:
acpi_ut_remove_reference (pkg_desc);
return_ACPI_STATUS (status);
return_ACPI_STATUS (AE_OK);
}
......
......@@ -139,7 +139,7 @@ acpi_ev_queue_notify_request (
acpi_notify_value_names[notify_value]));
}
else {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "notify value: 0x2.2_x **Device Specific**\n",
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Notify value: 0x%2.2X **Device Specific**\n",
notify_value));
}
......
......@@ -277,7 +277,7 @@ acpi_ex_access_region (
rgn_desc->region.space_id));
}
else if (status == AE_NOT_EXIST) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
ACPI_REPORT_ERROR ((
"Region %s(%X) has no handler\n",
acpi_ut_get_region_name (rgn_desc->region.space_id),
rgn_desc->region.space_id));
......
......@@ -102,7 +102,8 @@ acpi_ex_store (
* Storing an object into a Named node.
*/
status = acpi_ex_store_object_to_node (source_desc,
(struct acpi_namespace_node *) dest_desc, walk_state);
(struct acpi_namespace_node *) dest_desc, walk_state,
ACPI_IMPLICIT_CONVERSION);
return_ACPI_STATUS (status);
}
......@@ -153,7 +154,7 @@ acpi_ex_store (
/* Storing an object into a Name "container" */
status = acpi_ex_store_object_to_node (source_desc, ref_desc->reference.object,
walk_state);
walk_state, ACPI_IMPLICIT_CONVERSION);
break;
......@@ -399,6 +400,7 @@ acpi_ex_store_object_to_index (
* PARAMETERS: source_desc - Value to be stored
* Node - Named object to receive the value
* walk_state - Current walk state
* implicit_conversion - Perform implicit conversion (yes/no)
*
* RETURN: Status
*
......@@ -421,7 +423,8 @@ acpi_status
acpi_ex_store_object_to_node (
union acpi_operand_object *source_desc,
struct acpi_namespace_node *node,
struct acpi_walk_state *walk_state)
struct acpi_walk_state *walk_state,
u8 implicit_conversion)
{
acpi_status status = AE_OK;
union acpi_operand_object *target_desc;
......@@ -451,6 +454,14 @@ acpi_ex_store_object_to_node (
return_ACPI_STATUS (status);
}
/* If no implicit conversion, drop into the default case below */
if (!implicit_conversion) {
/* Force execution of default (no implicit conversion) */
target_type = ACPI_TYPE_ANY;
}
/*
* Do the actual store operation
*/
......
......@@ -561,26 +561,37 @@ acpi_ut_get_node_name (
struct acpi_namespace_node *node = (struct acpi_namespace_node *) object;
/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
if (!object)
{
return ("NULL NODE");
return ("NULL");
}
if (object == ACPI_ROOT_OBJECT)
/* Check for Root node */
if ((object == ACPI_ROOT_OBJECT) ||
(object == acpi_gbl_root_node))
{
node = acpi_gbl_root_node;
return ("\"\\\" ");
}
/* Descriptor must be a namespace node */
if (node->descriptor != ACPI_DESC_TYPE_NAMED)
{
return ("****");
return ("####");
}
/* Name must be a valid ACPI name */
if (!acpi_ut_valid_acpi_name (* (u32 *) node->name.ascii))
{
return ("----");
return ("????");
}
/* Return the name */
return (node->name.ascii);
}
......@@ -783,11 +794,6 @@ acpi_ut_init_globals (
ACPI_FUNCTION_TRACE ("ut_init_globals");
/* Runtime configuration */
acpi_gbl_create_osi_method = TRUE;
acpi_gbl_all_methods_serialized = FALSE;
acpi_gbl_leave_wake_gpes_disabled = TRUE;
/* Memory allocation and cache lists */
......
......@@ -64,7 +64,7 @@
/* Version string */
#define ACPI_CA_VERSION 0x20040326
#define ACPI_CA_VERSION 0x20040402
/* Maximum objects in the various object caches */
......
......@@ -52,6 +52,13 @@
#define BLOCK_BRACE 2
#define BLOCK_COMMA_LIST 4
struct acpi_external_list
{
char *path;
struct acpi_external_list *next;
};
extern struct acpi_external_list *acpi_gbl_external_list;
extern const char *acpi_gbl_io_decode[2];
extern const char *acpi_gbl_word_decode[4];
extern const char *acpi_gbl_consume_decode[2];
......@@ -399,4 +406,12 @@ acpi_dm_vendor_small_descriptor (
u32 level);
/*
* dmutils
*/
void
acpi_dm_add_to_external_list (
char *path);
#endif /* __ACDISASM_H__ */
......@@ -46,15 +46,17 @@
/*
* Ensure that the globals are actually defined only once.
* Ensure that the globals are actually defined and initialized only once.
*
* The use of these defines allows a single list of globals (here) in order
* The use of these macros allows a single list of globals (here) in order
* to simplify maintenance of the code.
*/
#ifdef DEFINE_ACPI_GLOBALS
#define ACPI_EXTERN
#define ACPI_INIT_GLOBAL(a,b) a=b
#else
#define ACPI_EXTERN extern
#define ACPI_INIT_GLOBAL(a,b) a
#endif
/*
......@@ -64,6 +66,7 @@
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
/*****************************************************************************
*
* Debug support
......@@ -79,15 +82,35 @@ extern u32 acpi_dbg_layer;
extern u32 acpi_gbl_nesting_level;
/*****************************************************************************
*
* Runtime configuration
* Runtime configuration (static defaults that can be overriden at runtime)
*
****************************************************************************/
ACPI_EXTERN u8 acpi_gbl_create_osi_method;
ACPI_EXTERN u8 acpi_gbl_all_methods_serialized;
ACPI_EXTERN u8 acpi_gbl_leave_wake_gpes_disabled;
/*
* Create the predefined _OSI method in the namespace? Default is TRUE
* because ACPI CA is fully compatible with other ACPI implementations.
* Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
*/
ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_create_osi_method, TRUE);
/*
* Automatically serialize ALL control methods? Default is FALSE, meaning
* to use the Serialized/not_serialized method flags on a per method basis.
* Only change this if the ASL code is poorly written and cannot handle
* reentrancy even though methods are marked "not_serialized".
*/
ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_all_methods_serialized, FALSE);
/*
* Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
* RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
* be enabled just before going to sleep.
*/
ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE);
/*****************************************************************************
*
......@@ -102,7 +125,6 @@ ACPI_EXTERN u8 acpi_gbl_leave_wake_gpes_disable
*
* These tables are single-table only; meaning that there can be at most one
* of each in the system. Each global points to the actual table.
*
*/
ACPI_EXTERN u32 acpi_gbl_table_flags;
ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
......
......@@ -563,8 +563,11 @@ acpi_status
acpi_ex_store_object_to_node (
union acpi_operand_object *source_desc,
struct acpi_namespace_node *node,
struct acpi_walk_state *walk_state);
struct acpi_walk_state *walk_state,
u8 implicit_conversion);
#define ACPI_IMPLICIT_CONVERSION TRUE
#define ACPI_NO_IMPLICIT_CONVERSION FALSE
/*
* exstoren
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment