diff options
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 293 |
1 files changed, 173 insertions, 120 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 7364f5f8c9cd..5c75d35ad1cd 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -49,6 +49,33 @@ ACPI_MODULE_NAME("utmisc") | |||
49 | 49 | ||
50 | /******************************************************************************* | 50 | /******************************************************************************* |
51 | * | 51 | * |
52 | * FUNCTION: acpi_ut_is_aml_table | ||
53 | * | ||
54 | * PARAMETERS: Table - An ACPI table | ||
55 | * | ||
56 | * RETURN: TRUE if table contains executable AML; FALSE otherwise | ||
57 | * | ||
58 | * DESCRIPTION: Check ACPI Signature for a table that contains AML code. | ||
59 | * Currently, these are DSDT,SSDT,PSDT. All other table types are | ||
60 | * data tables that do not contain AML code. | ||
61 | * | ||
62 | ******************************************************************************/ | ||
63 | u8 acpi_ut_is_aml_table(struct acpi_table_header *table) | ||
64 | { | ||
65 | |||
66 | /* Ignore tables that contain AML */ | ||
67 | |||
68 | if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) || | ||
69 | ACPI_COMPARE_NAME(table->signature, PSDT_SIG) || | ||
70 | ACPI_COMPARE_NAME(table->signature, SSDT_SIG)) { | ||
71 | return (TRUE); | ||
72 | } | ||
73 | |||
74 | return (FALSE); | ||
75 | } | ||
76 | |||
77 | /******************************************************************************* | ||
78 | * | ||
52 | * FUNCTION: acpi_ut_allocate_owner_id | 79 | * FUNCTION: acpi_ut_allocate_owner_id |
53 | * | 80 | * |
54 | * PARAMETERS: owner_id - Where the new owner ID is returned | 81 | * PARAMETERS: owner_id - Where the new owner ID is returned |
@@ -60,6 +87,7 @@ ACPI_MODULE_NAME("utmisc") | |||
60 | * when the method exits or the table is unloaded. | 87 | * when the method exits or the table is unloaded. |
61 | * | 88 | * |
62 | ******************************************************************************/ | 89 | ******************************************************************************/ |
90 | |||
63 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | 91 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) |
64 | { | 92 | { |
65 | acpi_native_uint i; | 93 | acpi_native_uint i; |
@@ -67,7 +95,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
67 | acpi_native_uint k; | 95 | acpi_native_uint k; |
68 | acpi_status status; | 96 | acpi_status status; |
69 | 97 | ||
70 | ACPI_FUNCTION_TRACE("ut_allocate_owner_id"); | 98 | ACPI_FUNCTION_TRACE(ut_allocate_owner_id); |
71 | 99 | ||
72 | /* Guard against multiple allocations of ID to the same location */ | 100 | /* Guard against multiple allocations of ID to the same location */ |
73 | 101 | ||
@@ -97,6 +125,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
97 | 125 | ||
98 | for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) { | 126 | for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) { |
99 | if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) { | 127 | if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) { |
128 | |||
100 | /* There are no free IDs in this mask */ | 129 | /* There are no free IDs in this mask */ |
101 | 130 | ||
102 | break; | 131 | break; |
@@ -123,7 +152,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
123 | (acpi_owner_id) ((k + 1) + ACPI_MUL_32(j)); | 152 | (acpi_owner_id) ((k + 1) + ACPI_MUL_32(j)); |
124 | 153 | ||
125 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, | 154 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, |
126 | "Allocated owner_id: %2.2X\n", | 155 | "Allocated OwnerId: %2.2X\n", |
127 | (unsigned int)*owner_id)); | 156 | (unsigned int)*owner_id)); |
128 | goto exit; | 157 | goto exit; |
129 | } | 158 | } |
@@ -144,7 +173,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
144 | */ | 173 | */ |
145 | status = AE_OWNER_ID_LIMIT; | 174 | status = AE_OWNER_ID_LIMIT; |
146 | ACPI_ERROR((AE_INFO, | 175 | ACPI_ERROR((AE_INFO, |
147 | "Could not allocate new owner_id (255 max), AE_OWNER_ID_LIMIT")); | 176 | "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT")); |
148 | 177 | ||
149 | exit: | 178 | exit: |
150 | (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); | 179 | (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); |
@@ -172,7 +201,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
172 | acpi_native_uint index; | 201 | acpi_native_uint index; |
173 | u32 bit; | 202 | u32 bit; |
174 | 203 | ||
175 | ACPI_FUNCTION_TRACE_U32("ut_release_owner_id", owner_id); | 204 | ACPI_FUNCTION_TRACE_U32(ut_release_owner_id, owner_id); |
176 | 205 | ||
177 | /* Always clear the input owner_id (zero is an invalid ID) */ | 206 | /* Always clear the input owner_id (zero is an invalid ID) */ |
178 | 207 | ||
@@ -181,7 +210,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
181 | /* Zero is not a valid owner_iD */ | 210 | /* Zero is not a valid owner_iD */ |
182 | 211 | ||
183 | if (owner_id == 0) { | 212 | if (owner_id == 0) { |
184 | ACPI_ERROR((AE_INFO, "Invalid owner_id: %2.2X", owner_id)); | 213 | ACPI_ERROR((AE_INFO, "Invalid OwnerId: %2.2X", owner_id)); |
185 | return_VOID; | 214 | return_VOID; |
186 | } | 215 | } |
187 | 216 | ||
@@ -207,7 +236,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
207 | acpi_gbl_owner_id_mask[index] ^= bit; | 236 | acpi_gbl_owner_id_mask[index] ^= bit; |
208 | } else { | 237 | } else { |
209 | ACPI_ERROR((AE_INFO, | 238 | ACPI_ERROR((AE_INFO, |
210 | "Release of non-allocated owner_id: %2.2X", | 239 | "Release of non-allocated OwnerId: %2.2X", |
211 | owner_id + 1)); | 240 | owner_id + 1)); |
212 | } | 241 | } |
213 | 242 | ||
@@ -273,6 +302,7 @@ void acpi_ut_print_string(char *string, u8 max_length) | |||
273 | 302 | ||
274 | acpi_os_printf("\""); | 303 | acpi_os_printf("\""); |
275 | for (i = 0; string[i] && (i < max_length); i++) { | 304 | for (i = 0; string[i] && (i < max_length); i++) { |
305 | |||
276 | /* Escape sequences */ | 306 | /* Escape sequences */ |
277 | 307 | ||
278 | switch (string[i]) { | 308 | switch (string[i]) { |
@@ -461,12 +491,47 @@ acpi_ut_display_init_pathname(u8 type, | |||
461 | } | 491 | } |
462 | acpi_os_printf("\n"); | 492 | acpi_os_printf("\n"); |
463 | 493 | ||
464 | ACPI_MEM_FREE(buffer.pointer); | 494 | ACPI_FREE(buffer.pointer); |
465 | } | 495 | } |
466 | #endif | 496 | #endif |
467 | 497 | ||
468 | /******************************************************************************* | 498 | /******************************************************************************* |
469 | * | 499 | * |
500 | * FUNCTION: acpi_ut_valid_acpi_char | ||
501 | * | ||
502 | * PARAMETERS: Char - The character to be examined | ||
503 | * | ||
504 | * RETURN: TRUE if the character is valid, FALSE otherwise | ||
505 | * | ||
506 | * DESCRIPTION: Check for a valid ACPI character. Must be one of: | ||
507 | * 1) Upper case alpha | ||
508 | * 2) numeric | ||
509 | * 3) underscore | ||
510 | * | ||
511 | * We allow a '!' as the last character because of the ASF! table | ||
512 | * | ||
513 | ******************************************************************************/ | ||
514 | |||
515 | u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position) | ||
516 | { | ||
517 | |||
518 | if (!((character >= 'A' && character <= 'Z') || | ||
519 | (character >= '0' && character <= '9') || (character == '_'))) { | ||
520 | |||
521 | /* Allow a '!' in the last position */ | ||
522 | |||
523 | if (character == '!' && position == 3) { | ||
524 | return (TRUE); | ||
525 | } | ||
526 | |||
527 | return (FALSE); | ||
528 | } | ||
529 | |||
530 | return (TRUE); | ||
531 | } | ||
532 | |||
533 | /******************************************************************************* | ||
534 | * | ||
470 | * FUNCTION: acpi_ut_valid_acpi_name | 535 | * FUNCTION: acpi_ut_valid_acpi_name |
471 | * | 536 | * |
472 | * PARAMETERS: Name - The name to be examined | 537 | * PARAMETERS: Name - The name to be examined |
@@ -482,19 +547,13 @@ acpi_ut_display_init_pathname(u8 type, | |||
482 | 547 | ||
483 | u8 acpi_ut_valid_acpi_name(u32 name) | 548 | u8 acpi_ut_valid_acpi_name(u32 name) |
484 | { | 549 | { |
485 | char *name_ptr = (char *)&name; | ||
486 | char character; | ||
487 | acpi_native_uint i; | 550 | acpi_native_uint i; |
488 | 551 | ||
489 | ACPI_FUNCTION_ENTRY(); | 552 | ACPI_FUNCTION_ENTRY(); |
490 | 553 | ||
491 | for (i = 0; i < ACPI_NAME_SIZE; i++) { | 554 | for (i = 0; i < ACPI_NAME_SIZE; i++) { |
492 | character = *name_ptr; | 555 | if (!acpi_ut_valid_acpi_char |
493 | name_ptr++; | 556 | ((ACPI_CAST_PTR(char, &name))[i], i)) { |
494 | |||
495 | if (!((character == '_') || | ||
496 | (character >= 'A' && character <= 'Z') || | ||
497 | (character >= '0' && character <= '9'))) { | ||
498 | return (FALSE); | 557 | return (FALSE); |
499 | } | 558 | } |
500 | } | 559 | } |
@@ -504,24 +563,37 @@ u8 acpi_ut_valid_acpi_name(u32 name) | |||
504 | 563 | ||
505 | /******************************************************************************* | 564 | /******************************************************************************* |
506 | * | 565 | * |
507 | * FUNCTION: acpi_ut_valid_acpi_character | 566 | * FUNCTION: acpi_ut_repair_name |
508 | * | 567 | * |
509 | * PARAMETERS: Character - The character to be examined | 568 | * PARAMETERS: Name - The ACPI name to be repaired |
510 | * | 569 | * |
511 | * RETURN: 1 if Character may appear in a name, else 0 | 570 | * RETURN: Repaired version of the name |
512 | * | 571 | * |
513 | * DESCRIPTION: Check for a printable character | 572 | * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and |
573 | * return the new name. | ||
514 | * | 574 | * |
515 | ******************************************************************************/ | 575 | ******************************************************************************/ |
516 | 576 | ||
517 | u8 acpi_ut_valid_acpi_character(char character) | 577 | acpi_name acpi_ut_repair_name(acpi_name name) |
518 | { | 578 | { |
579 | char *name_ptr = ACPI_CAST_PTR(char, &name); | ||
580 | char new_name[ACPI_NAME_SIZE]; | ||
581 | acpi_native_uint i; | ||
519 | 582 | ||
520 | ACPI_FUNCTION_ENTRY(); | 583 | for (i = 0; i < ACPI_NAME_SIZE; i++) { |
584 | new_name[i] = name_ptr[i]; | ||
521 | 585 | ||
522 | return ((u8) ((character == '_') || | 586 | /* |
523 | (character >= 'A' && character <= 'Z') || | 587 | * Replace a bad character with something printable, yet technically |
524 | (character >= '0' && character <= '9'))); | 588 | * still invalid. This prevents any collisions with existing "good" |
589 | * names in the namespace. | ||
590 | */ | ||
591 | if (!acpi_ut_valid_acpi_char(name_ptr[i], i)) { | ||
592 | new_name[i] = '*'; | ||
593 | } | ||
594 | } | ||
595 | |||
596 | return (*ACPI_CAST_PTR(u32, new_name)); | ||
525 | } | 597 | } |
526 | 598 | ||
527 | /******************************************************************************* | 599 | /******************************************************************************* |
@@ -529,7 +601,8 @@ u8 acpi_ut_valid_acpi_character(char character) | |||
529 | * FUNCTION: acpi_ut_strtoul64 | 601 | * FUNCTION: acpi_ut_strtoul64 |
530 | * | 602 | * |
531 | * PARAMETERS: String - Null terminated string | 603 | * PARAMETERS: String - Null terminated string |
532 | * Base - Radix of the string: 10, 16, or ACPI_ANY_BASE | 604 | * Base - Radix of the string: 16 or ACPI_ANY_BASE; |
605 | * ACPI_ANY_BASE means 'in behalf of to_integer' | ||
533 | * ret_integer - Where the converted integer is returned | 606 | * ret_integer - Where the converted integer is returned |
534 | * | 607 | * |
535 | * RETURN: Status and Converted value | 608 | * RETURN: Status and Converted value |
@@ -545,16 +618,17 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
545 | u32 this_digit = 0; | 618 | u32 this_digit = 0; |
546 | acpi_integer return_value = 0; | 619 | acpi_integer return_value = 0; |
547 | acpi_integer quotient; | 620 | acpi_integer quotient; |
621 | acpi_integer dividend; | ||
622 | u32 to_integer_op = (base == ACPI_ANY_BASE); | ||
623 | u32 mode32 = (acpi_gbl_integer_byte_width == 4); | ||
624 | u8 valid_digits = 0; | ||
625 | u8 sign_of0x = 0; | ||
626 | u8 term = 0; | ||
548 | 627 | ||
549 | ACPI_FUNCTION_TRACE("ut_stroul64"); | 628 | ACPI_FUNCTION_TRACE(ut_stroul64); |
550 | |||
551 | if ((!string) || !(*string)) { | ||
552 | goto error_exit; | ||
553 | } | ||
554 | 629 | ||
555 | switch (base) { | 630 | switch (base) { |
556 | case ACPI_ANY_BASE: | 631 | case ACPI_ANY_BASE: |
557 | case 10: | ||
558 | case 16: | 632 | case 16: |
559 | break; | 633 | break; |
560 | 634 | ||
@@ -563,76 +637,110 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
563 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 637 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
564 | } | 638 | } |
565 | 639 | ||
640 | if (!string) { | ||
641 | goto error_exit; | ||
642 | } | ||
643 | |||
566 | /* Skip over any white space in the buffer */ | 644 | /* Skip over any white space in the buffer */ |
567 | 645 | ||
568 | while (ACPI_IS_SPACE(*string) || *string == '\t') { | 646 | while ((*string) && (ACPI_IS_SPACE(*string) || *string == '\t')) { |
569 | string++; | 647 | string++; |
570 | } | 648 | } |
571 | 649 | ||
572 | /* | 650 | if (to_integer_op) { |
573 | * If the input parameter Base is zero, then we need to | 651 | /* |
574 | * determine if it is decimal or hexadecimal: | 652 | * Base equal to ACPI_ANY_BASE means 'to_integer operation case'. |
575 | */ | 653 | * We need to determine if it is decimal or hexadecimal. |
576 | if (base == 0) { | 654 | */ |
577 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { | 655 | if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { |
656 | sign_of0x = 1; | ||
578 | base = 16; | 657 | base = 16; |
658 | |||
659 | /* Skip over the leading '0x' */ | ||
579 | string += 2; | 660 | string += 2; |
580 | } else { | 661 | } else { |
581 | base = 10; | 662 | base = 10; |
582 | } | 663 | } |
583 | } | 664 | } |
584 | 665 | ||
585 | /* | 666 | /* Any string left? Check that '0x' is not followed by white space. */ |
586 | * For hexadecimal base, skip over the leading | 667 | |
587 | * 0 or 0x, if they are present. | 668 | if (!(*string) || ACPI_IS_SPACE(*string) || *string == '\t') { |
588 | */ | 669 | if (to_integer_op) { |
589 | if ((base == 16) && | 670 | goto error_exit; |
590 | (*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { | 671 | } else { |
591 | string += 2; | 672 | goto all_done; |
673 | } | ||
592 | } | 674 | } |
593 | 675 | ||
594 | /* Any string left? */ | 676 | dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; |
595 | 677 | ||
596 | if (!(*string)) { | 678 | /* At least one character in the string here */ |
597 | goto error_exit; | ||
598 | } | ||
599 | 679 | ||
600 | /* Main loop: convert the string to a 64-bit integer */ | 680 | /* Main loop: convert the string to a 64-bit integer */ |
601 | 681 | ||
602 | while (*string) { | 682 | while (*string) { |
603 | if (ACPI_IS_DIGIT(*string)) { | 683 | if (ACPI_IS_DIGIT(*string)) { |
684 | |||
604 | /* Convert ASCII 0-9 to Decimal value */ | 685 | /* Convert ASCII 0-9 to Decimal value */ |
605 | 686 | ||
606 | this_digit = ((u8) * string) - '0'; | 687 | this_digit = ((u8) * string) - '0'; |
607 | } else { | 688 | } else if (base == 10) { |
608 | if (base == 10) { | ||
609 | /* Digit is out of range */ | ||
610 | 689 | ||
611 | goto error_exit; | 690 | /* Digit is out of range; possible in to_integer case only */ |
612 | } | ||
613 | 691 | ||
692 | term = 1; | ||
693 | } else { | ||
614 | this_digit = (u8) ACPI_TOUPPER(*string); | 694 | this_digit = (u8) ACPI_TOUPPER(*string); |
615 | if (ACPI_IS_XDIGIT((char)this_digit)) { | 695 | if (ACPI_IS_XDIGIT((char)this_digit)) { |
696 | |||
616 | /* Convert ASCII Hex char to value */ | 697 | /* Convert ASCII Hex char to value */ |
617 | 698 | ||
618 | this_digit = this_digit - 'A' + 10; | 699 | this_digit = this_digit - 'A' + 10; |
619 | } else { | 700 | } else { |
620 | /* | 701 | term = 1; |
621 | * We allow non-hex chars, just stop now, same as end-of-string. | 702 | } |
622 | * See ACPI spec, string-to-integer conversion. | 703 | } |
623 | */ | 704 | |
705 | if (term) { | ||
706 | if (to_integer_op) { | ||
707 | goto error_exit; | ||
708 | } else { | ||
624 | break; | 709 | break; |
625 | } | 710 | } |
711 | } else if ((valid_digits == 0) && (this_digit == 0) | ||
712 | && !sign_of0x) { | ||
713 | |||
714 | /* Skip zeros */ | ||
715 | string++; | ||
716 | continue; | ||
717 | } | ||
718 | |||
719 | valid_digits++; | ||
720 | |||
721 | if (sign_of0x | ||
722 | && ((valid_digits > 16) | ||
723 | || ((valid_digits > 8) && mode32))) { | ||
724 | /* | ||
725 | * This is to_integer operation case. | ||
726 | * No any restrictions for string-to-integer conversion, | ||
727 | * see ACPI spec. | ||
728 | */ | ||
729 | goto error_exit; | ||
626 | } | 730 | } |
627 | 731 | ||
628 | /* Divide the digit into the correct position */ | 732 | /* Divide the digit into the correct position */ |
629 | 733 | ||
630 | (void) | 734 | (void) |
631 | acpi_ut_short_divide((ACPI_INTEGER_MAX - | 735 | acpi_ut_short_divide((dividend - (acpi_integer) this_digit), |
632 | (acpi_integer) this_digit), base, | 736 | base, "ient, NULL); |
633 | "ient, NULL); | 737 | |
634 | if (return_value > quotient) { | 738 | if (return_value > quotient) { |
635 | goto error_exit; | 739 | if (to_integer_op) { |
740 | goto error_exit; | ||
741 | } else { | ||
742 | break; | ||
743 | } | ||
636 | } | 744 | } |
637 | 745 | ||
638 | return_value *= base; | 746 | return_value *= base; |
@@ -642,6 +750,8 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
642 | 750 | ||
643 | /* All done, normal exit */ | 751 | /* All done, normal exit */ |
644 | 752 | ||
753 | all_done: | ||
754 | |||
645 | *ret_integer = return_value; | 755 | *ret_integer = return_value; |
646 | return_ACPI_STATUS(AE_OK); | 756 | return_ACPI_STATUS(AE_OK); |
647 | 757 | ||
@@ -719,7 +829,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
719 | u32 this_index; | 829 | u32 this_index; |
720 | union acpi_operand_object *this_source_obj; | 830 | union acpi_operand_object *this_source_obj; |
721 | 831 | ||
722 | ACPI_FUNCTION_TRACE("ut_walk_package_tree"); | 832 | ACPI_FUNCTION_TRACE(ut_walk_package_tree); |
723 | 833 | ||
724 | state = acpi_ut_create_pkg_state(source_object, target_object, 0); | 834 | state = acpi_ut_create_pkg_state(source_object, target_object, 0); |
725 | if (!state) { | 835 | if (!state) { |
@@ -727,6 +837,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
727 | } | 837 | } |
728 | 838 | ||
729 | while (state) { | 839 | while (state) { |
840 | |||
730 | /* Get one element of the package */ | 841 | /* Get one element of the package */ |
731 | 842 | ||
732 | this_index = state->pkg.index; | 843 | this_index = state->pkg.index; |
@@ -814,31 +925,6 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
814 | 925 | ||
815 | /******************************************************************************* | 926 | /******************************************************************************* |
816 | * | 927 | * |
817 | * FUNCTION: acpi_ut_generate_checksum | ||
818 | * | ||
819 | * PARAMETERS: Buffer - Buffer to be scanned | ||
820 | * Length - number of bytes to examine | ||
821 | * | ||
822 | * RETURN: The generated checksum | ||
823 | * | ||
824 | * DESCRIPTION: Generate a checksum on a raw buffer | ||
825 | * | ||
826 | ******************************************************************************/ | ||
827 | |||
828 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length) | ||
829 | { | ||
830 | u32 i; | ||
831 | signed char sum = 0; | ||
832 | |||
833 | for (i = 0; i < length; i++) { | ||
834 | sum = (signed char)(sum + buffer[i]); | ||
835 | } | ||
836 | |||
837 | return ((u8) (0 - sum)); | ||
838 | } | ||
839 | |||
840 | /******************************************************************************* | ||
841 | * | ||
842 | * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info | 928 | * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info |
843 | * | 929 | * |
844 | * PARAMETERS: module_name - Caller's module name (for error output) | 930 | * PARAMETERS: module_name - Caller's module name (for error output) |
@@ -900,36 +986,3 @@ acpi_ut_info(char *module_name, u32 line_number, char *format, ...) | |||
900 | acpi_os_vprintf(format, args); | 986 | acpi_os_vprintf(format, args); |
901 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); | 987 | acpi_os_printf(" [%X]\n", ACPI_CA_VERSION); |
902 | } | 988 | } |
903 | |||
904 | /******************************************************************************* | ||
905 | * | ||
906 | * FUNCTION: acpi_ut_report_error, Warning, Info | ||
907 | * | ||
908 | * PARAMETERS: module_name - Caller's module name (for error output) | ||
909 | * line_number - Caller's line number (for error output) | ||
910 | * | ||
911 | * RETURN: None | ||
912 | * | ||
913 | * DESCRIPTION: Print error message | ||
914 | * | ||
915 | * Note: Legacy only, should be removed when no longer used by drivers. | ||
916 | * | ||
917 | ******************************************************************************/ | ||
918 | |||
919 | void acpi_ut_report_error(char *module_name, u32 line_number) | ||
920 | { | ||
921 | |||
922 | acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number); | ||
923 | } | ||
924 | |||
925 | void acpi_ut_report_warning(char *module_name, u32 line_number) | ||
926 | { | ||
927 | |||
928 | acpi_os_printf("ACPI Warning (%s-%04d): ", module_name, line_number); | ||
929 | } | ||
930 | |||
931 | void acpi_ut_report_info(char *module_name, u32 line_number) | ||
932 | { | ||
933 | |||
934 | acpi_os_printf("ACPI (%s-%04d): ", module_name, line_number); | ||
935 | } | ||