aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-10-21 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-12-10 00:22:54 -0500
commit0897831bb54eb36fd9e2a22da7f0f64be1b20d09 (patch)
tree8d77687ce8ebcfb62d6012d2d3c44f6a904b3c15 /drivers/acpi/utilities
parent50eca3eb89d73d9f0aa070b126c7ee6a616016ab (diff)
[ACPI] ACPICA 20051021
Implemented support for the EM64T and other x86_64 processors. This essentially entails recognizing that these processors support non-aligned memory transfers. Previously, all 64-bit processors were assumed to lack hardware support for non-aligned transfers. Completed conversion of the Resource Manager to nearly full table-driven operation. Specifically, the resource conversion code (convert AML to internal format and the reverse) and the debug code to dump internal resource descriptors are fully table-driven, reducing code and data size and improving maintainability. The OSL interfaces for Acquire and Release Lock now use a 64-bit flag word on 64-bit processors instead of a fixed 32-bit word. (Alexey Starikovskiy) Implemented support within the resource conversion code for the Type-Specific byte within the various ACPI 3.0 *WordSpace macros. Fixed some issues within the resource conversion code for the type-specific flags for both Memory and I/O address resource descriptors. For Memory, implemented support for the MTP and TTP flags. For I/O, split the TRS and TTP flags into two separate fields. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utalloc.c2
-rw-r--r--drivers/acpi/utilities/utglobal.c64
-rw-r--r--drivers/acpi/utilities/utmisc.c146
3 files changed, 159 insertions, 53 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index dc7f24b3a1c0..e04b6119a4d7 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -866,7 +866,7 @@ void acpi_ut_dump_allocations(u32 component, char *module)
866 866
867 if (!num_outstanding) { 867 if (!num_outstanding) {
868 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 868 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
869 "No outstanding allocations.\n")); 869 "No outstanding allocations\n"));
870 } else { 870 } else {
871 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 871 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
872 "%d(%X) Outstanding allocations\n", 872 "%d(%X) Outstanding allocations\n",
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 7f72839841ca..413e1dd8ae36 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -217,23 +217,23 @@ const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS] = {
217 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to 217 * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
218 * perform a Notify() operation on it. 218 * perform a Notify() operation on it.
219 */ 219 */
220const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = 220const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
221 { {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 221 {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
222{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 222 {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
223{"_SB_", ACPI_TYPE_DEVICE, NULL}, 223 {"_SB_", ACPI_TYPE_DEVICE, NULL},
224{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 224 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
225{"_TZ_", ACPI_TYPE_THERMAL, NULL}, 225 {"_TZ_", ACPI_TYPE_THERMAL, NULL},
226{"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL}, 226 {"_REV", ACPI_TYPE_INTEGER, (char *)ACPI_CA_SUPPORT_LEVEL},
227{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 227 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
228{"_GL_", ACPI_TYPE_MUTEX, (char *)1}, 228 {"_GL_", ACPI_TYPE_MUTEX, (char *)1},
229 229
230#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 230#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
231{"_OSI", ACPI_TYPE_METHOD, (char *)1}, 231 {"_OSI", ACPI_TYPE_METHOD, (char *)1},
232#endif 232#endif
233 233
234 /* Table terminator */ 234 /* Table terminator */
235 235
236{NULL, ACPI_TYPE_ANY, NULL} 236 {NULL, ACPI_TYPE_ANY, NULL}
237}; 237};
238 238
239/* 239/*
@@ -503,11 +503,13 @@ char *acpi_ut_get_region_name(u8 space_id)
503/* Event type decoding */ 503/* Event type decoding */
504 504
505static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = { 505static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {
506/*! [Begin] no source code translation (keep these strings as-is) */
506 "PM_Timer", 507 "PM_Timer",
507 "global_lock", 508 "GlobalLock",
508 "power_button", 509 "PowerButton",
509 "sleep_button", 510 "SleepButton",
510 "real_time_clock", 511 "RealTimeClock",
512/*! [End] no source code translation !*/
511}; 513};
512 514
513char *acpi_ut_get_event_name(u32 event_id) 515char *acpi_ut_get_event_name(u32 event_id)
@@ -545,12 +547,13 @@ static const char acpi_gbl_bad_type[] = "UNDEFINED";
545/* Printable names of the ACPI object types */ 547/* Printable names of the ACPI object types */
546 548
547static const char *acpi_gbl_ns_type_names[] = { 549static const char *acpi_gbl_ns_type_names[] = {
550/*! [Begin] no source code translation (keep these strings as-is) */
548 /* 00 */ "Untyped", 551 /* 00 */ "Untyped",
549 /* 01 */ "Integer", 552 /* 01 */ "Integer",
550 /* 02 */ "String", 553 /* 02 */ "String",
551 /* 03 */ "Buffer", 554 /* 03 */ "Buffer",
552 /* 04 */ "Package", 555 /* 04 */ "Package",
553 /* 05 */ "field_unit", 556 /* 05 */ "FieldUnit",
554 /* 06 */ "Device", 557 /* 06 */ "Device",
555 /* 07 */ "Event", 558 /* 07 */ "Event",
556 /* 08 */ "Method", 559 /* 08 */ "Method",
@@ -559,23 +562,24 @@ static const char *acpi_gbl_ns_type_names[] = {
559 /* 11 */ "Power", 562 /* 11 */ "Power",
560 /* 12 */ "Processor", 563 /* 12 */ "Processor",
561 /* 13 */ "Thermal", 564 /* 13 */ "Thermal",
562 /* 14 */ "buffer_field", 565 /* 14 */ "BufferField",
563 /* 15 */ "ddb_handle", 566 /* 15 */ "DdbHandle",
564 /* 16 */ "debug_object", 567 /* 16 */ "DebugObject",
565 /* 17 */ "region_field", 568 /* 17 */ "RegionField",
566 /* 18 */ "bank_field", 569 /* 18 */ "BankField",
567 /* 19 */ "index_field", 570 /* 19 */ "IndexField",
568 /* 20 */ "Reference", 571 /* 20 */ "Reference",
569 /* 21 */ "Alias", 572 /* 21 */ "Alias",
570 /* 22 */ "method_alias", 573 /* 22 */ "MethodAlias",
571 /* 23 */ "Notify", 574 /* 23 */ "Notify",
572 /* 24 */ "addr_handler", 575 /* 24 */ "AddrHandler",
573 /* 25 */ "resource_desc", 576 /* 25 */ "ResourceDesc",
574 /* 26 */ "resource_fld", 577 /* 26 */ "ResourceFld",
575 /* 27 */ "Scope", 578 /* 27 */ "Scope",
576 /* 28 */ "Extra", 579 /* 28 */ "Extra",
577 /* 29 */ "Data", 580 /* 29 */ "Data",
578 /* 30 */ "Invalid" 581 /* 30 */ "Invalid"
582/*! [End] no source code translation !*/
579}; 583};
580 584
581char *acpi_ut_get_type_name(acpi_object_type type) 585char *acpi_ut_get_type_name(acpi_object_type type)
@@ -658,15 +662,16 @@ char *acpi_ut_get_node_name(void *object)
658/* Printable names of object descriptor types */ 662/* Printable names of object descriptor types */
659 663
660static const char *acpi_gbl_desc_type_names[] = { 664static const char *acpi_gbl_desc_type_names[] = {
665/*! [Begin] no source code translation (keep these ASL Keywords as-is) */
661 /* 00 */ "Invalid", 666 /* 00 */ "Invalid",
662 /* 01 */ "Cached", 667 /* 01 */ "Cached",
663 /* 02 */ "State-Generic", 668 /* 02 */ "State-Generic",
664 /* 03 */ "State-Update", 669 /* 03 */ "State-Update",
665 /* 04 */ "State-Package", 670 /* 04 */ "State-Package",
666 /* 05 */ "State-Control", 671 /* 05 */ "State-Control",
667 /* 06 */ "State-root_parse_scope", 672 /* 06 */ "State-RootParseScope",
668 /* 07 */ "State-parse_scope", 673 /* 07 */ "State-ParseScope",
669 /* 08 */ "State-walk_scope", 674 /* 08 */ "State-WalkScope",
670 /* 09 */ "State-Result", 675 /* 09 */ "State-Result",
671 /* 10 */ "State-Notify", 676 /* 10 */ "State-Notify",
672 /* 11 */ "State-Thread", 677 /* 11 */ "State-Thread",
@@ -674,6 +679,7 @@ static const char *acpi_gbl_desc_type_names[] = {
674 /* 13 */ "Parser", 679 /* 13 */ "Parser",
675 /* 14 */ "Operand", 680 /* 14 */ "Operand",
676 /* 15 */ "Node" 681 /* 15 */ "Node"
682/*! [End] no source code translation !*/
677}; 683};
678 684
679char *acpi_ut_get_descriptor_name(void *object) 685char *acpi_ut_get_descriptor_name(void *object)
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index b57afa7421e8..e9058d4da122 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -43,6 +43,7 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include <acpi/acnamesp.h> 45#include <acpi/acnamesp.h>
46#include <acpi/amlresrc.h>
46 47
47#define _COMPONENT ACPI_UTILITIES 48#define _COMPONENT ACPI_UTILITIES
48ACPI_MODULE_NAME("utmisc") 49ACPI_MODULE_NAME("utmisc")
@@ -790,48 +791,147 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
790 791
791/******************************************************************************* 792/*******************************************************************************
792 * 793 *
794 * FUNCTION: acpi_ut_get_resource_type
795 *
796 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
797 *
798 * RETURN: The Resource Type with no extraneous bits (except the
799 * Large/Small descriptor bit -- this is left alone)
800 *
801 * DESCRIPTION: Extract the Resource Type/Name from the first byte of
802 * a resource descriptor.
803 *
804 ******************************************************************************/
805
806u8 acpi_ut_get_resource_type(void *aml)
807{
808 ACPI_FUNCTION_ENTRY();
809
810 /*
811 * Byte 0 contains the descriptor name (Resource Type)
812 * Determine if this is a small or large resource
813 */
814 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
815 /* Large Resource Type -- bits 6:0 contain the name */
816
817 return (*((u8 *) aml));
818 } else {
819 /* Small Resource Type -- bits 6:3 contain the name */
820
821 return ((u8) (*((u8 *) aml) & ACPI_RESOURCE_NAME_SMALL_MASK));
822 }
823}
824
825/*******************************************************************************
826 *
827 * FUNCTION: acpi_ut_get_resource_length
828 *
829 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
830 *
831 * RETURN: Byte Length
832 *
833 * DESCRIPTION: Get the "Resource Length" of a raw AML descriptor. By
834 * definition, this does not include the size of the descriptor
835 * header or the length field itself.
836 *
837 ******************************************************************************/
838
839u16 acpi_ut_get_resource_length(void *aml)
840{
841 u16 resource_length;
842
843 ACPI_FUNCTION_ENTRY();
844
845 /*
846 * Byte 0 contains the descriptor name (Resource Type)
847 * Determine if this is a small or large resource
848 */
849 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
850 /* Large Resource type -- bytes 1-2 contain the 16-bit length */
851
852 ACPI_MOVE_16_TO_16(&resource_length, &((u8 *) aml)[1]);
853
854 } else {
855 /* Small Resource type -- bits 2:0 of byte 0 contain the length */
856
857 resource_length = (u16) (*((u8 *) aml) &
858 ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
859 }
860
861 return (resource_length);
862}
863
864/*******************************************************************************
865 *
866 * FUNCTION: acpi_ut_get_descriptor_length
867 *
868 * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
869 *
870 * RETURN: Byte length
871 *
872 * DESCRIPTION: Get the total byte length of a raw AML descriptor, including the
873 * length of the descriptor header and the length field itself.
874 * Used to walk descriptor lists.
875 *
876 ******************************************************************************/
877
878u32 acpi_ut_get_descriptor_length(void *aml)
879{
880 u32 descriptor_length;
881
882 ACPI_FUNCTION_ENTRY();
883
884 /* First get the Resource Length (Does not include header length) */
885
886 descriptor_length = acpi_ut_get_resource_length(aml);
887
888 /* Determine if this is a small or large resource */
889
890 if (*((u8 *) aml) & ACPI_RESOURCE_NAME_LARGE) {
891 descriptor_length += sizeof(struct aml_resource_large_header);
892 } else {
893 descriptor_length += sizeof(struct aml_resource_small_header);
894 }
895
896 return (descriptor_length);
897}
898
899/*******************************************************************************
900 *
793 * FUNCTION: acpi_ut_get_resource_end_tag 901 * FUNCTION: acpi_ut_get_resource_end_tag
794 * 902 *
795 * PARAMETERS: obj_desc - The resource template buffer object 903 * PARAMETERS: obj_desc - The resource template buffer object
796 * 904 *
797 * RETURN: Pointer to the end tag 905 * RETURN: Pointer to the end tag
798 * 906 *
799 * DESCRIPTION: Find the END_TAG resource descriptor in a resource template 907 * DESCRIPTION: Find the END_TAG resource descriptor in an AML resource template
800 * 908 *
801 ******************************************************************************/ 909 ******************************************************************************/
802 910
803u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc) 911u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc)
804{ 912{
805 u8 buffer_byte; 913 u8 *aml;
806 u8 *buffer; 914 u8 *end_aml;
807 u8 *end_buffer;
808
809 buffer = obj_desc->buffer.pointer;
810 end_buffer = buffer + obj_desc->buffer.length;
811 915
812 while (buffer < end_buffer) { 916 aml = obj_desc->buffer.pointer;
813 buffer_byte = *buffer; 917 end_aml = aml + obj_desc->buffer.length;
814 if (buffer_byte & ACPI_RESOURCE_NAME_LARGE) {
815 /* Large Descriptor - Length is next 2 bytes */
816 918
817 buffer += ((*(buffer + 1) | (*(buffer + 2) << 8)) + 3); 919 /* Walk the resource template, one descriptor per loop */
818 } else {
819 /* Small Descriptor. End Tag will be found here */
820 920
821 if ((buffer_byte & ACPI_RESOURCE_NAME_SMALL_MASK) == 921 while (aml < end_aml) {
822 ACPI_RESOURCE_NAME_END_TAG) { 922 if (acpi_ut_get_resource_type(aml) ==
823 /* Found the end tag descriptor, all done. */ 923 ACPI_RESOURCE_NAME_END_TAG) {
924 /* Found the end_tag descriptor, all done */
824 925
825 return (buffer); 926 return (aml);
826 } 927 }
827 928
828 /* Length is in the header */ 929 /* Point to the next resource descriptor */
829 930
830 buffer += ((buffer_byte & 0x07) + 1); 931 aml += acpi_ut_get_resource_length(aml);
831 }
832 } 932 }
833 933
834 /* End tag not found */ 934 /* End tag was not found */
835 935
836 return (NULL); 936 return (NULL);
837} 937}