Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102009
b: refs/heads/master
c: f3454ae
h: refs/heads/master
i:
  102007: 5c56143
v: v3
  • Loading branch information
Bob Moore authored and Andi Kleen committed Jul 16, 2008
1 parent 252ad42 commit 4626739
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c735ab7da3414c3e639d5c5223092b74689e5d87
refs/heads/master: f3454ae8104efb2dbf0d08ec42c6f5d0fe9225bc
35 changes: 35 additions & 0 deletions trunk/drivers/acpi/namespace/nseval.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,41 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
return_ACPI_STATUS(AE_NULL_OBJECT);
}

/*
* Calculate the number of arguments being passed to the method
*/

info->param_count = 0;
if (info->parameters) {
while (info->parameters[info->param_count])
info->param_count++;
}

/* Error if too few arguments were passed in */

if (info->param_count < info->obj_desc->method.param_count) {
ACPI_ERROR((AE_INFO,
"Insufficient arguments - "
"method [%4.4s] needs %d, found %d",
acpi_ut_get_node_name(info->resolved_node),
info->obj_desc->method.param_count,
info->param_count));
return_ACPI_STATUS(AE_MISSING_ARGUMENTS);
}

/* Just a warning if too many arguments */

else if (info->param_count >
info->obj_desc->method.param_count) {
ACPI_WARNING((AE_INFO,
"Excess arguments - "
"method [%4.4s] needs %d, found %d",
acpi_ut_get_node_name(info->
resolved_node),
info->obj_desc->method.param_count,
info->param_count));
}

ACPI_DUMP_PATHNAME(info->resolved_node, "Execute Method:",
ACPI_LV_INFO, _COMPONENT);

Expand Down
6 changes: 4 additions & 2 deletions trunk/include/acpi/acexcep.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@
#define AE_BAD_HEX_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
#define AE_MISSING_ARGUMENTS (acpi_status) (0x000A | AE_CODE_PROGRAMMER)

#define AE_CODE_PGM_MAX 0x0009
#define AE_CODE_PGM_MAX 0x000A

/*
* Acpi table exceptions
Expand Down Expand Up @@ -233,7 +234,8 @@ char const *acpi_gbl_exception_names_pgm[] = {
"AE_ALIGNMENT",
"AE_BAD_HEX_CONSTANT",
"AE_BAD_OCTAL_CONSTANT",
"AE_BAD_DECIMAL_CONSTANT"
"AE_BAD_DECIMAL_CONSTANT",
"AE_MISSING_ARGUMENTS"
};

char const *acpi_gbl_exception_names_tbl[] = {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/acpi/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ struct acpi_evaluate_info {
union acpi_operand_object **parameters;
struct acpi_namespace_node *resolved_node;
union acpi_operand_object *return_object;
u8 param_count;
u8 pass_number;
u8 parameter_type;
u8 return_object_type;
Expand Down

0 comments on commit 4626739

Please sign in to comment.