aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-26 19:28:48 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-26 19:28:48 -0400
commitafdca01c9821134e71011029a194dd8fcb88c97e (patch)
treec3a4862547760c3aaae5a8260ba3796a40bf47a6 /drivers/acpi/acpica
parent4b319f290d3b9c756228a66f72095d0039ec1b50 (diff)
parent36b99b22877bd25162239f1b00477ee6ae2d01ee (diff)
Merge branch 'acpica'
* acpica: ACPICA: Update version to 20130725. ACPICA: Update names for walk_namespace callbacks to clarify usage. ACPICA: Return error if DerefOf resolves to a null package element. ACPICA: Make ACPI Power Management Timer (PM Timer) optional. ACPICA: Fix divergences of the commit - ACPICA: Expose OSI version. ACPICA: Fix possible fault for methods that optionally have no return value. ACPICA: DeRefOf operator: Update to fully resolve FieldUnit and BufferField refs. ACPICA: Emit all unresolved method externals in a text block ACPICA: Export acpi_tb_validate_rsdp(). ACPI: Add facility to remove all _OSI strings ACPI: Add facility to disable all _OSI OS vendor strings ACPICA: Add acpi_update_interfaces() public interface ACPICA: Update version to 20130626 ACPICA: Fix compiler warnings for casting issues (only some compilers) ACPICA: Remove restriction of 256 maximum GPEs in any GPE block ACPICA: Disassembler: Expand maximum output string length to 64K ACPICA: TableManager: Export acpi_tb_scan_memory_for_rsdp() ACPICA: Update comments about behavior when _STA does not exist
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/acglobal.h7
-rw-r--r--drivers/acpi/acpica/aclocal.h4
-rw-r--r--drivers/acpi/acpica/acnamesp.h4
-rw-r--r--drivers/acpi/acpica/actables.h7
-rw-r--r--drivers/acpi/acpica/acutils.h4
-rw-r--r--drivers/acpi/acpica/evgpeinit.c11
-rw-r--r--drivers/acpi/acpica/exdump.c6
-rw-r--r--drivers/acpi/acpica/exoparg1.c48
-rw-r--r--drivers/acpi/acpica/hwtimer.c13
-rw-r--r--drivers/acpi/acpica/nspredef.c16
-rw-r--r--drivers/acpi/acpica/nswalk.c26
-rw-r--r--drivers/acpi/acpica/nsxfeval.c16
-rw-r--r--drivers/acpi/acpica/nsxfname.c11
-rw-r--r--drivers/acpi/acpica/tbfadt.c4
-rw-r--r--drivers/acpi/acpica/tbxfroot.c12
-rw-r--r--drivers/acpi/acpica/uteval.c8
-rw-r--r--drivers/acpi/acpica/utglobal.c1
-rw-r--r--drivers/acpi/acpica/utosi.c77
-rw-r--r--drivers/acpi/acpica/utstring.c5
-rw-r--r--drivers/acpi/acpica/utxface.c29
20 files changed, 232 insertions, 77 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index b8d38117a20c..90e846f985fa 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -138,6 +138,12 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_auto_repair, FALSE);
138 */ 138 */
139u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_ssdt_table_load, FALSE); 139u8 ACPI_INIT_GLOBAL(acpi_gbl_disable_ssdt_table_load, FALSE);
140 140
141/*
142 * We keep track of the latest version of Windows that has been requested by
143 * the BIOS.
144 */
145u8 ACPI_INIT_GLOBAL(acpi_gbl_osi_data, 0);
146
141/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ 147/* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */
142 148
143struct acpi_table_fadt acpi_gbl_FADT; 149struct acpi_table_fadt acpi_gbl_FADT;
@@ -285,7 +291,6 @@ ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
285ACPI_EXTERN u8 acpi_gbl_step_to_next_call; 291ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
286ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; 292ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
287ACPI_EXTERN u8 acpi_gbl_events_initialized; 293ACPI_EXTERN u8 acpi_gbl_events_initialized;
288ACPI_EXTERN u8 acpi_gbl_osi_data;
289ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces; 294ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces;
290ACPI_EXTERN struct acpi_address_range 295ACPI_EXTERN struct acpi_address_range
291 *acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX]; 296 *acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX];
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index d4a4901637cd..0ed00669cd21 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -942,6 +942,9 @@ struct acpi_interface_info {
942 942
943#define ACPI_OSI_INVALID 0x01 943#define ACPI_OSI_INVALID 0x01
944#define ACPI_OSI_DYNAMIC 0x02 944#define ACPI_OSI_DYNAMIC 0x02
945#define ACPI_OSI_FEATURE 0x04
946#define ACPI_OSI_DEFAULT_INVALID 0x08
947#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
945 948
946struct acpi_port_info { 949struct acpi_port_info {
947 char *name; 950 char *name;
@@ -1030,6 +1033,7 @@ struct acpi_external_list {
1030 u8 type; 1033 u8 type;
1031 u8 flags; 1034 u8 flags;
1032 u8 resolved; 1035 u8 resolved;
1036 u8 emitted;
1033}; 1037};
1034 1038
1035/* Values for Flags field above */ 1039/* Values for Flags field above */
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index b83dc32a5ae0..40b04bd5579e 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -104,8 +104,8 @@ acpi_ns_walk_namespace(acpi_object_type type,
104 acpi_handle start_object, 104 acpi_handle start_object,
105 u32 max_depth, 105 u32 max_depth,
106 u32 flags, 106 u32 flags,
107 acpi_walk_callback pre_order_visit, 107 acpi_walk_callback descending_callback,
108 acpi_walk_callback post_order_visit, 108 acpi_walk_callback ascending_callback,
109 void *context, void **return_value); 109 void *context, void **return_value);
110 110
111struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node 111struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 7755e915a007..c54f42c64fe2 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -47,6 +47,13 @@
47acpi_status acpi_allocate_root_table(u32 initial_table_count); 47acpi_status acpi_allocate_root_table(u32 initial_table_count);
48 48
49/* 49/*
50 * tbxfroot - Root pointer utilities
51 */
52acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
53
54u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
55
56/*
50 * tbfadt - FADT parse/convert/validate 57 * tbfadt - FADT parse/convert/validate
51 */ 58 */
52void acpi_tb_parse_fadt(u32 table_index); 59void acpi_tb_parse_fadt(u32 table_index);
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 3c76edea6803..d5a62a6182bb 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -470,6 +470,8 @@ acpi_status acpi_ut_install_interface(acpi_string interface_name);
470 470
471acpi_status acpi_ut_remove_interface(acpi_string interface_name); 471acpi_status acpi_ut_remove_interface(acpi_string interface_name);
472 472
473acpi_status acpi_ut_update_interfaces(u8 action);
474
473struct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name); 475struct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name);
474 476
475acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state); 477acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state);
@@ -616,7 +618,7 @@ int acpi_ut_stricmp(char *string1, char *string2);
616 618
617acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer); 619acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer);
618 620
619void acpi_ut_print_string(char *string, u8 max_length); 621void acpi_ut_print_string(char *string, u16 max_length);
620 622
621void ut_convert_backslashes(char *pathname); 623void ut_convert_backslashes(char *pathname);
622 624
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 9037f17c9608..7842700346a4 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -125,7 +125,6 @@ acpi_status acpi_ev_gpe_initialize(void)
125 /* GPE block 0 exists (has both length and address > 0) */ 125 /* GPE block 0 exists (has both length and address > 0) */
126 126
127 register_count0 = (u16)(acpi_gbl_FADT.gpe0_block_length / 2); 127 register_count0 = (u16)(acpi_gbl_FADT.gpe0_block_length / 2);
128
129 gpe_number_max = 128 gpe_number_max =
130 (register_count0 * ACPI_GPE_REGISTER_WIDTH) - 1; 129 (register_count0 * ACPI_GPE_REGISTER_WIDTH) - 1;
131 130
@@ -204,16 +203,6 @@ acpi_status acpi_ev_gpe_initialize(void)
204 goto cleanup; 203 goto cleanup;
205 } 204 }
206 205
207 /* Check for Max GPE number out-of-range */
208
209 if (gpe_number_max > ACPI_GPE_MAX) {
210 ACPI_ERROR((AE_INFO,
211 "Maximum GPE number from FADT is too large: 0x%X",
212 gpe_number_max));
213 status = AE_BAD_VALUE;
214 goto cleanup;
215 }
216
217 cleanup: 206 cleanup:
218 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 207 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
219 return_ACPI_STATUS(AE_OK); 208 return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index c740f24e3101..4d046faac48c 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -338,6 +338,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
338{ 338{
339 u8 *target; 339 u8 *target;
340 char *name; 340 char *name;
341 const char *reference_name;
341 u8 count; 342 u8 count;
342 343
343 if (!info) { 344 if (!info) {
@@ -426,10 +427,9 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
426 427
427 case ACPI_EXD_REFERENCE: 428 case ACPI_EXD_REFERENCE:
428 429
430 reference_name = acpi_ut_get_reference_name(obj_desc);
429 acpi_ex_out_string("Class Name", 431 acpi_ex_out_string("Class Name",
430 ACPI_CAST_PTR(char, 432 ACPI_CAST_PTR(char, reference_name));
431 acpi_ut_get_reference_name
432 (obj_desc)));
433 acpi_ex_dump_reference_obj(obj_desc); 433 acpi_ex_dump_reference_obj(obj_desc);
434 break; 434 break;
435 435
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 814b4a3d656a..2cdd41d8ade6 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -962,10 +962,17 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
962 */ 962 */
963 return_desc = 963 return_desc =
964 *(operand[0]->reference.where); 964 *(operand[0]->reference.where);
965 if (return_desc) { 965 if (!return_desc) {
966 acpi_ut_add_reference 966 /*
967 (return_desc); 967 * Element is NULL, do not allow the dereference.
968 * This provides compatibility with other ACPI
969 * implementations.
970 */
971 return_ACPI_STATUS
972 (AE_AML_UNINITIALIZED_ELEMENT);
968 } 973 }
974
975 acpi_ut_add_reference(return_desc);
969 break; 976 break;
970 977
971 default: 978 default:
@@ -990,11 +997,40 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
990 acpi_namespace_node 997 acpi_namespace_node
991 *) 998 *)
992 return_desc); 999 return_desc);
993 } 1000 if (!return_desc) {
1001 break;
1002 }
994 1003
995 /* Add another reference to the object! */ 1004 /*
1005 * June 2013:
1006 * buffer_fields/field_units require additional resolution
1007 */
1008 switch (return_desc->common.type) {
1009 case ACPI_TYPE_BUFFER_FIELD:
1010 case ACPI_TYPE_LOCAL_REGION_FIELD:
1011 case ACPI_TYPE_LOCAL_BANK_FIELD:
1012 case ACPI_TYPE_LOCAL_INDEX_FIELD:
996 1013
997 acpi_ut_add_reference(return_desc); 1014 status =
1015 acpi_ex_read_data_from_field
1016 (walk_state, return_desc,
1017 &temp_desc);
1018 if (ACPI_FAILURE(status)) {
1019 goto cleanup;
1020 }
1021
1022 return_desc = temp_desc;
1023 break;
1024
1025 default:
1026
1027 /* Add another reference to the object */
1028
1029 acpi_ut_add_reference
1030 (return_desc);
1031 break;
1032 }
1033 }
998 break; 1034 break;
999 1035
1000 default: 1036 default:
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index 0c1a8bbd05d6..2d7d22ebc782 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -100,8 +100,13 @@ acpi_status acpi_get_timer(u32 * ticks)
100 return_ACPI_STATUS(AE_BAD_PARAMETER); 100 return_ACPI_STATUS(AE_BAD_PARAMETER);
101 } 101 }
102 102
103 status = acpi_hw_read(ticks, &acpi_gbl_FADT.xpm_timer_block); 103 /* ACPI 5.0A: PM Timer is optional */
104
105 if (!acpi_gbl_FADT.xpm_timer_block.address) {
106 return_ACPI_STATUS(AE_SUPPORT);
107 }
104 108
109 status = acpi_hw_read(ticks, &acpi_gbl_FADT.xpm_timer_block);
105 return_ACPI_STATUS(status); 110 return_ACPI_STATUS(status);
106} 111}
107 112
@@ -148,6 +153,12 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
148 return_ACPI_STATUS(AE_BAD_PARAMETER); 153 return_ACPI_STATUS(AE_BAD_PARAMETER);
149 } 154 }
150 155
156 /* ACPI 5.0A: PM Timer is optional */
157
158 if (!acpi_gbl_FADT.xpm_timer_block.address) {
159 return_ACPI_STATUS(AE_SUPPORT);
160 }
161
151 /* 162 /*
152 * Compute Tick Delta: 163 * Compute Tick Delta:
153 * Handle (max one) timer rollovers on 24-bit versus 32-bit timers. 164 * Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 24b71a01bf93..098e7666cbc9 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -151,6 +151,15 @@ acpi_ns_check_return_value(struct acpi_namespace_node *node,
151 } 151 }
152 152
153 /* 153 /*
154 *
155 * 4) If there is no return value and it is optional, just return
156 * AE_OK (_WAK).
157 */
158 if (!(*return_object_ptr)) {
159 goto exit;
160 }
161
162 /*
154 * For returned Package objects, check the type of all sub-objects. 163 * For returned Package objects, check the type of all sub-objects.
155 * Note: Package may have been newly created by call above. 164 * Note: Package may have been newly created by call above.
156 */ 165 */
@@ -268,7 +277,12 @@ acpi_ns_check_object_type(struct acpi_evaluate_info *info,
268 277
269 acpi_ut_get_expected_return_types(type_buffer, expected_btypes); 278 acpi_ut_get_expected_return_types(type_buffer, expected_btypes);
270 279
271 if (package_index == ACPI_NOT_PACKAGE_ELEMENT) { 280 if (!return_object) {
281 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
282 info->node_flags,
283 "Expected return object of type %s",
284 type_buffer));
285 } else if (package_index == ACPI_NOT_PACKAGE_ELEMENT) {
272 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 286 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
273 info->node_flags, 287 info->node_flags,
274 "Return type mismatch - found %s, expected %s", 288 "Return type mismatch - found %s, expected %s",
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index e70911a9e441..e81f15ef659a 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -156,9 +156,9 @@ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type,
156 * max_depth - Depth to which search is to reach 156 * max_depth - Depth to which search is to reach
157 * flags - Whether to unlock the NS before invoking 157 * flags - Whether to unlock the NS before invoking
158 * the callback routine 158 * the callback routine
159 * pre_order_visit - Called during tree pre-order visit 159 * descending_callback - Called during tree descent
160 * when an object of "Type" is found 160 * when an object of "Type" is found
161 * post_order_visit - Called during tree post-order visit 161 * ascending_callback - Called during tree ascent
162 * when an object of "Type" is found 162 * when an object of "Type" is found
163 * context - Passed to user function(s) above 163 * context - Passed to user function(s) above
164 * return_value - from the user_function if terminated 164 * return_value - from the user_function if terminated
@@ -185,8 +185,8 @@ acpi_ns_walk_namespace(acpi_object_type type,
185 acpi_handle start_node, 185 acpi_handle start_node,
186 u32 max_depth, 186 u32 max_depth,
187 u32 flags, 187 u32 flags,
188 acpi_walk_callback pre_order_visit, 188 acpi_walk_callback descending_callback,
189 acpi_walk_callback post_order_visit, 189 acpi_walk_callback ascending_callback,
190 void *context, void **return_value) 190 void *context, void **return_value)
191{ 191{
192 acpi_status status; 192 acpi_status status;
@@ -255,22 +255,22 @@ acpi_ns_walk_namespace(acpi_object_type type,
255 } 255 }
256 256
257 /* 257 /*
258 * Invoke the user function, either pre-order or post-order 258 * Invoke the user function, either descending, ascending,
259 * or both. 259 * or both.
260 */ 260 */
261 if (!node_previously_visited) { 261 if (!node_previously_visited) {
262 if (pre_order_visit) { 262 if (descending_callback) {
263 status = 263 status =
264 pre_order_visit(child_node, level, 264 descending_callback(child_node,
265 context, 265 level, context,
266 return_value); 266 return_value);
267 } 267 }
268 } else { 268 } else {
269 if (post_order_visit) { 269 if (ascending_callback) {
270 status = 270 status =
271 post_order_visit(child_node, level, 271 ascending_callback(child_node,
272 context, 272 level, context,
273 return_value); 273 return_value);
274 } 274 }
275 } 275 }
276 276
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index f553cfdb71dd..b38b4b07f86e 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -533,9 +533,9 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
533 * PARAMETERS: type - acpi_object_type to search for 533 * PARAMETERS: type - acpi_object_type to search for
534 * start_object - Handle in namespace where search begins 534 * start_object - Handle in namespace where search begins
535 * max_depth - Depth to which search is to reach 535 * max_depth - Depth to which search is to reach
536 * pre_order_visit - Called during tree pre-order visit 536 * descending_callback - Called during tree descent
537 * when an object of "Type" is found 537 * when an object of "Type" is found
538 * post_order_visit - Called during tree post-order visit 538 * ascending_callback - Called during tree ascent
539 * when an object of "Type" is found 539 * when an object of "Type" is found
540 * context - Passed to user function(s) above 540 * context - Passed to user function(s) above
541 * return_value - Location where return value of 541 * return_value - Location where return value of
@@ -563,8 +563,8 @@ acpi_status
563acpi_walk_namespace(acpi_object_type type, 563acpi_walk_namespace(acpi_object_type type,
564 acpi_handle start_object, 564 acpi_handle start_object,
565 u32 max_depth, 565 u32 max_depth,
566 acpi_walk_callback pre_order_visit, 566 acpi_walk_callback descending_callback,
567 acpi_walk_callback post_order_visit, 567 acpi_walk_callback ascending_callback,
568 void *context, void **return_value) 568 void *context, void **return_value)
569{ 569{
570 acpi_status status; 570 acpi_status status;
@@ -574,7 +574,7 @@ acpi_walk_namespace(acpi_object_type type,
574 /* Parameter validation */ 574 /* Parameter validation */
575 575
576 if ((type > ACPI_TYPE_LOCAL_MAX) || 576 if ((type > ACPI_TYPE_LOCAL_MAX) ||
577 (!max_depth) || (!pre_order_visit && !post_order_visit)) { 577 (!max_depth) || (!descending_callback && !ascending_callback)) {
578 return_ACPI_STATUS(AE_BAD_PARAMETER); 578 return_ACPI_STATUS(AE_BAD_PARAMETER);
579 } 579 }
580 580
@@ -606,9 +606,9 @@ acpi_walk_namespace(acpi_object_type type,
606 } 606 }
607 607
608 status = acpi_ns_walk_namespace(type, start_object, max_depth, 608 status = acpi_ns_walk_namespace(type, start_object, max_depth,
609 ACPI_NS_WALK_UNLOCK, pre_order_visit, 609 ACPI_NS_WALK_UNLOCK,
610 post_order_visit, context, 610 descending_callback, ascending_callback,
611 return_value); 611 context, return_value);
612 612
613 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 613 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
614 614
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index f3a4d95899f7..83c164434580 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -158,6 +158,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
158{ 158{
159 acpi_status status; 159 acpi_status status;
160 struct acpi_namespace_node *node; 160 struct acpi_namespace_node *node;
161 char *node_name;
161 162
162 /* Parameter validation */ 163 /* Parameter validation */
163 164
@@ -202,7 +203,8 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
202 203
203 /* Just copy the ACPI name from the Node and zero terminate it */ 204 /* Just copy the ACPI name from the Node and zero terminate it */
204 205
205 ACPI_MOVE_NAME(buffer->pointer, acpi_ut_get_node_name(node)); 206 node_name = acpi_ut_get_node_name(node);
207 ACPI_MOVE_NAME(buffer->pointer, node_name);
206 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0; 208 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0;
207 status = AE_OK; 209 status = AE_OK;
208 210
@@ -379,9 +381,14 @@ acpi_get_object_info(acpi_handle handle,
379 * Get extra info for ACPI Device/Processor objects only: 381 * Get extra info for ACPI Device/Processor objects only:
380 * Run the _STA, _ADR and, sx_w, and _sx_d methods. 382 * Run the _STA, _ADR and, sx_w, and _sx_d methods.
381 * 383 *
382 * Note: none of these methods are required, so they may or may 384 * Notes: none of these methods are required, so they may or may
383 * not be present for this device. The Info->Valid bitfield is used 385 * not be present for this device. The Info->Valid bitfield is used
384 * to indicate which methods were found and run successfully. 386 * to indicate which methods were found and run successfully.
387 *
388 * For _STA, if the method does not exist, then (as per the ACPI
389 * specification), the returned current_status flags will indicate
390 * that the device is present/functional/enabled. Otherwise, the
391 * current_status flags reflect the value returned from _STA.
385 */ 392 */
386 393
387 /* Execute the Device._STA method */ 394 /* Execute the Device._STA method */
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 33b00d22300a..9d99f2189693 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -117,7 +117,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
117 ACPI_FADT_OFFSET(pm_timer_block), 117 ACPI_FADT_OFFSET(pm_timer_block),
118 ACPI_FADT_OFFSET(pm_timer_length), 118 ACPI_FADT_OFFSET(pm_timer_length),
119 ACPI_PM_TIMER_WIDTH, 119 ACPI_PM_TIMER_WIDTH,
120 ACPI_FADT_REQUIRED}, 120 ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */
121 121
122 {"Gpe0Block", 122 {"Gpe0Block",
123 ACPI_FADT_OFFSET(xgpe0_block), 123 ACPI_FADT_OFFSET(xgpe0_block),
@@ -574,7 +574,7 @@ static void acpi_tb_validate_fadt(void)
574 574
575 if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { 575 if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
576 /* 576 /*
577 * Field is required (Pm1a_event, Pm1a_control, pm_timer). 577 * Field is required (Pm1a_event, Pm1a_control).
578 * Both the address and length must be non-zero. 578 * Both the address and length must be non-zero.
579 */ 579 */
580 if (!address64->address || !length) { 580 if (!address64->address || !length) {
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 7c2ecfb7c2c3..948c95e80d44 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -48,11 +48,6 @@
48#define _COMPONENT ACPI_TABLES 48#define _COMPONENT ACPI_TABLES
49ACPI_MODULE_NAME("tbxfroot") 49ACPI_MODULE_NAME("tbxfroot")
50 50
51/* Local prototypes */
52static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length);
53
54static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
55
56/******************************************************************************* 51/*******************************************************************************
57 * 52 *
58 * FUNCTION: acpi_tb_validate_rsdp 53 * FUNCTION: acpi_tb_validate_rsdp
@@ -64,8 +59,7 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
64 * DESCRIPTION: Validate the RSDP (ptr) 59 * DESCRIPTION: Validate the RSDP (ptr)
65 * 60 *
66 ******************************************************************************/ 61 ******************************************************************************/
67 62acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
68static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
69{ 63{
70 64
71 /* 65 /*
@@ -74,7 +68,7 @@ static acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
74 * Note: Sometimes there exists more than one RSDP in memory; the valid 68 * Note: Sometimes there exists more than one RSDP in memory; the valid
75 * RSDP has a valid checksum, all others have an invalid checksum. 69 * RSDP has a valid checksum, all others have an invalid checksum.
76 */ 70 */
77 if (ACPI_STRNCMP((char *)rsdp, ACPI_SIG_RSDP, 71 if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP,
78 sizeof(ACPI_SIG_RSDP) - 1) != 0) { 72 sizeof(ACPI_SIG_RSDP) - 1) != 0) {
79 73
80 /* Nope, BAD Signature */ 74 /* Nope, BAD Signature */
@@ -231,7 +225,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address)
231 * DESCRIPTION: Search a block of memory for the RSDP signature 225 * DESCRIPTION: Search a block of memory for the RSDP signature
232 * 226 *
233 ******************************************************************************/ 227 ******************************************************************************/
234static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length) 228u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length)
235{ 229{
236 acpi_status status; 230 acpi_status status;
237 u8 *mem_rover; 231 u8 *mem_rover;
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index ee83adb97b1e..4fd68971019b 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -239,7 +239,8 @@ acpi_ut_evaluate_numeric_object(char *object_name,
239 * RETURN: Status 239 * RETURN: Status
240 * 240 *
241 * DESCRIPTION: Executes _STA for selected device and stores results in 241 * DESCRIPTION: Executes _STA for selected device and stores results in
242 * *Flags. 242 * *Flags. If _STA does not exist, then the device is assumed
243 * to be present/functional/enabled (as per the ACPI spec).
243 * 244 *
244 * NOTE: Internal function, no parameter validation 245 * NOTE: Internal function, no parameter validation
245 * 246 *
@@ -257,6 +258,11 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, u32 * flags)
257 ACPI_BTYPE_INTEGER, &obj_desc); 258 ACPI_BTYPE_INTEGER, &obj_desc);
258 if (ACPI_FAILURE(status)) { 259 if (ACPI_FAILURE(status)) {
259 if (AE_NOT_FOUND == status) { 260 if (AE_NOT_FOUND == status) {
261 /*
262 * if _STA does not exist, then (as per the ACPI specification),
263 * the returned flags will indicate that the device is present,
264 * functional, and enabled.
265 */
260 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 266 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
261 "_STA on %4.4s was not found, assuming device is present\n", 267 "_STA on %4.4s was not found, assuming device is present\n",
262 acpi_ut_get_node_name(device_node))); 268 acpi_ut_get_node_name(device_node)));
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index f736448a8606..d6f26bf8a062 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -336,7 +336,6 @@ acpi_status acpi_ut_init_globals(void)
336 acpi_gbl_trace_dbg_layer = 0; 336 acpi_gbl_trace_dbg_layer = 0;
337 acpi_gbl_debugger_configuration = DEBUGGER_THREADING; 337 acpi_gbl_debugger_configuration = DEBUGGER_THREADING;
338 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; 338 acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
339 acpi_gbl_osi_data = 0;
340 acpi_gbl_osi_mutex = NULL; 339 acpi_gbl_osi_mutex = NULL;
341 acpi_gbl_reg_methods_executed = FALSE; 340 acpi_gbl_reg_methods_executed = FALSE;
342 341
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 7e807725c636..8856bd37bc76 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -77,21 +77,20 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
77 77
78 /* Feature Group Strings */ 78 /* Feature Group Strings */
79 79
80 {"Extended Address Space Descriptor", NULL, 0, 0} 80 {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0},
81 81
82 /* 82 /*
83 * All "optional" feature group strings (features that are implemented 83 * All "optional" feature group strings (features that are implemented
84 * by the host) should be dynamically added by the host via 84 * by the host) should be dynamically modified to VALID by the host via
85 * acpi_install_interface and should not be manually added here. 85 * acpi_install_interface or acpi_update_interfaces. Such optional feature
86 * 86 * group strings are set as INVALID by default here.
87 * Examples of optional feature group strings:
88 *
89 * "Module Device"
90 * "Processor Device"
91 * "3.0 Thermal Model"
92 * "3.0 _SCP Extensions"
93 * "Processor Aggregator Device"
94 */ 87 */
88
89 {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
90 {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
91 {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
92 {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
93 {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}
95}; 94};
96 95
97/******************************************************************************* 96/*******************************************************************************
@@ -158,11 +157,20 @@ acpi_status acpi_ut_interface_terminate(void)
158 while (next_interface) { 157 while (next_interface) {
159 acpi_gbl_supported_interfaces = next_interface->next; 158 acpi_gbl_supported_interfaces = next_interface->next;
160 159
161 /* Only interfaces added at runtime can be freed */
162
163 if (next_interface->flags & ACPI_OSI_DYNAMIC) { 160 if (next_interface->flags & ACPI_OSI_DYNAMIC) {
161
162 /* Only interfaces added at runtime can be freed */
163
164 ACPI_FREE(next_interface->name); 164 ACPI_FREE(next_interface->name);
165 ACPI_FREE(next_interface); 165 ACPI_FREE(next_interface);
166 } else {
167 /* Interface is in static list. Reset it to invalid or valid. */
168
169 if (next_interface->flags & ACPI_OSI_DEFAULT_INVALID) {
170 next_interface->flags |= ACPI_OSI_INVALID;
171 } else {
172 next_interface->flags &= ~ACPI_OSI_INVALID;
173 }
166 } 174 }
167 175
168 next_interface = acpi_gbl_supported_interfaces; 176 next_interface = acpi_gbl_supported_interfaces;
@@ -278,6 +286,49 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
278 286
279/******************************************************************************* 287/*******************************************************************************
280 * 288 *
289 * FUNCTION: acpi_ut_update_interfaces
290 *
291 * PARAMETERS: action - Actions to be performed during the
292 * update
293 *
294 * RETURN: Status
295 *
296 * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
297 * strings or/and feature group strings.
298 * Caller MUST hold acpi_gbl_osi_mutex
299 *
300 ******************************************************************************/
301
302acpi_status acpi_ut_update_interfaces(u8 action)
303{
304 struct acpi_interface_info *next_interface;
305
306 next_interface = acpi_gbl_supported_interfaces;
307 while (next_interface) {
308 if (((next_interface->flags & ACPI_OSI_FEATURE) &&
309 (action & ACPI_FEATURE_STRINGS)) ||
310 (!(next_interface->flags & ACPI_OSI_FEATURE) &&
311 (action & ACPI_VENDOR_STRINGS))) {
312 if (action & ACPI_DISABLE_INTERFACES) {
313
314 /* Mark the interfaces as invalid */
315
316 next_interface->flags |= ACPI_OSI_INVALID;
317 } else {
318 /* Mark the interfaces as valid */
319
320 next_interface->flags &= ~ACPI_OSI_INVALID;
321 }
322 }
323
324 next_interface = next_interface->next;
325 }
326
327 return (AE_OK);
328}
329
330/*******************************************************************************
331 *
281 * FUNCTION: acpi_ut_get_interface 332 * FUNCTION: acpi_ut_get_interface
282 * 333 *
283 * PARAMETERS: interface_name - The interface to find 334 * PARAMETERS: interface_name - The interface to find
diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c
index c53759b76a3f..cb1e9cc32d5f 100644
--- a/drivers/acpi/acpica/utstring.c
+++ b/drivers/acpi/acpica/utstring.c
@@ -333,7 +333,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
333 * FUNCTION: acpi_ut_print_string 333 * FUNCTION: acpi_ut_print_string
334 * 334 *
335 * PARAMETERS: string - Null terminated ASCII string 335 * PARAMETERS: string - Null terminated ASCII string
336 * max_length - Maximum output length 336 * max_length - Maximum output length. Used to constrain the
337 * length of strings during debug output only.
337 * 338 *
338 * RETURN: None 339 * RETURN: None
339 * 340 *
@@ -342,7 +343,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
342 * 343 *
343 ******************************************************************************/ 344 ******************************************************************************/
344 345
345void acpi_ut_print_string(char *string, u8 max_length) 346void acpi_ut_print_string(char *string, u16 max_length)
346{ 347{
347 u32 i; 348 u32 i;
348 349
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 6505774f223e..03a211e6e26a 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -389,6 +389,34 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler)
389 389
390/***************************************************************************** 390/*****************************************************************************
391 * 391 *
392 * FUNCTION: acpi_update_interfaces
393 *
394 * PARAMETERS: action - Actions to be performed during the
395 * update
396 *
397 * RETURN: Status
398 *
399 * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
400 * string or/and feature group strings.
401 *
402 ****************************************************************************/
403acpi_status acpi_update_interfaces(u8 action)
404{
405 acpi_status status;
406
407 status = acpi_os_acquire_mutex(acpi_gbl_osi_mutex, ACPI_WAIT_FOREVER);
408 if (ACPI_FAILURE(status)) {
409 return (status);
410 }
411
412 status = acpi_ut_update_interfaces(action);
413
414 acpi_os_release_mutex(acpi_gbl_osi_mutex);
415 return (status);
416}
417
418/*****************************************************************************
419 *
392 * FUNCTION: acpi_check_address_range 420 * FUNCTION: acpi_check_address_range
393 * 421 *
394 * PARAMETERS: space_id - Address space ID 422 * PARAMETERS: space_id - Address space ID
@@ -402,6 +430,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_interface_handler)
402 * ASL operation region address ranges. 430 * ASL operation region address ranges.
403 * 431 *
404 ****************************************************************************/ 432 ****************************************************************************/
433
405u32 434u32
406acpi_check_address_range(acpi_adr_space_type space_id, 435acpi_check_address_range(acpi_adr_space_type space_id,
407 acpi_physical_address address, 436 acpi_physical_address address,