aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/uteval.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-04-21 17:15:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:30:55 -0400
commitb229cf92eee616c7cb5ad8cdb35a19b119f00bc8 (patch)
tree74b52bec6ec029859c2320aba227290a503af31a /drivers/acpi/utilities/uteval.c
parent793c2388cae3fd023b3b5166354931752d42353c (diff)
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in 20051216 where the _STA method was not run unless an _INI was also present for the same device. This optimization could cause problems because it could allow _INI methods to be run within a not-present device subtree (If a not-present device had no _INI, _STA would not be run, the not-present status would not be discovered, and the children of the device would be incorrectly traversed.) Implemented a new _STA optimization where namespace subtrees that do not contain _INI are identified and ignored during device initialization. Selectively running _STA can significantly improve boot time on large machines (with assistance from Len Brown.) Implemented support for the device initialization case where the returned _STA flags indicate a device not-present but functioning. In this case, _INI is not run, but the device children are examined for presence, as per the ACPI specification. Implemented an additional change to the IndexField support in order to conform to MS behavior. The value written to the Index Register is not simply a byte offset, it is a byte offset in units of the access width of the parent Index Field. (Fiodor Suietov) Defined and deployed a new OSL interface, acpi_os_validate_address(). This interface is called during the creation of all AML operation regions, and allows the host OS to exert control over what addresses it will allow the AML code to access. Operation Regions whose addresses are disallowed will cause a runtime exception when they are actually accessed (will not affect or abort table loading.) Defined and deployed a new OSL interface, acpi_os_validate_interface(). This interface allows the host OS to match the various "optional" interface/behavior strings for the _OSI predefined control method as appropriate (with assistance from Bjorn Helgaas.) Restructured and corrected various problems in the exception handling code paths within DsCallControlMethod and DsTerminateControlMethod in dsmethod (with assistance from Takayoshi Kochi.) Modified the Linux source converter to ignore quoted string literals while converting identifiers from mixed to lower case. This will correct problems with the disassembler and other areas where such strings must not be modified. The ACPI_FUNCTION_* macros no longer require quotes around the function name. This allows the Linux source converter to convert the names, now that the converter ignores quoted strings. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/uteval.c')
-rw-r--r--drivers/acpi/utilities/uteval.c88
1 files changed, 67 insertions, 21 deletions
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 68b9eff4b326..444d3a502c46 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -56,6 +56,34 @@ static acpi_status
56acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, 56acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
57 struct acpi_compatible_id *one_cid); 57 struct acpi_compatible_id *one_cid);
58 58
59/*
60 * Strings supported by the _OSI predefined (internal) method.
61 */
62static const char *acpi_interfaces_supported[] = {
63 /* Operating System Vendor Strings */
64
65 "Linux",
66 "Windows 2000",
67 "Windows 2001",
68 "Windows 2001 SP0",
69 "Windows 2001 SP1",
70 "Windows 2001 SP2",
71 "Windows 2001 SP3",
72 "Windows 2001 SP4",
73 "Windows 2001.1",
74 "Windows 2001.1 SP1", /* Added 03/2006 */
75 "Windows 2006", /* Added 03/2006 */
76
77 /* Feature Group Strings */
78
79 "Extended Address Space Descriptor"
80 /*
81 * All "optional" feature group strings (features that are implemented
82 * by the host) should be implemented in the host version of
83 * acpi_os_validate_interface and should not be added here.
84 */
85};
86
59/******************************************************************************* 87/*******************************************************************************
60 * 88 *
61 * FUNCTION: acpi_ut_osi_implementation 89 * FUNCTION: acpi_ut_osi_implementation
@@ -64,18 +92,18 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
64 * 92 *
65 * RETURN: Status 93 * RETURN: Status
66 * 94 *
67 * DESCRIPTION: Implementation of _OSI predefined control method 95 * DESCRIPTION: Implementation of the _OSI predefined control method
68 * Supported = _OSI (String)
69 * 96 *
70 ******************************************************************************/ 97 ******************************************************************************/
71 98
72acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) 99acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
73{ 100{
101 acpi_status status;
74 union acpi_operand_object *string_desc; 102 union acpi_operand_object *string_desc;
75 union acpi_operand_object *return_desc; 103 union acpi_operand_object *return_desc;
76 acpi_native_uint i; 104 acpi_native_uint i;
77 105
78 ACPI_FUNCTION_TRACE("ut_osi_implementation"); 106 ACPI_FUNCTION_TRACE(ut_osi_implementation);
79 107
80 /* Validate the string input argument */ 108 /* Validate the string input argument */
81 109
@@ -84,29 +112,47 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
84 return_ACPI_STATUS(AE_TYPE); 112 return_ACPI_STATUS(AE_TYPE);
85 } 113 }
86 114
87 /* Create a return object (Default value = 0) */ 115 /* Create a return object */
88 116
89 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); 117 return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
90 if (!return_desc) { 118 if (!return_desc) {
91 return_ACPI_STATUS(AE_NO_MEMORY); 119 return_ACPI_STATUS(AE_NO_MEMORY);
92 } 120 }
93 121
94 /* Compare input string to table of supported strings */ 122 /* Default return value is SUPPORTED */
95 123
96 for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) { 124 return_desc->integer.value = ACPI_UINT32_MAX;
97 if (!ACPI_STRCMP(string_desc->string.pointer, 125 walk_state->return_desc = return_desc;
98 ACPI_CAST_PTR(char, 126
99 acpi_gbl_valid_osi_strings[i]))) 127 /* Compare input string to static table of supported interfaces */
100 {
101 128
102 /* This string is supported */ 129 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
130 if (!ACPI_STRCMP
131 (string_desc->string.pointer,
132 acpi_interfaces_supported[i])) {
103 133
104 return_desc->integer.value = 0xFFFFFFFF; 134 /* The interface is supported */
105 break; 135
136 return_ACPI_STATUS(AE_CTRL_TERMINATE);
106 } 137 }
107 } 138 }
108 139
109 walk_state->return_desc = return_desc; 140 /*
141 * Did not match the string in the static table, call the host OSL to
142 * check for a match with one of the optional strings (such as
143 * "Module Device", "3.0 Thermal Model", etc.)
144 */
145 status = acpi_os_validate_interface(string_desc->string.pointer);
146 if (ACPI_SUCCESS(status)) {
147
148 /* The interface is supported */
149
150 return_ACPI_STATUS(AE_CTRL_TERMINATE);
151 }
152
153 /* The interface is not supported */
154
155 return_desc->integer.value = 0;
110 return_ACPI_STATUS(AE_CTRL_TERMINATE); 156 return_ACPI_STATUS(AE_CTRL_TERMINATE);
111} 157}
112 158
@@ -139,7 +185,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
139 acpi_status status; 185 acpi_status status;
140 u32 return_btype; 186 u32 return_btype;
141 187
142 ACPI_FUNCTION_TRACE("ut_evaluate_object"); 188 ACPI_FUNCTION_TRACE(ut_evaluate_object);
143 189
144 info.node = prefix_node; 190 info.node = prefix_node;
145 info.parameters = NULL; 191 info.parameters = NULL;
@@ -258,7 +304,7 @@ acpi_ut_evaluate_numeric_object(char *object_name,
258 union acpi_operand_object *obj_desc; 304 union acpi_operand_object *obj_desc;
259 acpi_status status; 305 acpi_status status;
260 306
261 ACPI_FUNCTION_TRACE("ut_evaluate_numeric_object"); 307 ACPI_FUNCTION_TRACE(ut_evaluate_numeric_object);
262 308
263 status = acpi_ut_evaluate_object(device_node, object_name, 309 status = acpi_ut_evaluate_object(device_node, object_name,
264 ACPI_BTYPE_INTEGER, &obj_desc); 310 ACPI_BTYPE_INTEGER, &obj_desc);
@@ -334,7 +380,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
334 union acpi_operand_object *obj_desc; 380 union acpi_operand_object *obj_desc;
335 acpi_status status; 381 acpi_status status;
336 382
337 ACPI_FUNCTION_TRACE("ut_execute_HID"); 383 ACPI_FUNCTION_TRACE(ut_execute_HID);
338 384
339 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__HID, 385 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__HID,
340 ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, 386 ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING,
@@ -438,7 +484,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node,
438 struct acpi_compatible_id_list *cid_list; 484 struct acpi_compatible_id_list *cid_list;
439 acpi_native_uint i; 485 acpi_native_uint i;
440 486
441 ACPI_FUNCTION_TRACE("ut_execute_CID"); 487 ACPI_FUNCTION_TRACE(ut_execute_CID);
442 488
443 /* Evaluate the _CID method for this device */ 489 /* Evaluate the _CID method for this device */
444 490
@@ -536,7 +582,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
536 union acpi_operand_object *obj_desc; 582 union acpi_operand_object *obj_desc;
537 acpi_status status; 583 acpi_status status;
538 584
539 ACPI_FUNCTION_TRACE("ut_execute_UID"); 585 ACPI_FUNCTION_TRACE(ut_execute_UID);
540 586
541 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__UID, 587 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__UID,
542 ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, 588 ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING,
@@ -586,7 +632,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, u32 * flags)
586 union acpi_operand_object *obj_desc; 632 union acpi_operand_object *obj_desc;
587 acpi_status status; 633 acpi_status status;
588 634
589 ACPI_FUNCTION_TRACE("ut_execute_STA"); 635 ACPI_FUNCTION_TRACE(ut_execute_STA);
590 636
591 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__STA, 637 status = acpi_ut_evaluate_object(device_node, METHOD_NAME__STA,
592 ACPI_BTYPE_INTEGER, &obj_desc); 638 ACPI_BTYPE_INTEGER, &obj_desc);
@@ -636,7 +682,7 @@ acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest)
636 acpi_status status; 682 acpi_status status;
637 u32 i; 683 u32 i;
638 684
639 ACPI_FUNCTION_TRACE("ut_execute_Sxds"); 685 ACPI_FUNCTION_TRACE(ut_execute_sxds);
640 686
641 for (i = 0; i < 4; i++) { 687 for (i = 0; i < 4; i++) {
642 highest[i] = 0xFF; 688 highest[i] = 0xFF;