diff options
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r-- | drivers/acpi/executer/exconfig.c | 10 | ||||
-rw-r--r-- | drivers/acpi/executer/exfldio.c | 24 | ||||
-rw-r--r-- | drivers/acpi/executer/exmisc.c | 14 | ||||
-rw-r--r-- | drivers/acpi/executer/exoparg1.c | 18 | ||||
-rw-r--r-- | drivers/acpi/executer/exregion.c | 15 |
5 files changed, 43 insertions, 38 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 9ae3cb55979..823352435e0 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -214,9 +214,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
214 | * location within the namespace where the table will be loaded. | 214 | * location within the namespace where the table will be loaded. |
215 | */ | 215 | */ |
216 | status = | 216 | status = |
217 | acpi_ns_get_node_by_path(operand[3]->string.pointer, | 217 | acpi_ns_get_node(start_node, operand[3]->string.pointer, |
218 | start_node, ACPI_NS_SEARCH_PARENT, | 218 | ACPI_NS_SEARCH_PARENT, &parent_node); |
219 | &parent_node); | ||
220 | if (ACPI_FAILURE(status)) { | 219 | if (ACPI_FAILURE(status)) { |
221 | return_ACPI_STATUS(status); | 220 | return_ACPI_STATUS(status); |
222 | } | 221 | } |
@@ -237,9 +236,8 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
237 | /* Find the node referenced by the parameter_path_string */ | 236 | /* Find the node referenced by the parameter_path_string */ |
238 | 237 | ||
239 | status = | 238 | status = |
240 | acpi_ns_get_node_by_path(operand[4]->string.pointer, | 239 | acpi_ns_get_node(start_node, operand[4]->string.pointer, |
241 | start_node, ACPI_NS_SEARCH_PARENT, | 240 | ACPI_NS_SEARCH_PARENT, ¶meter_node); |
242 | ¶meter_node); | ||
243 | if (ACPI_FAILURE(status)) { | 241 | if (ACPI_FAILURE(status)) { |
244 | return_ACPI_STATUS(status); | 242 | return_ACPI_STATUS(status); |
245 | } | 243 | } |
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c index ca9925c0d01..3b7c4352ec5 100644 --- a/drivers/acpi/executer/exfldio.c +++ b/drivers/acpi/executer/exfldio.c | |||
@@ -145,10 +145,10 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
145 | * length of one field datum (access width) must fit within the region. | 145 | * length of one field datum (access width) must fit within the region. |
146 | * (Region length is specified in bytes) | 146 | * (Region length is specified in bytes) |
147 | */ | 147 | */ |
148 | if (rgn_desc->region.length < (obj_desc->common_field.base_byte_offset + | 148 | if (rgn_desc->region.length < |
149 | field_datum_byte_offset + | 149 | (obj_desc->common_field.base_byte_offset + |
150 | obj_desc->common_field. | 150 | field_datum_byte_offset + |
151 | access_byte_width)) { | 151 | obj_desc->common_field.access_byte_width)) { |
152 | if (acpi_gbl_enable_interpreter_slack) { | 152 | if (acpi_gbl_enable_interpreter_slack) { |
153 | /* | 153 | /* |
154 | * Slack mode only: We will go ahead and allow access to this | 154 | * Slack mode only: We will go ahead and allow access to this |
@@ -811,13 +811,15 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, | |||
811 | 811 | ||
812 | mask = | 812 | mask = |
813 | ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); | 813 | ACPI_MASK_BITS_BELOW(obj_desc->common_field.start_field_bit_offset); |
814 | datum_count = | 814 | |
815 | ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, | 815 | datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length, |
816 | obj_desc->common_field.access_bit_width); | 816 | obj_desc->common_field.access_bit_width); |
817 | field_datum_count = | 817 | |
818 | ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length + | 818 | field_datum_count = ACPI_ROUND_UP_TO(obj_desc->common_field.bit_length + |
819 | obj_desc->common_field.start_field_bit_offset, | 819 | obj_desc->common_field. |
820 | obj_desc->common_field.access_bit_width); | 820 | start_field_bit_offset, |
821 | obj_desc->common_field. | ||
822 | access_bit_width); | ||
821 | 823 | ||
822 | /* Get initial Datum from the input buffer */ | 824 | /* Get initial Datum from the input buffer */ |
823 | 825 | ||
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c index 794d9b8de95..bd98aab017c 100644 --- a/drivers/acpi/executer/exmisc.c +++ b/drivers/acpi/executer/exmisc.c | |||
@@ -445,10 +445,24 @@ acpi_ex_do_math_op(u16 opcode, acpi_integer integer0, acpi_integer integer1) | |||
445 | 445 | ||
446 | case AML_SHIFT_LEFT_OP: /* shift_left (Operand, shift_count, Result) */ | 446 | case AML_SHIFT_LEFT_OP: /* shift_left (Operand, shift_count, Result) */ |
447 | 447 | ||
448 | /* | ||
449 | * We need to check if the shiftcount is larger than the integer bit | ||
450 | * width since the behavior of this is not well-defined in the C language. | ||
451 | */ | ||
452 | if (integer1 >= acpi_gbl_integer_bit_width) { | ||
453 | return (0); | ||
454 | } | ||
448 | return (integer0 << integer1); | 455 | return (integer0 << integer1); |
449 | 456 | ||
450 | case AML_SHIFT_RIGHT_OP: /* shift_right (Operand, shift_count, Result) */ | 457 | case AML_SHIFT_RIGHT_OP: /* shift_right (Operand, shift_count, Result) */ |
451 | 458 | ||
459 | /* | ||
460 | * We need to check if the shiftcount is larger than the integer bit | ||
461 | * width since the behavior of this is not well-defined in the C language. | ||
462 | */ | ||
463 | if (integer1 >= acpi_gbl_integer_bit_width) { | ||
464 | return (0); | ||
465 | } | ||
452 | return (integer0 >> integer1); | 466 | return (integer0 >> integer1); |
453 | 467 | ||
454 | case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */ | 468 | case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */ |
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c index 05b89c5878e..8284c52875b 100644 --- a/drivers/acpi/executer/exoparg1.c +++ b/drivers/acpi/executer/exoparg1.c | |||
@@ -874,16 +874,14 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
874 | * Field, so we need to resolve the node to a value. | 874 | * Field, so we need to resolve the node to a value. |
875 | */ | 875 | */ |
876 | status = | 876 | status = |
877 | acpi_ns_get_node_by_path(operand[0]->string. | 877 | acpi_ns_get_node(walk_state->scope_info-> |
878 | pointer, | 878 | scope.node, |
879 | walk_state-> | 879 | operand[0]->string.pointer, |
880 | scope_info->scope. | 880 | ACPI_NS_SEARCH_PARENT, |
881 | node, | 881 | ACPI_CAST_INDIRECT_PTR |
882 | ACPI_NS_SEARCH_PARENT, | 882 | (struct |
883 | ACPI_CAST_INDIRECT_PTR | 883 | acpi_namespace_node, |
884 | (struct | 884 | &return_desc)); |
885 | acpi_namespace_node, | ||
886 | &return_desc)); | ||
887 | if (ACPI_FAILURE(status)) { | 885 | if (ACPI_FAILURE(status)) { |
888 | goto cleanup; | 886 | goto cleanup; |
889 | } | 887 | } |
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c index 4fba452a559..3cc97ba48b3 100644 --- a/drivers/acpi/executer/exregion.c +++ b/drivers/acpi/executer/exregion.c | |||
@@ -477,23 +477,16 @@ acpi_ex_data_table_space_handler(u32 function, | |||
477 | acpi_integer * value, | 477 | acpi_integer * value, |
478 | void *handler_context, void *region_context) | 478 | void *handler_context, void *region_context) |
479 | { | 479 | { |
480 | acpi_status status = AE_OK; | ||
481 | u32 byte_width = ACPI_DIV_8(bit_width); | ||
482 | u32 i; | ||
483 | char *logical_addr_ptr; | ||
484 | |||
485 | ACPI_FUNCTION_TRACE(ex_data_table_space_handler); | 480 | ACPI_FUNCTION_TRACE(ex_data_table_space_handler); |
486 | 481 | ||
487 | logical_addr_ptr = ACPI_PHYSADDR_TO_PTR(address); | ||
488 | |||
489 | /* Perform the memory read or write */ | 482 | /* Perform the memory read or write */ |
490 | 483 | ||
491 | switch (function) { | 484 | switch (function) { |
492 | case ACPI_READ: | 485 | case ACPI_READ: |
493 | 486 | ||
494 | for (i = 0; i < byte_width; i++) { | 487 | ACPI_MEMCPY(ACPI_CAST_PTR(char, value), |
495 | ((char *)value)[i] = logical_addr_ptr[i]; | 488 | ACPI_PHYSADDR_TO_PTR(address), |
496 | } | 489 | ACPI_DIV_8(bit_width)); |
497 | break; | 490 | break; |
498 | 491 | ||
499 | case ACPI_WRITE: | 492 | case ACPI_WRITE: |
@@ -502,5 +495,5 @@ acpi_ex_data_table_space_handler(u32 function, | |||
502 | return_ACPI_STATUS(AE_SUPPORT); | 495 | return_ACPI_STATUS(AE_SUPPORT); |
503 | } | 496 | } |
504 | 497 | ||
505 | return_ACPI_STATUS(status); | 498 | return_ACPI_STATUS(AE_OK); |
506 | } | 499 | } |