diff options
author | Bob Moore <robert.moore@intel.com> | 2014-04-04 00:39:26 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-20 16:59:39 -0400 |
commit | ed6f1d44dae8a4eec42a74acae95cc177ee2e1ad (patch) | |
tree | 03f219cabf69c5b92cab0f9f7e3c0dd495c951e2 /drivers/acpi | |
parent | caf4a15c5f930aae41951b4916289e3e59dda8eb (diff) |
ACPICA: Table Manager: Misc cleanup and renames, no functional change.
Some various cleanups and renames.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/actables.h | 18 | ||||
-rw-r--r-- | drivers/acpi/acpica/exconfig.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 179 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbutils.c | 20 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxface.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxfload.c | 16 |
6 files changed, 130 insertions, 113 deletions
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index 3d20a96f6f09..ade430c6004f 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h | |||
@@ -91,9 +91,9 @@ acpi_tb_release_table(struct acpi_table_header *table, | |||
91 | u32 table_length, u8 table_flags); | 91 | u32 table_length, u8 table_flags); |
92 | 92 | ||
93 | acpi_status | 93 | acpi_status |
94 | acpi_tb_install_non_fixed_table(acpi_physical_address address, | 94 | acpi_tb_install_standard_table(acpi_physical_address address, |
95 | u8 flags, | 95 | u8 flags, |
96 | u8 reload, u8 override, u32 *table_index); | 96 | u8 reload, u8 override, u32 *table_index); |
97 | 97 | ||
98 | acpi_status | 98 | acpi_status |
99 | acpi_tb_store_table(acpi_physical_address address, | 99 | acpi_tb_store_table(acpi_physical_address address, |
@@ -137,14 +137,14 @@ void acpi_tb_check_dsdt_header(void); | |||
137 | struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index); | 137 | struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index); |
138 | 138 | ||
139 | void | 139 | void |
140 | acpi_tb_install_table(struct acpi_table_desc *table_desc, | 140 | acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, |
141 | acpi_physical_address address, | 141 | acpi_physical_address address, |
142 | u8 flags, struct acpi_table_header *table); | 142 | u8 flags, struct acpi_table_header *table); |
143 | 143 | ||
144 | void | 144 | void |
145 | acpi_tb_install_and_override_table(u32 table_index, | 145 | acpi_tb_install_table_with_override(u32 table_index, |
146 | struct acpi_table_desc *new_table_desc, | 146 | struct acpi_table_desc *new_table_desc, |
147 | u8 override); | 147 | u8 override); |
148 | 148 | ||
149 | acpi_status | 149 | acpi_status |
150 | acpi_tb_install_fixed_table(acpi_physical_address address, | 150 | acpi_tb_install_fixed_table(acpi_physical_address address, |
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index 815003d81b5c..7d2949420db7 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -482,9 +482,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
482 | 482 | ||
483 | ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:")); | 483 | ACPI_INFO((AE_INFO, "Dynamic OEM Table Load:")); |
484 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 484 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
485 | status = acpi_tb_install_non_fixed_table(ACPI_PTR_TO_PHYSADDR(table), | 485 | |
486 | ACPI_TABLE_ORIGIN_INTERN_VIRTUAL, | 486 | status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table), |
487 | TRUE, TRUE, &table_index); | 487 | ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, |
488 | TRUE, TRUE, &table_index); | ||
489 | |||
488 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 490 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
489 | if (ACPI_FAILURE(status)) { | 491 | if (ACPI_FAILURE(status)) { |
490 | 492 | ||
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 9835213269e6..50a6f229633c 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -51,12 +51,12 @@ ACPI_MODULE_NAME("tbinstal") | |||
51 | 51 | ||
52 | /* Local prototypes */ | 52 | /* Local prototypes */ |
53 | static acpi_status | 53 | static acpi_status |
54 | acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc, | 54 | acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc, |
55 | acpi_physical_address address, u8 flags); | 55 | acpi_physical_address address, u8 flags); |
56 | 56 | ||
57 | static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc); | 57 | static void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc); |
58 | 58 | ||
59 | static acpi_status acpi_tb_acquire_root_table_entry(u32 *table_index); | 59 | static acpi_status acpi_tb_get_root_table_entry(u32 *table_index); |
60 | 60 | ||
61 | static u8 | 61 | static u8 |
62 | acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, | 62 | acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, |
@@ -73,8 +73,8 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, | |||
73 | * | 73 | * |
74 | * RETURN: Status | 74 | * RETURN: Status |
75 | * | 75 | * |
76 | * DESCRIPTION: Acquire a table. It can be used for tables not maintained in | 76 | * DESCRIPTION: Acquire an ACPI table. It can be used for tables not |
77 | * acpi_gbl_root_table_list. | 77 | * maintained in the acpi_gbl_root_table_list. |
78 | * | 78 | * |
79 | ******************************************************************************/ | 79 | ******************************************************************************/ |
80 | 80 | ||
@@ -86,14 +86,14 @@ acpi_tb_acquire_table(struct acpi_table_desc *table_desc, | |||
86 | struct acpi_table_header *table = NULL; | 86 | struct acpi_table_header *table = NULL; |
87 | 87 | ||
88 | switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) { | 88 | switch (table_desc->flags & ACPI_TABLE_ORIGIN_MASK) { |
89 | case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL: | 89 | case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: |
90 | 90 | ||
91 | table = | 91 | table = |
92 | acpi_os_map_memory(table_desc->address, table_desc->length); | 92 | acpi_os_map_memory(table_desc->address, table_desc->length); |
93 | break; | 93 | break; |
94 | 94 | ||
95 | case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL: | 95 | case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: |
96 | case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL: | 96 | case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: |
97 | 97 | ||
98 | table = | 98 | table = |
99 | ACPI_CAST_PTR(struct acpi_table_header, | 99 | ACPI_CAST_PTR(struct acpi_table_header, |
@@ -116,7 +116,6 @@ acpi_tb_acquire_table(struct acpi_table_desc *table_desc, | |||
116 | *table_ptr = table; | 116 | *table_ptr = table; |
117 | *table_length = table_desc->length; | 117 | *table_length = table_desc->length; |
118 | *table_flags = table_desc->flags; | 118 | *table_flags = table_desc->flags; |
119 | |||
120 | return (AE_OK); | 119 | return (AE_OK); |
121 | } | 120 | } |
122 | 121 | ||
@@ -130,7 +129,7 @@ acpi_tb_acquire_table(struct acpi_table_desc *table_desc, | |||
130 | * | 129 | * |
131 | * RETURN: None | 130 | * RETURN: None |
132 | * | 131 | * |
133 | * DESCRIPTION: Release a table. The reversal of acpi_tb_acquire_table(). | 132 | * DESCRIPTION: Release a table. The inverse of acpi_tb_acquire_table(). |
134 | * | 133 | * |
135 | ******************************************************************************/ | 134 | ******************************************************************************/ |
136 | 135 | ||
@@ -138,14 +137,15 @@ void | |||
138 | acpi_tb_release_table(struct acpi_table_header *table, | 137 | acpi_tb_release_table(struct acpi_table_header *table, |
139 | u32 table_length, u8 table_flags) | 138 | u32 table_length, u8 table_flags) |
140 | { | 139 | { |
140 | |||
141 | switch (table_flags & ACPI_TABLE_ORIGIN_MASK) { | 141 | switch (table_flags & ACPI_TABLE_ORIGIN_MASK) { |
142 | case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL: | 142 | case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: |
143 | 143 | ||
144 | acpi_os_unmap_memory(table, table_length); | 144 | acpi_os_unmap_memory(table, table_length); |
145 | break; | 145 | break; |
146 | 146 | ||
147 | case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL: | 147 | case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: |
148 | case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL: | 148 | case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: |
149 | default: | 149 | default: |
150 | 150 | ||
151 | break; | 151 | break; |
@@ -193,7 +193,7 @@ acpi_status acpi_tb_validate_table(struct acpi_table_desc *table_desc) | |||
193 | * | 193 | * |
194 | * RETURN: None | 194 | * RETURN: None |
195 | * | 195 | * |
196 | * DESCRIPTION: Invalidate one internal ACPI table, this is reversal of | 196 | * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of |
197 | * acpi_tb_validate_table(). | 197 | * acpi_tb_validate_table(). |
198 | * | 198 | * |
199 | ******************************************************************************/ | 199 | ******************************************************************************/ |
@@ -278,7 +278,7 @@ invalidate_and_exit: | |||
278 | 278 | ||
279 | /******************************************************************************* | 279 | /******************************************************************************* |
280 | * | 280 | * |
281 | * FUNCTION: acpi_tb_install_table | 281 | * FUNCTION: acpi_tb_init_table_descriptor |
282 | * | 282 | * |
283 | * PARAMETERS: table_desc - Table descriptor | 283 | * PARAMETERS: table_desc - Table descriptor |
284 | * address - Physical address of the table | 284 | * address - Physical address of the table |
@@ -287,17 +287,18 @@ invalidate_and_exit: | |||
287 | * | 287 | * |
288 | * RETURN: None | 288 | * RETURN: None |
289 | * | 289 | * |
290 | * DESCRIPTION: Install an ACPI table into the global data structure. | 290 | * DESCRIPTION: Initialize a new table descriptor |
291 | * | 291 | * |
292 | ******************************************************************************/ | 292 | ******************************************************************************/ |
293 | 293 | ||
294 | void | 294 | void |
295 | acpi_tb_install_table(struct acpi_table_desc *table_desc, | 295 | acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc, |
296 | acpi_physical_address address, | 296 | acpi_physical_address address, |
297 | u8 flags, struct acpi_table_header *table) | 297 | u8 flags, struct acpi_table_header *table) |
298 | { | 298 | { |
299 | |||
299 | /* | 300 | /* |
300 | * Initialize the table entry. Set the pointer to NULL, since the | 301 | * Initialize the table descriptor. Set the pointer to NULL, since the |
301 | * table is not fully mapped at this time. | 302 | * table is not fully mapped at this time. |
302 | */ | 303 | */ |
303 | ACPI_MEMSET(table_desc, 0, sizeof(struct acpi_table_desc)); | 304 | ACPI_MEMSET(table_desc, 0, sizeof(struct acpi_table_desc)); |
@@ -309,7 +310,7 @@ acpi_tb_install_table(struct acpi_table_desc *table_desc, | |||
309 | 310 | ||
310 | /******************************************************************************* | 311 | /******************************************************************************* |
311 | * | 312 | * |
312 | * FUNCTION: acpi_tb_acquire_temporal_table | 313 | * FUNCTION: acpi_tb_acquire_temp_table |
313 | * | 314 | * |
314 | * PARAMETERS: table_desc - Table descriptor to be acquired | 315 | * PARAMETERS: table_desc - Table descriptor to be acquired |
315 | * address - Address of the table | 316 | * address - Address of the table |
@@ -319,21 +320,21 @@ acpi_tb_install_table(struct acpi_table_desc *table_desc, | |||
319 | * | 320 | * |
320 | * DESCRIPTION: This function validates the table header to obtain the length | 321 | * DESCRIPTION: This function validates the table header to obtain the length |
321 | * of a table and fills the table descriptor to make its state as | 322 | * of a table and fills the table descriptor to make its state as |
322 | * "INSTALLED". Such table descriptor is only used for verified | 323 | * "INSTALLED". Such a table descriptor is only used for verified |
323 | * installation. | 324 | * installation. |
324 | * | 325 | * |
325 | ******************************************************************************/ | 326 | ******************************************************************************/ |
326 | 327 | ||
327 | static acpi_status | 328 | static acpi_status |
328 | acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc, | 329 | acpi_tb_acquire_temp_table(struct acpi_table_desc *table_desc, |
329 | acpi_physical_address address, u8 flags) | 330 | acpi_physical_address address, u8 flags) |
330 | { | 331 | { |
331 | struct acpi_table_header *table_header; | 332 | struct acpi_table_header *table_header; |
332 | 333 | ||
333 | switch (flags & ACPI_TABLE_ORIGIN_MASK) { | 334 | switch (flags & ACPI_TABLE_ORIGIN_MASK) { |
334 | case ACPI_TABLE_ORIGIN_INTERN_PHYSICAL: | 335 | case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: |
335 | 336 | ||
336 | /* Try to obtain the length of the table */ | 337 | /* Get the length of the full table from the header */ |
337 | 338 | ||
338 | table_header = | 339 | table_header = |
339 | acpi_os_map_memory(address, | 340 | acpi_os_map_memory(address, |
@@ -341,19 +342,23 @@ acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc, | |||
341 | if (!table_header) { | 342 | if (!table_header) { |
342 | return (AE_NO_MEMORY); | 343 | return (AE_NO_MEMORY); |
343 | } | 344 | } |
344 | acpi_tb_install_table(table_desc, address, flags, table_header); | 345 | |
346 | acpi_tb_init_table_descriptor(table_desc, address, flags, | ||
347 | table_header); | ||
345 | acpi_os_unmap_memory(table_header, | 348 | acpi_os_unmap_memory(table_header, |
346 | sizeof(struct acpi_table_header)); | 349 | sizeof(struct acpi_table_header)); |
347 | return (AE_OK); | 350 | return (AE_OK); |
348 | 351 | ||
349 | case ACPI_TABLE_ORIGIN_INTERN_VIRTUAL: | 352 | case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: |
350 | case ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL: | 353 | case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: |
351 | 354 | ||
352 | table_header = ACPI_CAST_PTR(struct acpi_table_header, address); | 355 | table_header = ACPI_CAST_PTR(struct acpi_table_header, address); |
353 | if (!table_header) { | 356 | if (!table_header) { |
354 | return (AE_NO_MEMORY); | 357 | return (AE_NO_MEMORY); |
355 | } | 358 | } |
356 | acpi_tb_install_table(table_desc, address, flags, table_header); | 359 | |
360 | acpi_tb_init_table_descriptor(table_desc, address, flags, | ||
361 | table_header); | ||
357 | return (AE_OK); | 362 | return (AE_OK); |
358 | 363 | ||
359 | default: | 364 | default: |
@@ -368,21 +373,22 @@ acpi_tb_acquire_temporal_table(struct acpi_table_desc *table_desc, | |||
368 | 373 | ||
369 | /******************************************************************************* | 374 | /******************************************************************************* |
370 | * | 375 | * |
371 | * FUNCTION: acpi_tb_release_temporal_table | 376 | * FUNCTION: acpi_tb_release_temp_table |
372 | * | 377 | * |
373 | * PARAMETERS: table_desc - Table descriptor to be released | 378 | * PARAMETERS: table_desc - Table descriptor to be released |
374 | * | 379 | * |
375 | * RETURN: Status | 380 | * RETURN: Status |
376 | * | 381 | * |
377 | * DESCRIPTION: The reversal of acpi_tb_acquire_temporal_table(). | 382 | * DESCRIPTION: The inverse of acpi_tb_acquire_temp_table(). |
378 | * | 383 | * |
379 | ******************************************************************************/ | 384 | ******************************************************************************/ |
380 | 385 | ||
381 | static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc) | 386 | static void acpi_tb_release_temp_table(struct acpi_table_desc *table_desc) |
382 | { | 387 | { |
388 | |||
383 | /* | 389 | /* |
384 | * Note that the .Address is maintained by the callers of | 390 | * Note that the .Address is maintained by the callers of |
385 | * acpi_tb_acquire_temporal_table(), thus do not invoke acpi_tb_uninstall_table() | 391 | * acpi_tb_acquire_temp_table(), thus do not invoke acpi_tb_uninstall_table() |
386 | * where .Address will be freed. | 392 | * where .Address will be freed. |
387 | */ | 393 | */ |
388 | acpi_tb_invalidate_table(table_desc); | 394 | acpi_tb_invalidate_table(table_desc); |
@@ -390,7 +396,7 @@ static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc) | |||
390 | 396 | ||
391 | /******************************************************************************* | 397 | /******************************************************************************* |
392 | * | 398 | * |
393 | * FUNCTION: acpi_tb_install_and_override_table | 399 | * FUNCTION: acpi_tb_install_table_with_override |
394 | * | 400 | * |
395 | * PARAMETERS: table_index - Index into root table array | 401 | * PARAMETERS: table_index - Index into root table array |
396 | * new_table_desc - New table descriptor to install | 402 | * new_table_desc - New table descriptor to install |
@@ -406,10 +412,11 @@ static void acpi_tb_release_temporal_table(struct acpi_table_desc *table_desc) | |||
406 | ******************************************************************************/ | 412 | ******************************************************************************/ |
407 | 413 | ||
408 | void | 414 | void |
409 | acpi_tb_install_and_override_table(u32 table_index, | 415 | acpi_tb_install_table_with_override(u32 table_index, |
410 | struct acpi_table_desc *new_table_desc, | 416 | struct acpi_table_desc *new_table_desc, |
411 | u8 override) | 417 | u8 override) |
412 | { | 418 | { |
419 | |||
413 | if (table_index >= acpi_gbl_root_table_list.current_table_count) { | 420 | if (table_index >= acpi_gbl_root_table_list.current_table_count) { |
414 | return; | 421 | return; |
415 | } | 422 | } |
@@ -425,9 +432,11 @@ acpi_tb_install_and_override_table(u32 table_index, | |||
425 | acpi_tb_override_table(new_table_desc); | 432 | acpi_tb_override_table(new_table_desc); |
426 | } | 433 | } |
427 | 434 | ||
428 | acpi_tb_install_table(&acpi_gbl_root_table_list.tables[table_index], | 435 | acpi_tb_init_table_descriptor(&acpi_gbl_root_table_list. |
429 | new_table_desc->address, new_table_desc->flags, | 436 | tables[table_index], |
430 | new_table_desc->pointer); | 437 | new_table_desc->address, |
438 | new_table_desc->flags, | ||
439 | new_table_desc->pointer); | ||
431 | 440 | ||
432 | acpi_tb_print_table_header(new_table_desc->address, | 441 | acpi_tb_print_table_header(new_table_desc->address, |
433 | new_table_desc->pointer); | 442 | new_table_desc->pointer); |
@@ -473,8 +482,8 @@ acpi_tb_install_fixed_table(acpi_physical_address address, | |||
473 | 482 | ||
474 | /* Fill a table descriptor for validation */ | 483 | /* Fill a table descriptor for validation */ |
475 | 484 | ||
476 | status = acpi_tb_acquire_temporal_table(&new_table_desc, address, | 485 | status = acpi_tb_acquire_temp_table(&new_table_desc, address, |
477 | ACPI_TABLE_ORIGIN_INTERN_PHYSICAL); | 486 | ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); |
478 | if (ACPI_FAILURE(status)) { | 487 | if (ACPI_FAILURE(status)) { |
479 | ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", | 488 | ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", |
480 | ACPI_CAST_PTR(void, address))); | 489 | ACPI_CAST_PTR(void, address))); |
@@ -488,13 +497,13 @@ acpi_tb_install_fixed_table(acpi_physical_address address, | |||
488 | goto release_and_exit; | 497 | goto release_and_exit; |
489 | } | 498 | } |
490 | 499 | ||
491 | acpi_tb_install_and_override_table(table_index, &new_table_desc, TRUE); | 500 | acpi_tb_install_table_with_override(table_index, &new_table_desc, TRUE); |
492 | 501 | ||
493 | release_and_exit: | 502 | release_and_exit: |
494 | 503 | ||
495 | /* Release the temporal table descriptor */ | 504 | /* Release the temporary table descriptor */ |
496 | 505 | ||
497 | acpi_tb_release_temporal_table(&new_table_desc); | 506 | acpi_tb_release_temp_table(&new_table_desc); |
498 | return_ACPI_STATUS(status); | 507 | return_ACPI_STATUS(status); |
499 | } | 508 | } |
500 | 509 | ||
@@ -539,13 +548,12 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, u32 table_index) | |||
539 | /* Release the acquired table */ | 548 | /* Release the acquired table */ |
540 | 549 | ||
541 | acpi_tb_release_table(table, table_length, table_flags); | 550 | acpi_tb_release_table(table, table_length, table_flags); |
542 | |||
543 | return (is_equivalent); | 551 | return (is_equivalent); |
544 | } | 552 | } |
545 | 553 | ||
546 | /******************************************************************************* | 554 | /******************************************************************************* |
547 | * | 555 | * |
548 | * FUNCTION: acpi_tb_install_non_fixed_table | 556 | * FUNCTION: acpi_tb_install_standard_table |
549 | * | 557 | * |
550 | * PARAMETERS: address - Address of the table (might be a virtual | 558 | * PARAMETERS: address - Address of the table (might be a virtual |
551 | * address depending on the table_flags) | 559 | * address depending on the table_flags) |
@@ -557,7 +565,7 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, u32 table_index) | |||
557 | * RETURN: Status | 565 | * RETURN: Status |
558 | * | 566 | * |
559 | * DESCRIPTION: This function is called to install an ACPI table that is | 567 | * DESCRIPTION: This function is called to install an ACPI table that is |
560 | * neither DSDT nor FACS. | 568 | * neither DSDT nor FACS (a "standard" table.) |
561 | * When this function is called by "Load" or "LoadTable" opcodes, | 569 | * When this function is called by "Load" or "LoadTable" opcodes, |
562 | * or by acpi_load_table() API, the "Reload" parameter is set. | 570 | * or by acpi_load_table() API, the "Reload" parameter is set. |
563 | * After sucessfully returning from this function, table is | 571 | * After sucessfully returning from this function, table is |
@@ -566,20 +574,19 @@ acpi_tb_is_equivalent_table(struct acpi_table_desc *table_desc, u32 table_index) | |||
566 | ******************************************************************************/ | 574 | ******************************************************************************/ |
567 | 575 | ||
568 | acpi_status | 576 | acpi_status |
569 | acpi_tb_install_non_fixed_table(acpi_physical_address address, | 577 | acpi_tb_install_standard_table(acpi_physical_address address, |
570 | u8 flags, | 578 | u8 flags, |
571 | u8 reload, u8 override, u32 *table_index) | 579 | u8 reload, u8 override, u32 *table_index) |
572 | { | 580 | { |
573 | u32 i; | 581 | u32 i; |
574 | acpi_status status = AE_OK; | 582 | acpi_status status = AE_OK; |
575 | struct acpi_table_desc new_table_desc; | 583 | struct acpi_table_desc new_table_desc; |
576 | 584 | ||
577 | ACPI_FUNCTION_TRACE(tb_install_non_fixed_table); | 585 | ACPI_FUNCTION_TRACE(tb_install_standard_table); |
578 | 586 | ||
579 | /* Acquire a temporal table descriptor for validation */ | 587 | /* Acquire a temporary table descriptor for validation */ |
580 | 588 | ||
581 | status = | 589 | status = acpi_tb_acquire_temp_table(&new_table_desc, address, flags); |
582 | acpi_tb_acquire_temporal_table(&new_table_desc, address, flags); | ||
583 | if (ACPI_FAILURE(status)) { | 590 | if (ACPI_FAILURE(status)) { |
584 | ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", | 591 | ACPI_ERROR((AE_INFO, "Could not acquire table length at %p", |
585 | ACPI_CAST_PTR(void, address))); | 592 | ACPI_CAST_PTR(void, address))); |
@@ -590,7 +597,8 @@ acpi_tb_install_non_fixed_table(acpi_physical_address address, | |||
590 | * Optionally do not load any SSDTs from the RSDT/XSDT. This can | 597 | * Optionally do not load any SSDTs from the RSDT/XSDT. This can |
591 | * be useful for debugging ACPI problems on some machines. | 598 | * be useful for debugging ACPI problems on some machines. |
592 | */ | 599 | */ |
593 | if (!reload && acpi_gbl_disable_ssdt_table_install && | 600 | if (!reload && |
601 | acpi_gbl_disable_ssdt_table_install && | ||
594 | ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) { | 602 | ACPI_COMPARE_NAME(&new_table_desc.signature, ACPI_SIG_SSDT)) { |
595 | ACPI_INFO((AE_INFO, "Ignoring installation of %4.4s at %p", | 603 | ACPI_INFO((AE_INFO, "Ignoring installation of %4.4s at %p", |
596 | new_table_desc.signature.ascii, ACPI_CAST_PTR(void, | 604 | new_table_desc.signature.ascii, ACPI_CAST_PTR(void, |
@@ -675,7 +683,7 @@ acpi_tb_install_non_fixed_table(acpi_physical_address address, | |||
675 | * As we are going to return AE_OK to the caller, we should | 683 | * As we are going to return AE_OK to the caller, we should |
676 | * take the responsibility of freeing the input descriptor. | 684 | * take the responsibility of freeing the input descriptor. |
677 | * Refill the input descriptor to ensure | 685 | * Refill the input descriptor to ensure |
678 | * acpi_tb_install_and_override_table() can be called again to | 686 | * acpi_tb_install_table_with_override() can be called again to |
679 | * indicate the re-installation. | 687 | * indicate the re-installation. |
680 | */ | 688 | */ |
681 | acpi_tb_uninstall_table(&new_table_desc); | 689 | acpi_tb_uninstall_table(&new_table_desc); |
@@ -688,18 +696,19 @@ acpi_tb_install_non_fixed_table(acpi_physical_address address, | |||
688 | 696 | ||
689 | /* Add the table to the global root table list */ | 697 | /* Add the table to the global root table list */ |
690 | 698 | ||
691 | status = acpi_tb_acquire_root_table_entry(&i); | 699 | status = acpi_tb_get_root_table_entry(&i); |
692 | if (ACPI_FAILURE(status)) { | 700 | if (ACPI_FAILURE(status)) { |
693 | goto release_and_exit; | 701 | goto release_and_exit; |
694 | } | 702 | } |
703 | |||
695 | *table_index = i; | 704 | *table_index = i; |
696 | acpi_tb_install_and_override_table(i, &new_table_desc, override); | 705 | acpi_tb_install_table_with_override(i, &new_table_desc, override); |
697 | 706 | ||
698 | release_and_exit: | 707 | release_and_exit: |
699 | 708 | ||
700 | /* Release the temporal table descriptor */ | 709 | /* Release the temporary table descriptor */ |
701 | 710 | ||
702 | acpi_tb_release_temporal_table(&new_table_desc); | 711 | acpi_tb_release_temp_table(&new_table_desc); |
703 | return_ACPI_STATUS(status); | 712 | return_ACPI_STATUS(status); |
704 | } | 713 | } |
705 | 714 | ||
@@ -733,9 +742,9 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc) | |||
733 | 742 | ||
734 | status = acpi_os_table_override(old_table_desc->pointer, &table); | 743 | status = acpi_os_table_override(old_table_desc->pointer, &table); |
735 | if (ACPI_SUCCESS(status) && table) { | 744 | if (ACPI_SUCCESS(status) && table) { |
736 | acpi_tb_acquire_temporal_table(&new_table_desc, | 745 | acpi_tb_acquire_temp_table(&new_table_desc, |
737 | ACPI_PTR_TO_PHYSADDR(table), | 746 | ACPI_PTR_TO_PHYSADDR(table), |
738 | ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL); | 747 | ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL); |
739 | override_type = "Logical"; | 748 | override_type = "Logical"; |
740 | goto finish_override; | 749 | goto finish_override; |
741 | } | 750 | } |
@@ -745,8 +754,8 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc) | |||
745 | status = acpi_os_physical_table_override(old_table_desc->pointer, | 754 | status = acpi_os_physical_table_override(old_table_desc->pointer, |
746 | &address, &length); | 755 | &address, &length); |
747 | if (ACPI_SUCCESS(status) && address && length) { | 756 | if (ACPI_SUCCESS(status) && address && length) { |
748 | acpi_tb_acquire_temporal_table(&new_table_desc, address, | 757 | acpi_tb_acquire_temp_table(&new_table_desc, address, |
749 | ACPI_TABLE_ORIGIN_INTERN_PHYSICAL); | 758 | ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); |
750 | override_type = "Physical"; | 759 | override_type = "Physical"; |
751 | goto finish_override; | 760 | goto finish_override; |
752 | } | 761 | } |
@@ -776,13 +785,14 @@ finish_override: | |||
776 | * Replace the original table descriptor and keep its state as | 785 | * Replace the original table descriptor and keep its state as |
777 | * "VALIDATED". | 786 | * "VALIDATED". |
778 | */ | 787 | */ |
779 | acpi_tb_install_table(old_table_desc, new_table_desc.address, | 788 | acpi_tb_init_table_descriptor(old_table_desc, new_table_desc.address, |
780 | new_table_desc.flags, new_table_desc.pointer); | 789 | new_table_desc.flags, |
790 | new_table_desc.pointer); | ||
781 | acpi_tb_validate_table(old_table_desc); | 791 | acpi_tb_validate_table(old_table_desc); |
782 | 792 | ||
783 | /* Release the temporal table descriptor */ | 793 | /* Release the temporary table descriptor */ |
784 | 794 | ||
785 | acpi_tb_release_temporal_table(&new_table_desc); | 795 | acpi_tb_release_temp_table(&new_table_desc); |
786 | } | 796 | } |
787 | 797 | ||
788 | /******************************************************************************* | 798 | /******************************************************************************* |
@@ -851,7 +861,7 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
851 | 861 | ||
852 | /******************************************************************************* | 862 | /******************************************************************************* |
853 | * | 863 | * |
854 | * FUNCTION: acpi_tb_acquire_root_table_entry | 864 | * FUNCTION: acpi_tb_get_root_table_entry |
855 | * | 865 | * |
856 | * PARAMETERS: table_index - Where table index is returned | 866 | * PARAMETERS: table_index - Where table index is returned |
857 | * | 867 | * |
@@ -861,7 +871,7 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
861 | * | 871 | * |
862 | ******************************************************************************/ | 872 | ******************************************************************************/ |
863 | 873 | ||
864 | static acpi_status acpi_tb_acquire_root_table_entry(u32 *table_index) | 874 | static acpi_status acpi_tb_get_root_table_entry(u32 *table_index) |
865 | { | 875 | { |
866 | acpi_status status; | 876 | acpi_status status; |
867 | 877 | ||
@@ -887,7 +897,8 @@ static acpi_status acpi_tb_acquire_root_table_entry(u32 *table_index) | |||
887 | * PARAMETERS: address - Table address | 897 | * PARAMETERS: address - Table address |
888 | * table - Table header | 898 | * table - Table header |
889 | * length - Table length | 899 | * length - Table length |
890 | * flags - flags | 900 | * flags - Install flags |
901 | * table_index - Where the table index is returned | ||
891 | * | 902 | * |
892 | * RETURN: Status and table index. | 903 | * RETURN: Status and table index. |
893 | * | 904 | * |
@@ -903,7 +914,7 @@ acpi_tb_store_table(acpi_physical_address address, | |||
903 | acpi_status status; | 914 | acpi_status status; |
904 | struct acpi_table_desc *table_desc; | 915 | struct acpi_table_desc *table_desc; |
905 | 916 | ||
906 | status = acpi_tb_acquire_root_table_entry(table_index); | 917 | status = acpi_tb_get_root_table_entry(table_index); |
907 | if (ACPI_FAILURE(status)) { | 918 | if (ACPI_FAILURE(status)) { |
908 | return (status); | 919 | return (status); |
909 | } | 920 | } |
@@ -911,9 +922,8 @@ acpi_tb_store_table(acpi_physical_address address, | |||
911 | /* Initialize added table */ | 922 | /* Initialize added table */ |
912 | 923 | ||
913 | table_desc = &acpi_gbl_root_table_list.tables[*table_index]; | 924 | table_desc = &acpi_gbl_root_table_list.tables[*table_index]; |
914 | acpi_tb_install_table(table_desc, address, flags, table); | 925 | acpi_tb_init_table_descriptor(table_desc, address, flags, table); |
915 | table_desc->pointer = table; | 926 | table_desc->pointer = table; |
916 | |||
917 | return (AE_OK); | 927 | return (AE_OK); |
918 | } | 928 | } |
919 | 929 | ||
@@ -943,12 +953,11 @@ void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc) | |||
943 | acpi_tb_invalidate_table(table_desc); | 953 | acpi_tb_invalidate_table(table_desc); |
944 | 954 | ||
945 | if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) == | 955 | if ((table_desc->flags & ACPI_TABLE_ORIGIN_MASK) == |
946 | ACPI_TABLE_ORIGIN_INTERN_VIRTUAL) { | 956 | ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) { |
947 | ACPI_FREE(ACPI_CAST_PTR(void, table_desc->address)); | 957 | ACPI_FREE(ACPI_CAST_PTR(void, table_desc->address)); |
948 | } | 958 | } |
949 | 959 | ||
950 | table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL); | 960 | table_desc->address = ACPI_PTR_TO_PHYSADDR(NULL); |
951 | |||
952 | return_VOID; | 961 | return_VOID; |
953 | } | 962 | } |
954 | 963 | ||
@@ -991,8 +1000,8 @@ void acpi_tb_terminate(void) | |||
991 | acpi_gbl_root_table_list.current_table_count = 0; | 1000 | acpi_gbl_root_table_list.current_table_count = 0; |
992 | 1001 | ||
993 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n")); | 1002 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n")); |
994 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
995 | 1003 | ||
1004 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
996 | return_VOID; | 1005 | return_VOID; |
997 | } | 1006 | } |
998 | 1007 | ||
@@ -1074,8 +1083,10 @@ acpi_status acpi_tb_allocate_owner_id(u32 table_index) | |||
1074 | 1083 | ||
1075 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 1084 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
1076 | if (table_index < acpi_gbl_root_table_list.current_table_count) { | 1085 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
1077 | status = acpi_ut_allocate_owner_id | 1086 | status = |
1078 | (&(acpi_gbl_root_table_list.tables[table_index].owner_id)); | 1087 | acpi_ut_allocate_owner_id(& |
1088 | (acpi_gbl_root_table_list. | ||
1089 | tables[table_index].owner_id)); | ||
1079 | } | 1090 | } |
1080 | 1091 | ||
1081 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 1092 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
@@ -1146,7 +1157,7 @@ acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id * owner_id) | |||
1146 | * | 1157 | * |
1147 | * FUNCTION: acpi_tb_is_table_loaded | 1158 | * FUNCTION: acpi_tb_is_table_loaded |
1148 | * | 1159 | * |
1149 | * PARAMETERS: table_index - Table index | 1160 | * PARAMETERS: table_index - Index into the root table |
1150 | * | 1161 | * |
1151 | * RETURN: Table Loaded Flag | 1162 | * RETURN: Table Loaded Flag |
1152 | * | 1163 | * |
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index aa11949815df..6c31d77cece0 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -179,10 +179,12 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) | |||
179 | 179 | ||
180 | ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); | 180 | ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); |
181 | acpi_tb_uninstall_table(table_desc); | 181 | acpi_tb_uninstall_table(table_desc); |
182 | acpi_tb_install_table(&acpi_gbl_root_table_list. | 182 | |
183 | tables[ACPI_TABLE_INDEX_DSDT], | 183 | acpi_tb_init_table_descriptor(&acpi_gbl_root_table_list. |
184 | ACPI_PTR_TO_PHYSADDR(new_table), | 184 | tables[ACPI_TABLE_INDEX_DSDT], |
185 | ACPI_TABLE_ORIGIN_INTERN_VIRTUAL, new_table); | 185 | ACPI_PTR_TO_PHYSADDR(new_table), |
186 | ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, | ||
187 | new_table); | ||
186 | 188 | ||
187 | ACPI_INFO((AE_INFO, | 189 | ACPI_INFO((AE_INFO, |
188 | "Forced DSDT copy: length 0x%05X copied locally, original unmapped", | 190 | "Forced DSDT copy: length 0x%05X copied locally, original unmapped", |
@@ -470,11 +472,11 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
470 | /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ | 472 | /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ |
471 | 473 | ||
472 | status = | 474 | status = |
473 | acpi_tb_install_non_fixed_table(acpi_tb_get_root_table_entry | 475 | acpi_tb_install_standard_table(acpi_tb_get_root_table_entry |
474 | (table_entry, | 476 | (table_entry, |
475 | table_entry_size), | 477 | table_entry_size), |
476 | ACPI_TABLE_ORIGIN_INTERN_PHYSICAL, | 478 | ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, |
477 | FALSE, TRUE, &table_index); | 479 | FALSE, TRUE, &table_index); |
478 | 480 | ||
479 | if (ACPI_SUCCESS(status) && | 481 | if (ACPI_SUCCESS(status) && |
480 | ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. | 482 | ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. |
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 19c0b13ad4c2..6482b0ded652 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -233,7 +233,7 @@ acpi_get_table_header(char *signature, | |||
233 | if (!acpi_gbl_root_table_list.tables[i].pointer) { | 233 | if (!acpi_gbl_root_table_list.tables[i].pointer) { |
234 | if ((acpi_gbl_root_table_list.tables[i].flags & | 234 | if ((acpi_gbl_root_table_list.tables[i].flags & |
235 | ACPI_TABLE_ORIGIN_MASK) == | 235 | ACPI_TABLE_ORIGIN_MASK) == |
236 | ACPI_TABLE_ORIGIN_INTERN_PHYSICAL) { | 236 | ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL) { |
237 | header = | 237 | header = |
238 | acpi_os_map_memory(acpi_gbl_root_table_list. | 238 | acpi_os_map_memory(acpi_gbl_root_table_list. |
239 | tables[i].address, | 239 | tables[i].address, |
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c index 529f633efa55..ab5308b81aa8 100644 --- a/drivers/acpi/acpica/tbxfload.c +++ b/drivers/acpi/acpica/tbxfload.c | |||
@@ -219,13 +219,13 @@ acpi_install_table(acpi_physical_address address, u8 physical) | |||
219 | ACPI_FUNCTION_TRACE(acpi_install_table); | 219 | ACPI_FUNCTION_TRACE(acpi_install_table); |
220 | 220 | ||
221 | if (physical) { | 221 | if (physical) { |
222 | flags = ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL; | 222 | flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; |
223 | } else { | 223 | } else { |
224 | flags = ACPI_TABLE_ORIGIN_INTERN_PHYSICAL; | 224 | flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; |
225 | } | 225 | } |
226 | 226 | ||
227 | status = acpi_tb_install_non_fixed_table(address, flags, | 227 | status = acpi_tb_install_standard_table(address, flags, |
228 | FALSE, FALSE, &table_index); | 228 | FALSE, FALSE, &table_index); |
229 | 229 | ||
230 | return_ACPI_STATUS(status); | 230 | return_ACPI_STATUS(status); |
231 | } | 231 | } |
@@ -272,9 +272,11 @@ acpi_status acpi_load_table(struct acpi_table_header *table) | |||
272 | 272 | ||
273 | ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); | 273 | ACPI_INFO((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); |
274 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 274 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
275 | status = acpi_tb_install_non_fixed_table(ACPI_PTR_TO_PHYSADDR(table), | 275 | |
276 | ACPI_TABLE_ORIGIN_EXTERN_VIRTUAL, | 276 | status = acpi_tb_install_standard_table(ACPI_PTR_TO_PHYSADDR(table), |
277 | TRUE, FALSE, &table_index); | 277 | ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, |
278 | TRUE, FALSE, &table_index); | ||
279 | |||
278 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 280 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
279 | if (ACPI_FAILURE(status)) { | 281 | if (ACPI_FAILURE(status)) { |
280 | goto unlock_and_exit; | 282 | goto unlock_and_exit; |