Commit 29a241cc authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

ACPICA: Add argument typechecking for all predefined ACPI names

Fully implements typechecking on all incoming arguments for all
predefined names. This ensures that ACPI-related drivers are
passing the correct number of arguments, each of the correct
object type.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Acked-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent e1405ca5
......@@ -83,6 +83,7 @@ acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
acpi-y += \
nsaccess.o \
nsalloc.o \
nsarguments.o \
nsconvert.o \
nsdump.o \
nseval.o \
......
......@@ -362,23 +362,6 @@ union acpi_predefined_info {
#pragma pack()
/* Data block used during object validation */
struct acpi_predefined_data {
char *pathname;
const union acpi_predefined_info *predefined;
union acpi_operand_object *parent_package;
struct acpi_namespace_node *node;
u32 flags;
u32 return_btype;
u8 node_flags;
};
/* Defines for Flags field above */
#define ACPI_OBJECT_REPAIRED 1
#define ACPI_OBJECT_WRAPPED 2
/* Return object auto-repair info */
typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
......
......@@ -223,22 +223,33 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
void acpi_ns_exec_module_code_list(void);
/*
* nspredef - Support for predefined/reserved names
* nsarguments - Argument count/type checking for predefined/reserved names
*/
acpi_status
acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
void
acpi_ns_check_argument_count(char *pathname,
struct acpi_namespace_node *node,
u32 user_param_count,
acpi_status return_status,
union acpi_operand_object **return_object);
const union acpi_predefined_info *info);
void
acpi_ns_check_parameter_count(char *pathname,
acpi_ns_check_acpi_compliance(char *pathname,
struct acpi_namespace_node *node,
const union acpi_predefined_info *predefined);
void acpi_ns_check_argument_types(struct acpi_evaluate_info *info);
/*
* nspredef - Return value checking for predefined/reserved names
*/
acpi_status
acpi_ns_check_return_value(struct acpi_namespace_node *node,
struct acpi_evaluate_info *info,
u32 user_param_count,
const union acpi_predefined_info *info);
acpi_status return_status,
union acpi_operand_object **return_object);
acpi_status
acpi_ns_check_object_type(struct acpi_predefined_data *data,
acpi_ns_check_object_type(struct acpi_evaluate_info *info,
union acpi_operand_object **return_object_ptr,
u32 expected_btypes, u32 package_index);
......@@ -246,7 +257,7 @@ acpi_ns_check_object_type(struct acpi_predefined_data *data,
* nsprepkg - Validation of predefined name packages
*/
acpi_status
acpi_ns_check_package(struct acpi_predefined_data *data,
acpi_ns_check_package(struct acpi_evaluate_info *info,
union acpi_operand_object **return_object_ptr);
/*
......@@ -308,24 +319,24 @@ acpi_ns_get_attached_data(struct acpi_namespace_node *node,
* predefined methods/objects
*/
acpi_status
acpi_ns_simple_repair(struct acpi_predefined_data *data,
acpi_ns_simple_repair(struct acpi_evaluate_info *info,
u32 expected_btypes,
u32 package_index,
union acpi_operand_object **return_object_ptr);
acpi_status
acpi_ns_wrap_with_package(struct acpi_predefined_data *data,
acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
union acpi_operand_object *original_object,
union acpi_operand_object **obj_desc_ptr);
acpi_status
acpi_ns_repair_null_element(struct acpi_predefined_data *data,
acpi_ns_repair_null_element(struct acpi_evaluate_info *info,
u32 expected_btypes,
u32 package_index,
union acpi_operand_object **return_object_ptr);
void
acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
u8 package_type,
union acpi_operand_object *obj_desc);
......@@ -334,7 +345,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
* predefined methods/objects
*/
acpi_status
acpi_ns_complex_repairs(struct acpi_predefined_data *data,
acpi_ns_complex_repairs(struct acpi_evaluate_info *info,
struct acpi_namespace_node *node,
acpi_status validate_status,
union acpi_operand_object **return_object_ptr);
......
......@@ -128,8 +128,8 @@ enum acpi_return_package_types {
#define ARG_COUNT_IS_MINIMUM 0x8000
#define METHOD_MAX_ARG_TYPE ACPI_TYPE_PACKAGE
#define METHOD_GET_COUNT(arg_list) (arg_list & METHOD_ARG_MASK)
#define METHOD_GET_NEXT_ARG(arg_list) (arg_list >> METHOD_ARG_BIT_WIDTH)
#define METHOD_GET_ARG_COUNT(arg_list) ((arg_list) & METHOD_ARG_MASK)
#define METHOD_GET_NEXT_TYPE(arg_list) (((arg_list) >>= METHOD_ARG_BIT_WIDTH) & METHOD_ARG_MASK)
/* Macros used to build the predefined info table */
......
......@@ -178,26 +178,42 @@ union acpi_aml_operands {
};
/*
* Structure used to pass object evaluation parameters.
* Structure used to pass object evaluation information and parameters.
* Purpose is to reduce CPU stack use.
*/
struct acpi_evaluate_info {
struct acpi_namespace_node *prefix_node;
char *pathname;
union acpi_operand_object *obj_desc;
union acpi_operand_object **parameters;
struct acpi_namespace_node *resolved_node;
union acpi_operand_object *return_object;
u8 param_count;
u8 pass_number;
u8 return_object_type;
u8 flags;
/* The first 3 elements are passed by the caller to acpi_ns_evaluate */
struct acpi_namespace_node *prefix_node; /* Input: starting node */
char *relative_pathname; /* Input: path relative to prefix_node */
union acpi_operand_object **parameters; /* Input: argument list */
struct acpi_namespace_node *node; /* Resolved node (prefix_node:relative_pathname) */
union acpi_operand_object *obj_desc; /* Object attached to the resolved node */
char *full_pathname; /* Full pathname of the resolved node */
const union acpi_predefined_info *predefined; /* Used if Node is a predefined name */
union acpi_operand_object *return_object; /* Object returned from the evaluation */
union acpi_operand_object *parent_package; /* Used if return object is a Package */
u32 return_flags; /* Used for return value analysis */
u32 return_btype; /* Bitmapped type of the returned object */
u16 param_count; /* Count of the input argument list */
u8 pass_number; /* Parser pass number */
u8 return_object_type; /* Object type of the returned object */
u8 node_flags; /* Same as Node->Flags */
u8 flags; /* General flags */
};
/* Values for Flags above */
#define ACPI_IGNORE_RETURN_VALUE 1
/* Defines for return_flags field above */
#define ACPI_OBJECT_REPAIRED 1
#define ACPI_OBJECT_WRAPPED 2
/* Info used by acpi_ns_initialize_devices */
struct acpi_device_walk_info {
......
......@@ -579,7 +579,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
(local_gpe_event_info->dispatch.
method_node)));
}
break;
default:
......
......@@ -532,7 +532,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
}
info->prefix_node = region_obj2->extra.method_REG;
info->pathname = NULL;
info->relative_pathname = NULL;
info->parameters = args;
info->flags = ACPI_IGNORE_RETURN_VALUE;
......
......@@ -495,7 +495,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
* Evaluate the \_Sx namespace object containing the register values
* for this state
*/
info->pathname =
info->relative_pathname =
ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
status = acpi_ns_evaluate(info);
if (ACPI_FAILURE(status)) {
......@@ -506,7 +506,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
if (!info->return_object) {
ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
info->pathname));
info->relative_pathname));
status = AE_AML_NO_RETURN_VALUE;
goto cleanup;
}
......@@ -565,7 +565,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"While evaluating Sleep State [%s]",
info->pathname));
info->relative_pathname));
}
ACPI_FREE(info);
......
This diff is collapsed.
This diff is collapsed.
......@@ -176,7 +176,7 @@ acpi_status acpi_ns_initialize_devices(void)
* part of the ACPI specification.
*/
info.evaluate_info->prefix_node = acpi_gbl_root_node;
info.evaluate_info->pathname = METHOD_NAME__INI;
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
info.evaluate_info->parameters = NULL;
info.evaluate_info->flags = ACPI_IGNORE_RETURN_VALUE;
......@@ -560,7 +560,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
ACPI_MEMSET(info, 0, sizeof(struct acpi_evaluate_info));
info->prefix_node = device_node;
info->pathname = METHOD_NAME__INI;
info->relative_pathname = METHOD_NAME__INI;
info->parameters = NULL;
info->flags = ACPI_IGNORE_RETURN_VALUE;
......@@ -574,8 +574,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
/* Ignore error and move on to next device */
char *scope_name =
acpi_ns_get_external_pathname(info->resolved_node);
char *scope_name = acpi_ns_get_external_pathname(info->node);
ACPI_EXCEPTION((AE_INFO, status, "during %s._INI execution",
scope_name));
......
This diff is collapsed.
This diff is collapsed.
......@@ -130,7 +130,7 @@ static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
*
* FUNCTION: acpi_ns_simple_repair
*
* PARAMETERS: data - Pointer to validation data structure
* PARAMETERS: info - Method execution information block
* expected_btypes - Object types expected
* package_index - Index of object within parent package (if
* applicable - ACPI_NOT_PACKAGE_ELEMENT
......@@ -146,7 +146,7 @@ static const struct acpi_simple_repair_info acpi_object_repair_info[] = {
******************************************************************************/
acpi_status
acpi_ns_simple_repair(struct acpi_predefined_data *data,
acpi_ns_simple_repair(struct acpi_evaluate_info *info,
u32 expected_btypes,
u32 package_index,
union acpi_operand_object **return_object_ptr)
......@@ -162,12 +162,12 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
* Special repairs for certain names that are in the repair table.
* Check if this name is in the list of repairable names.
*/
predefined = acpi_ns_match_simple_repair(data->node,
data->return_btype,
predefined = acpi_ns_match_simple_repair(info->node,
info->return_btype,
package_index);
if (predefined) {
if (!return_object) {
ACPI_WARN_PREDEFINED((AE_INFO, data->pathname,
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
ACPI_WARN_ALWAYS,
"Missing expected return value"));
}
......@@ -191,7 +191,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
* Do not perform simple object repair unless the return type is not
* expected.
*/
if (data->return_btype & expected_btypes) {
if (info->return_btype & expected_btypes) {
return (AE_OK);
}
......@@ -211,7 +211,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
*/
if (!return_object) {
if (expected_btypes && (!(expected_btypes & ACPI_RTYPE_NONE))) {
ACPI_WARN_PREDEFINED((AE_INFO, data->pathname,
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
ACPI_WARN_ALWAYS,
"Missing expected return value"));
......@@ -247,14 +247,14 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
* for correct contents (expected object type or types).
*/
status =
acpi_ns_wrap_with_package(data, return_object, &new_object);
acpi_ns_wrap_with_package(info, return_object, &new_object);
if (ACPI_SUCCESS(status)) {
/*
* The original object just had its reference count
* incremented for being inserted into the new package.
*/
*return_object_ptr = new_object; /* New Package object */
data->flags |= ACPI_OBJECT_REPAIRED;
info->return_flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
}
......@@ -277,7 +277,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
* package object as part of the repair, we don't need to
* change the reference count.
*/
if (!(data->flags & ACPI_OBJECT_WRAPPED)) {
if (!(info->return_flags & ACPI_OBJECT_WRAPPED)) {
new_object->common.reference_count =
return_object->common.reference_count;
......@@ -288,14 +288,14 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
"%s: Converted %s to expected %s at Package index %u\n",
data->pathname,
info->full_pathname,
acpi_ut_get_object_type_name(return_object),
acpi_ut_get_object_type_name(new_object),
package_index));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
"%s: Converted %s to expected %s\n",
data->pathname,
info->full_pathname,
acpi_ut_get_object_type_name(return_object),
acpi_ut_get_object_type_name(new_object)));
}
......@@ -304,7 +304,7 @@ acpi_ns_simple_repair(struct acpi_predefined_data *data,
acpi_ut_remove_reference(return_object);
*return_object_ptr = new_object;
data->flags |= ACPI_OBJECT_REPAIRED;
info->return_flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
......@@ -359,7 +359,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
*
* FUNCTION: acpi_ns_repair_null_element
*
* PARAMETERS: data - Pointer to validation data structure
* PARAMETERS: info - Method execution information block
* expected_btypes - Object types expected
* package_index - Index of object within parent package (if
* applicable - ACPI_NOT_PACKAGE_ELEMENT
......@@ -374,7 +374,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
******************************************************************************/
acpi_status
acpi_ns_repair_null_element(struct acpi_predefined_data *data,
acpi_ns_repair_null_element(struct acpi_evaluate_info * info,
u32 expected_btypes,
u32 package_index,
union acpi_operand_object **return_object_ptr)
......@@ -424,16 +424,16 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
/* Set the reference count according to the parent Package object */
new_object->common.reference_count =
data->parent_package->common.reference_count;
info->parent_package->common.reference_count;
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
"%s: Converted NULL package element to expected %s at index %u\n",
data->pathname,
info->full_pathname,
acpi_ut_get_object_type_name(new_object),
package_index));
*return_object_ptr = new_object;
data->flags |= ACPI_OBJECT_REPAIRED;
info->return_flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
......@@ -441,7 +441,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
*
* FUNCTION: acpi_ns_remove_null_elements
*
* PARAMETERS: data - Pointer to validation data structure
* PARAMETERS: info - Method execution information block
* package_type - An acpi_return_package_types value
* obj_desc - A Package object
*
......@@ -454,7 +454,7 @@ acpi_ns_repair_null_element(struct acpi_predefined_data *data,
*****************************************************************************/
void
acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
u8 package_type,
union acpi_operand_object *obj_desc)
{
......@@ -511,7 +511,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
if (new_count < count) {
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
"%s: Found and removed %u NULL elements\n",
data->pathname, (count - new_count)));
info->full_pathname, (count - new_count)));
/* NULL terminate list and update the package count */
......@@ -524,7 +524,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
*
* FUNCTION: acpi_ns_wrap_with_package
*
* PARAMETERS: data - Pointer to validation data structure
* PARAMETERS: info - Method execution information block
* original_object - Pointer to the object to repair.
* obj_desc_ptr - The new package object is returned here
*
......@@ -545,7 +545,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
******************************************************************************/
acpi_status
acpi_ns_wrap_with_package(struct acpi_predefined_data *data,
acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
union acpi_operand_object *original_object,
union acpi_operand_object **obj_desc_ptr)
{
......@@ -566,12 +566,12 @@ acpi_ns_wrap_with_package(struct acpi_predefined_data *data,
ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
"%s: Wrapped %s with expected Package object\n",
data->pathname,
info->full_pathname,
acpi_ut_get_object_type_name(original_object)));
/* Return the new object in the object pointer */
*obj_desc_ptr = pkg_obj_desc;
data->flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED;
info->return_flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED;
return (AE_OK);
}
This diff is collapsed.
......@@ -187,8 +187,6 @@ acpi_evaluate_object(acpi_handle handle,
return_ACPI_STATUS(AE_NO_MEMORY);
}
info->pathname = pathname;
/* Convert and validate the device handle */
info->prefix_node = acpi_ns_validate_handle(handle);
......@@ -198,17 +196,64 @@ acpi_evaluate_object(acpi_handle handle,
}
/*
* If there are parameters to be passed to a control method, the external
* objects must all be converted to internal objects
* Get the actual namespace node for the target object.
* Handles these cases:
*
* 1) Null node, valid pathname from root (absolute path)
* 2) Node and valid pathname (path relative to Node)
* 3) Node, Null pathname
*/
if ((pathname) && (ACPI_IS_ROOT_PREFIX(pathname[0]))) {
/* The path is fully qualified, just evaluate by name */
info->prefix_node = NULL;
} else if (!handle) {
/*
* A handle is optional iff a fully qualified pathname is specified.
* Since we've already handled fully qualified names above, this is
* an error.
*/
if (!pathname) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Both Handle and Pathname are NULL"));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Null Handle with relative pathname [%s]",
pathname));
}
status = AE_BAD_PARAMETER;
goto cleanup;
}
info->relative_pathname = pathname;
/*
* Convert all external objects passed as arguments to the
* internal version(s).
*/
if (external_params && external_params->count) {
info->param_count = (u16)external_params->count;
/* Warn on impossible argument count */
if (info->param_count > ACPI_METHOD_NUM_ARGS) {
ACPI_WARN_PREDEFINED((AE_INFO, pathname,
ACPI_WARN_ALWAYS,
"Excess arguments (%u) - using only %u",
info->param_count,
ACPI_METHOD_NUM_ARGS));
info->param_count = ACPI_METHOD_NUM_ARGS;
}
/*
* Allocate a new parameter block for the internal objects
* Add 1 to count to allow for null terminated internal list
*/
info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size)
external_params->
count +
info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size) info->
param_count +
1) * sizeof(void *));
if (!info->parameters) {
status = AE_NO_MEMORY;
......@@ -217,7 +262,7 @@ acpi_evaluate_object(acpi_handle handle,
/* Convert each external object in the list to an internal object */
for (i = 0; i < external_params->count; i++) {
for (i = 0; i < info->param_count; i++) {
status =
acpi_ut_copy_eobject_to_iobject(&external_params->
pointer[i],
......@@ -227,42 +272,95 @@ acpi_evaluate_object(acpi_handle handle,
goto cleanup;
}
}
info->parameters[external_params->count] = NULL;
info->parameters[info->param_count] = NULL;
}
#if 0
/*
* Three major cases:
* 1) Fully qualified pathname
* 2) No handle, not fully qualified pathname (error)
* 3) Valid handle
* Begin incoming argument count analysis. Check for too few args
* and too many args.
*/
if ((pathname) && (ACPI_IS_ROOT_PREFIX(pathname[0]))) {
/* The path is fully qualified, just evaluate by name */
switch (acpi_ns_get_type(info->node)) {
case ACPI_TYPE_METHOD:
/* Check incoming argument count against the method definition */
if (info->obj_desc->method.param_count > info->param_count) {
ACPI_ERROR((AE_INFO,
"Insufficient arguments (%u) - %u are required",
info->param_count,
info->obj_desc->method.param_count));
status = AE_MISSING_ARGUMENTS;
goto cleanup;
}
else if (info->obj_desc->method.param_count < info->param_count) {
ACPI_WARNING((AE_INFO,
"Excess arguments (%u) - only %u are required",
info->param_count,
info->obj_desc->method.param_count));
/* Just pass the required number of arguments */
info->param_count = info->obj_desc->method.param_count;
}
info->prefix_node = NULL;
status = acpi_ns_evaluate(info);
} else if (!handle) {
/*
* A handle is optional iff a fully qualified pathname is specified.
* Since we've already handled fully qualified names above, this is
* an error
* Any incoming external objects to be passed as arguments to the
* method must be converted to internal objects
*/
if (!pathname) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Both Handle and Pathname are NULL"));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Null Handle with relative pathname [%s]",
pathname));
if (info->param_count) {
/*
* Allocate a new parameter block for the internal objects
* Add 1 to count to allow for null terminated internal list
*/
info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size)
info->
param_count +
1) *
sizeof(void *));
if (!info->parameters) {
status = AE_NO_MEMORY;
goto cleanup;
}
status = AE_BAD_PARAMETER;
} else {
/* We have a namespace a node and a possible relative path */
/* Convert each external object in the list to an internal object */
status = acpi_ns_evaluate(info);
for (i = 0; i < info->param_count; i++) {
status =
acpi_ut_copy_eobject_to_iobject
(&external_params->pointer[i],
&info->parameters[i]);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
}
info->parameters[info->param_count] = NULL;
}
break;
default:
/* Warn if arguments passed to an object that is not a method */
if (info->param_count) {
ACPI_WARNING((AE_INFO,
"%u arguments were passed to a non-method ACPI object",
info->param_count));
}
break;
}
#endif
/* Now we can evaluate the object */
status = acpi_ns_evaluate(info);
/*
* If we are expecting a return value, and all went well above,
......
......@@ -125,7 +125,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info)
}
if ((!acpi_gbl_trace_method_name) ||
(acpi_gbl_trace_method_name != info->resolved_node->name.integer)) {
(acpi_gbl_trace_method_name != info->node->name.integer)) {
goto exit;
}
......@@ -170,7 +170,7 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info)
}
if ((!acpi_gbl_trace_method_name) ||
(acpi_gbl_trace_method_name != info->resolved_node->name.integer)) {
(acpi_gbl_trace_method_name != info->node->name.integer)) {
goto exit;
}
......@@ -226,15 +226,14 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
/* Validate the Info and method Node */
if (!info || !info->resolved_node) {
if (!info || !info->node) {
return_ACPI_STATUS(AE_NULL_ENTRY);
}
/* Init for new method, wait on concurrency semaphore */
status =
acpi_ds_begin_method_execution(info->resolved_node, info->obj_desc,
NULL);
acpi_ds_begin_method_execution(info->node, info->obj_desc, NULL);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
......@@ -253,8 +252,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
*/
ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
"**** Begin Method Parse/Execute [%4.4s] **** Node=%p Obj=%p\n",
info->resolved_node->name.ascii, info->resolved_node,
info->obj_desc));
info->node->name.ascii, info->node, info->obj_desc));
/* Create and init a Root Node */
......@@ -275,7 +273,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
goto cleanup;
}
status = acpi_ds_init_aml_walk(walk_state, op, info->resolved_node,
status = acpi_ds_init_aml_walk(walk_state, op, info->node,
info->obj_desc->method.aml_start,
info->obj_desc->method.aml_length, info,
info->pass_number);
......
......@@ -736,7 +736,7 @@ acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
}
info->prefix_node = node;
info->pathname = METHOD_NAME__SRS;
info->relative_pathname = METHOD_NAME__SRS;
info->parameters = args;
info->flags = ACPI_IGNORE_RETURN_VALUE;
......
......@@ -87,7 +87,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node * prefix_node,
}
info->prefix_node = prefix_node;
info->pathname = path;
info->relative_pathname = path;
/* Evaluate the object/method */
......
......@@ -147,6 +147,11 @@ void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes)
u32 i;
u32 j;
if (!expected_btypes) {
ACPI_STRCPY(buffer, "NONE");
return;
}
j = 1;
buffer[0] = 0;
this_rtype = ACPI_RTYPE_INTEGER;
......@@ -328,9 +333,7 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
/* First field in the types list is the count of args to follow */
arg_count = (argument_types & METHOD_ARG_MASK);
argument_types >>= METHOD_ARG_BIT_WIDTH;
arg_count = METHOD_GET_ARG_COUNT(argument_types);
if (arg_count > METHOD_PREDEF_ARGS_MAX) {
printf("**** Invalid argument count (%u) "
"in predefined info structure\n", arg_count);
......@@ -340,7 +343,8 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
/* Get each argument from the list, convert to ascii, store to buffer */
for (i = 0; i < arg_count; i++) {
this_argument_type = (argument_types & METHOD_ARG_MASK);
this_argument_type = METHOD_GET_NEXT_TYPE(argument_types);
if (!this_argument_type
|| (this_argument_type > METHOD_MAX_ARG_TYPE)) {
printf("**** Invalid argument type (%u) "
......@@ -351,10 +355,6 @@ static u32 acpi_ut_get_argument_types(char *buffer, u16 argument_types)
strcat(buffer,
ut_external_type_names[this_argument_type] + sub_index);
/* Shift to next argument type field */
argument_types >>= METHOD_ARG_BIT_WIDTH;
sub_index = 0;
}
......
......@@ -219,7 +219,7 @@
*
*****************************************************************************/
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */
#define ACPI_DB_LINE_BUFFER_SIZE 512
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
......
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