diff options
Diffstat (limited to 'drivers/acpi/acpica/exfldio.c')
-rw-r--r-- | drivers/acpi/acpica/exfldio.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index dc2f9e8bee6e..f68a216168be 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c | |||
@@ -55,11 +55,10 @@ ACPI_MODULE_NAME("exfldio") | |||
55 | static acpi_status | 55 | static acpi_status |
56 | acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | 56 | acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, |
57 | u32 field_datum_byte_offset, | 57 | u32 field_datum_byte_offset, |
58 | acpi_integer * value, u32 read_write); | 58 | u64 *value, u32 read_write); |
59 | 59 | ||
60 | static u8 | 60 | static u8 |
61 | acpi_ex_register_overflow(union acpi_operand_object *obj_desc, | 61 | acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value); |
62 | acpi_integer value); | ||
63 | 62 | ||
64 | static acpi_status | 63 | static acpi_status |
65 | acpi_ex_setup_region(union acpi_operand_object *obj_desc, | 64 | acpi_ex_setup_region(union acpi_operand_object *obj_desc, |
@@ -212,7 +211,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
212 | * field_datum_byte_offset - Byte offset of this datum within the | 211 | * field_datum_byte_offset - Byte offset of this datum within the |
213 | * parent field | 212 | * parent field |
214 | * Value - Where to store value (must at least | 213 | * Value - Where to store value (must at least |
215 | * the size of acpi_integer) | 214 | * 64 bits) |
216 | * Function - Read or Write flag plus other region- | 215 | * Function - Read or Write flag plus other region- |
217 | * dependent flags | 216 | * dependent flags |
218 | * | 217 | * |
@@ -224,8 +223,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
224 | 223 | ||
225 | acpi_status | 224 | acpi_status |
226 | acpi_ex_access_region(union acpi_operand_object *obj_desc, | 225 | acpi_ex_access_region(union acpi_operand_object *obj_desc, |
227 | u32 field_datum_byte_offset, | 226 | u32 field_datum_byte_offset, u64 *value, u32 function) |
228 | acpi_integer * value, u32 function) | ||
229 | { | 227 | { |
230 | acpi_status status; | 228 | acpi_status status; |
231 | union acpi_operand_object *rgn_desc; | 229 | union acpi_operand_object *rgn_desc; |
@@ -317,8 +315,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc, | |||
317 | ******************************************************************************/ | 315 | ******************************************************************************/ |
318 | 316 | ||
319 | static u8 | 317 | static u8 |
320 | acpi_ex_register_overflow(union acpi_operand_object *obj_desc, | 318 | acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) |
321 | acpi_integer value) | ||
322 | { | 319 | { |
323 | 320 | ||
324 | if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) { | 321 | if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) { |
@@ -329,7 +326,7 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, | |||
329 | return (FALSE); | 326 | return (FALSE); |
330 | } | 327 | } |
331 | 328 | ||
332 | if (value >= ((acpi_integer) 1 << obj_desc->common_field.bit_length)) { | 329 | if (value >= ((u64) 1 << obj_desc->common_field.bit_length)) { |
333 | /* | 330 | /* |
334 | * The Value is larger than the maximum value that can fit into | 331 | * The Value is larger than the maximum value that can fit into |
335 | * the register. | 332 | * the register. |
@@ -362,11 +359,10 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, | |||
362 | 359 | ||
363 | static acpi_status | 360 | static acpi_status |
364 | acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | 361 | acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, |
365 | u32 field_datum_byte_offset, | 362 | u32 field_datum_byte_offset, u64 *value, u32 read_write) |
366 | acpi_integer * value, u32 read_write) | ||
367 | { | 363 | { |
368 | acpi_status status; | 364 | acpi_status status; |
369 | acpi_integer local_value; | 365 | u64 local_value; |
370 | 366 | ||
371 | ACPI_FUNCTION_TRACE_U32(ex_field_datum_io, field_datum_byte_offset); | 367 | ACPI_FUNCTION_TRACE_U32(ex_field_datum_io, field_datum_byte_offset); |
372 | 368 | ||
@@ -439,8 +435,8 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
439 | * the register | 435 | * the register |
440 | */ | 436 | */ |
441 | if (acpi_ex_register_overflow(obj_desc->bank_field.bank_obj, | 437 | if (acpi_ex_register_overflow(obj_desc->bank_field.bank_obj, |
442 | (acpi_integer) obj_desc-> | 438 | (u64) obj_desc->bank_field. |
443 | bank_field.value)) { | 439 | value)) { |
444 | return_ACPI_STATUS(AE_AML_REGISTER_LIMIT); | 440 | return_ACPI_STATUS(AE_AML_REGISTER_LIMIT); |
445 | } | 441 | } |
446 | 442 | ||
@@ -481,8 +477,8 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
481 | * the register | 477 | * the register |
482 | */ | 478 | */ |
483 | if (acpi_ex_register_overflow(obj_desc->index_field.index_obj, | 479 | if (acpi_ex_register_overflow(obj_desc->index_field.index_obj, |
484 | (acpi_integer) obj_desc-> | 480 | (u64) obj_desc->index_field. |
485 | index_field.value)) { | 481 | value)) { |
486 | return_ACPI_STATUS(AE_AML_REGISTER_LIMIT); | 482 | return_ACPI_STATUS(AE_AML_REGISTER_LIMIT); |
487 | } | 483 | } |
488 | 484 | ||
@@ -512,7 +508,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
512 | status = | 508 | status = |
513 | acpi_ex_extract_from_field(obj_desc->index_field. | 509 | acpi_ex_extract_from_field(obj_desc->index_field. |
514 | data_obj, value, | 510 | data_obj, value, |
515 | sizeof(acpi_integer)); | 511 | sizeof(u64)); |
516 | } else { | 512 | } else { |
517 | /* Write the datum to the data_register */ | 513 | /* Write the datum to the data_register */ |
518 | 514 | ||
@@ -523,7 +519,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
523 | status = | 519 | status = |
524 | acpi_ex_insert_into_field(obj_desc->index_field. | 520 | acpi_ex_insert_into_field(obj_desc->index_field. |
525 | data_obj, value, | 521 | data_obj, value, |
526 | sizeof(acpi_integer)); | 522 | sizeof(u64)); |
527 | } | 523 | } |
528 | break; | 524 | break; |
529 | 525 | ||
@@ -571,13 +567,12 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc, | |||
571 | 567 | ||
572 | acpi_status | 568 | acpi_status |
573 | acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, | 569 | acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, |
574 | acpi_integer mask, | 570 | u64 mask, |
575 | acpi_integer field_value, | 571 | u64 field_value, u32 field_datum_byte_offset) |
576 | u32 field_datum_byte_offset) | ||
577 | { | 572 | { |
578 | acpi_status status = AE_OK; | 573 | acpi_status status = AE_OK; |
579 | acpi_integer merged_value; | 574 | u64 merged_value; |
580 | acpi_integer current_value; | 575 | u64 current_value; |
581 | 576 | ||
582 | ACPI_FUNCTION_TRACE_U32(ex_write_with_update_rule, mask); | 577 | ACPI_FUNCTION_TRACE_U32(ex_write_with_update_rule, mask); |
583 | 578 | ||
@@ -587,7 +582,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, | |||
587 | 582 | ||
588 | /* If the mask is all ones, we don't need to worry about the update rule */ | 583 | /* If the mask is all ones, we don't need to worry about the update rule */ |
589 | 584 | ||
590 | if (mask != ACPI_INTEGER_MAX) { | 585 | if (mask != ACPI_UINT64_MAX) { |
591 | 586 | ||
592 | /* Decode the update rule */ | 587 | /* Decode the update rule */ |
593 | 588 | ||
@@ -678,8 +673,8 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, | |||
678 | void *buffer, u32 buffer_length) | 673 | void *buffer, u32 buffer_length) |
679 | { | 674 | { |
680 | acpi_status status; | 675 | acpi_status status; |
681 | acpi_integer raw_datum; | 676 | u64 raw_datum; |
682 | acpi_integer merged_datum; | 677 | u64 merged_datum; |
683 | u32 field_offset = 0; | 678 | u32 field_offset = 0; |
684 | u32 buffer_offset = 0; | 679 | u32 buffer_offset = 0; |
685 | u32 buffer_tail_bits; | 680 | u32 buffer_tail_bits; |
@@ -804,10 +799,10 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, | |||
804 | void *buffer, u32 buffer_length) | 799 | void *buffer, u32 buffer_length) |
805 | { | 800 | { |
806 | acpi_status status; | 801 | acpi_status status; |
807 | acpi_integer mask; | 802 | u64 mask; |
808 | acpi_integer width_mask; | 803 | u64 width_mask; |
809 | acpi_integer merged_datum; | 804 | u64 merged_datum; |
810 | acpi_integer raw_datum = 0; | 805 | u64 raw_datum = 0; |
811 | u32 field_offset = 0; | 806 | u32 field_offset = 0; |
812 | u32 buffer_offset = 0; | 807 | u32 buffer_offset = 0; |
813 | u32 buffer_tail_bits; | 808 | u32 buffer_tail_bits; |
@@ -855,7 +850,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, | |||
855 | * shift operator | 850 | * shift operator |
856 | */ | 851 | */ |
857 | if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) { | 852 | if (obj_desc->common_field.access_bit_width == ACPI_INTEGER_BIT_SIZE) { |
858 | width_mask = ACPI_INTEGER_MAX; | 853 | width_mask = ACPI_UINT64_MAX; |
859 | } else { | 854 | } else { |
860 | width_mask = | 855 | width_mask = |
861 | ACPI_MASK_BITS_ABOVE(obj_desc->common_field. | 856 | ACPI_MASK_BITS_ABOVE(obj_desc->common_field. |