diff options
author | Bob Moore <robert.moore@intel.com> | 2010-04-26 23:16:14 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-05-06 03:05:54 -0400 |
commit | b9ee2043096b02e5da8c62f9a8a8f2e172b3606b (patch) | |
tree | aa0ad908c72d46f2eae8252aed80f0ed84cbf6ec /drivers/acpi/acpica | |
parent | e4eb0450c5d61dd0064ef0904d74088d35284ae2 (diff) |
ACPICA: Clarify/rename some root table descriptor fields
Original fields were not very descriptive and led to maintenance
problems. New fields should help to understand the existing code.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/acglobal.h | 7 | ||||
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 10 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbfind.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 69 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbutils.c | 19 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxface.c | 26 |
6 files changed, 68 insertions, 65 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 87f21d9d2a66..9070f1fe8f17 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -158,11 +158,10 @@ ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; | |||
158 | ****************************************************************************/ | 158 | ****************************************************************************/ |
159 | 159 | ||
160 | /* | 160 | /* |
161 | * acpi_gbl_root_table_list is the master list of ACPI tables found in the | 161 | * acpi_gbl_root_table_list is the master list of ACPI tables that were |
162 | * RSDT/XSDT. | 162 | * found in the RSDT/XSDT. |
163 | * | ||
164 | */ | 163 | */ |
165 | ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; | 164 | ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list; |
166 | ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; | 165 | ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; |
167 | 166 | ||
168 | /* These addresses are calculated from the FADT Event Block addresses */ | 167 | /* These addresses are calculated from the FADT Event Block addresses */ |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 5a6203a40c3e..0886a3dfe134 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -213,12 +213,12 @@ struct acpi_namespace_node { | |||
213 | #define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ | 213 | #define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ |
214 | #define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ | 214 | #define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ |
215 | 215 | ||
216 | /* One internal RSDT for table management */ | 216 | /* Internal ACPI table management - master table list */ |
217 | 217 | ||
218 | struct acpi_internal_rsdt { | 218 | struct acpi_table_list { |
219 | struct acpi_table_desc *tables; | 219 | struct acpi_table_desc *tables; /* Table descriptor array */ |
220 | u32 count; | 220 | u32 current_table_count; /* Tables currently in the array */ |
221 | u32 size; | 221 | u32 max_table_count; /* Max tables array will hold */ |
222 | u8 flags; | 222 | u8 flags; |
223 | }; | 223 | }; |
224 | 224 | ||
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c index e252180ce61c..989d5c867864 100644 --- a/drivers/acpi/acpica/tbfind.c +++ b/drivers/acpi/acpica/tbfind.c | |||
@@ -83,7 +83,7 @@ acpi_tb_find_table(char *signature, | |||
83 | 83 | ||
84 | /* Search for the table */ | 84 | /* Search for the table */ |
85 | 85 | ||
86 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 86 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { |
87 | if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature), | 87 | if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature), |
88 | header.signature, ACPI_NAME_SIZE)) { | 88 | header.signature, ACPI_NAME_SIZE)) { |
89 | 89 | ||
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 7ec02b0f69e0..83d7af8d0905 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -137,7 +137,7 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) | |||
137 | 137 | ||
138 | /* Check if table is already registered */ | 138 | /* Check if table is already registered */ |
139 | 139 | ||
140 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 140 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { |
141 | if (!acpi_gbl_root_table_list.tables[i].pointer) { | 141 | if (!acpi_gbl_root_table_list.tables[i].pointer) { |
142 | status = | 142 | status = |
143 | acpi_tb_verify_table(&acpi_gbl_root_table_list. | 143 | acpi_tb_verify_table(&acpi_gbl_root_table_list. |
@@ -273,7 +273,7 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
273 | /* Increase the Table Array size */ | 273 | /* Increase the Table Array size */ |
274 | 274 | ||
275 | tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list. | 275 | tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list. |
276 | size + | 276 | max_table_count + |
277 | ACPI_ROOT_TABLE_SIZE_INCREMENT) * | 277 | ACPI_ROOT_TABLE_SIZE_INCREMENT) * |
278 | sizeof(struct acpi_table_desc)); | 278 | sizeof(struct acpi_table_desc)); |
279 | if (!tables) { | 279 | if (!tables) { |
@@ -286,8 +286,8 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
286 | 286 | ||
287 | if (acpi_gbl_root_table_list.tables) { | 287 | if (acpi_gbl_root_table_list.tables) { |
288 | ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, | 288 | ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, |
289 | (acpi_size) acpi_gbl_root_table_list.size * | 289 | (acpi_size) acpi_gbl_root_table_list. |
290 | sizeof(struct acpi_table_desc)); | 290 | max_table_count * sizeof(struct acpi_table_desc)); |
291 | 291 | ||
292 | if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { | 292 | if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { |
293 | ACPI_FREE(acpi_gbl_root_table_list.tables); | 293 | ACPI_FREE(acpi_gbl_root_table_list.tables); |
@@ -295,8 +295,9 @@ acpi_status acpi_tb_resize_root_table_list(void) | |||
295 | } | 295 | } |
296 | 296 | ||
297 | acpi_gbl_root_table_list.tables = tables; | 297 | acpi_gbl_root_table_list.tables = tables; |
298 | acpi_gbl_root_table_list.size += ACPI_ROOT_TABLE_SIZE_INCREMENT; | 298 | acpi_gbl_root_table_list.max_table_count += |
299 | acpi_gbl_root_table_list.flags |= (u8) ACPI_ROOT_ORIGIN_ALLOCATED; | 299 | ACPI_ROOT_TABLE_SIZE_INCREMENT; |
300 | acpi_gbl_root_table_list.flags |= (u8)ACPI_ROOT_ORIGIN_ALLOCATED; | ||
300 | 301 | ||
301 | return_ACPI_STATUS(AE_OK); | 302 | return_ACPI_STATUS(AE_OK); |
302 | } | 303 | } |
@@ -321,38 +322,36 @@ acpi_tb_store_table(acpi_physical_address address, | |||
321 | struct acpi_table_header *table, | 322 | struct acpi_table_header *table, |
322 | u32 length, u8 flags, u32 *table_index) | 323 | u32 length, u8 flags, u32 *table_index) |
323 | { | 324 | { |
324 | acpi_status status = AE_OK; | 325 | acpi_status status; |
326 | struct acpi_table_desc *new_table; | ||
325 | 327 | ||
326 | /* Ensure that there is room for the table in the Root Table List */ | 328 | /* Ensure that there is room for the table in the Root Table List */ |
327 | 329 | ||
328 | if (acpi_gbl_root_table_list.count >= acpi_gbl_root_table_list.size) { | 330 | if (acpi_gbl_root_table_list.current_table_count >= |
331 | acpi_gbl_root_table_list.max_table_count) { | ||
329 | status = acpi_tb_resize_root_table_list(); | 332 | status = acpi_tb_resize_root_table_list(); |
330 | if (ACPI_FAILURE(status)) { | 333 | if (ACPI_FAILURE(status)) { |
331 | return (status); | 334 | return (status); |
332 | } | 335 | } |
333 | } | 336 | } |
334 | 337 | ||
338 | new_table = | ||
339 | &acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list. | ||
340 | current_table_count]; | ||
341 | |||
335 | /* Initialize added table */ | 342 | /* Initialize added table */ |
336 | 343 | ||
337 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count]. | 344 | new_table->address = address; |
338 | address = address; | 345 | new_table->pointer = table; |
339 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count]. | 346 | new_table->length = length; |
340 | pointer = table; | 347 | new_table->owner_id = 0; |
341 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count].length = | 348 | new_table->flags = flags; |
342 | length; | 349 | |
343 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count]. | 350 | ACPI_MOVE_32_TO_32(&new_table->signature, table->signature); |
344 | owner_id = 0; | 351 | |
345 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count].flags = | 352 | *table_index = acpi_gbl_root_table_list.current_table_count; |
346 | flags; | 353 | acpi_gbl_root_table_list.current_table_count++; |
347 | 354 | return (AE_OK); | |
348 | ACPI_MOVE_32_TO_32(& | ||
349 | (acpi_gbl_root_table_list. | ||
350 | tables[acpi_gbl_root_table_list.count].signature), | ||
351 | table->signature); | ||
352 | |||
353 | *table_index = acpi_gbl_root_table_list.count; | ||
354 | acpi_gbl_root_table_list.count++; | ||
355 | return (status); | ||
356 | } | 355 | } |
357 | 356 | ||
358 | /******************************************************************************* | 357 | /******************************************************************************* |
@@ -408,7 +407,7 @@ void acpi_tb_terminate(void) | |||
408 | 407 | ||
409 | /* Delete the individual tables */ | 408 | /* Delete the individual tables */ |
410 | 409 | ||
411 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 410 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; i++) { |
412 | acpi_tb_delete_table(&acpi_gbl_root_table_list.tables[i]); | 411 | acpi_tb_delete_table(&acpi_gbl_root_table_list.tables[i]); |
413 | } | 412 | } |
414 | 413 | ||
@@ -422,7 +421,7 @@ void acpi_tb_terminate(void) | |||
422 | 421 | ||
423 | acpi_gbl_root_table_list.tables = NULL; | 422 | acpi_gbl_root_table_list.tables = NULL; |
424 | acpi_gbl_root_table_list.flags = 0; | 423 | acpi_gbl_root_table_list.flags = 0; |
425 | acpi_gbl_root_table_list.count = 0; | 424 | acpi_gbl_root_table_list.current_table_count = 0; |
426 | 425 | ||
427 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n")); | 426 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ACPI Tables freed\n")); |
428 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 427 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
@@ -452,7 +451,7 @@ acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index) | |||
452 | return_ACPI_STATUS(status); | 451 | return_ACPI_STATUS(status); |
453 | } | 452 | } |
454 | 453 | ||
455 | if (table_index >= acpi_gbl_root_table_list.count) { | 454 | if (table_index >= acpi_gbl_root_table_list.current_table_count) { |
456 | 455 | ||
457 | /* The table index does not exist */ | 456 | /* The table index does not exist */ |
458 | 457 | ||
@@ -505,7 +504,7 @@ acpi_status acpi_tb_allocate_owner_id(u32 table_index) | |||
505 | ACPI_FUNCTION_TRACE(tb_allocate_owner_id); | 504 | ACPI_FUNCTION_TRACE(tb_allocate_owner_id); |
506 | 505 | ||
507 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 506 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
508 | if (table_index < acpi_gbl_root_table_list.count) { | 507 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
509 | status = acpi_ut_allocate_owner_id | 508 | status = acpi_ut_allocate_owner_id |
510 | (&(acpi_gbl_root_table_list.tables[table_index].owner_id)); | 509 | (&(acpi_gbl_root_table_list.tables[table_index].owner_id)); |
511 | } | 510 | } |
@@ -533,7 +532,7 @@ acpi_status acpi_tb_release_owner_id(u32 table_index) | |||
533 | ACPI_FUNCTION_TRACE(tb_release_owner_id); | 532 | ACPI_FUNCTION_TRACE(tb_release_owner_id); |
534 | 533 | ||
535 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 534 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
536 | if (table_index < acpi_gbl_root_table_list.count) { | 535 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
537 | acpi_ut_release_owner_id(& | 536 | acpi_ut_release_owner_id(& |
538 | (acpi_gbl_root_table_list. | 537 | (acpi_gbl_root_table_list. |
539 | tables[table_index].owner_id)); | 538 | tables[table_index].owner_id)); |
@@ -564,7 +563,7 @@ acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id) | |||
564 | ACPI_FUNCTION_TRACE(tb_get_owner_id); | 563 | ACPI_FUNCTION_TRACE(tb_get_owner_id); |
565 | 564 | ||
566 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 565 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
567 | if (table_index < acpi_gbl_root_table_list.count) { | 566 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
568 | *owner_id = | 567 | *owner_id = |
569 | acpi_gbl_root_table_list.tables[table_index].owner_id; | 568 | acpi_gbl_root_table_list.tables[table_index].owner_id; |
570 | status = AE_OK; | 569 | status = AE_OK; |
@@ -589,7 +588,7 @@ u8 acpi_tb_is_table_loaded(u32 table_index) | |||
589 | u8 is_loaded = FALSE; | 588 | u8 is_loaded = FALSE; |
590 | 589 | ||
591 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 590 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
592 | if (table_index < acpi_gbl_root_table_list.count) { | 591 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
593 | is_loaded = (u8) | 592 | is_loaded = (u8) |
594 | (acpi_gbl_root_table_list.tables[table_index].flags & | 593 | (acpi_gbl_root_table_list.tables[table_index].flags & |
595 | ACPI_TABLE_IS_LOADED); | 594 | ACPI_TABLE_IS_LOADED); |
@@ -616,7 +615,7 @@ void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded) | |||
616 | { | 615 | { |
617 | 616 | ||
618 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 617 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
619 | if (table_index < acpi_gbl_root_table_list.count) { | 618 | if (table_index < acpi_gbl_root_table_list.current_table_count) { |
620 | if (is_loaded) { | 619 | if (is_loaded) { |
621 | acpi_gbl_root_table_list.tables[table_index].flags |= | 620 | acpi_gbl_root_table_list.tables[table_index].flags |= |
622 | ACPI_TABLE_IS_LOADED; | 621 | ACPI_TABLE_IS_LOADED; |
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index a9b105fc2e55..34f9c2bc5e1f 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -158,7 +158,7 @@ acpi_status acpi_tb_initialize_facs(void) | |||
158 | u8 acpi_tb_tables_loaded(void) | 158 | u8 acpi_tb_tables_loaded(void) |
159 | { | 159 | { |
160 | 160 | ||
161 | if (acpi_gbl_root_table_list.count >= 3) { | 161 | if (acpi_gbl_root_table_list.current_table_count >= 3) { |
162 | return (TRUE); | 162 | return (TRUE); |
163 | } | 163 | } |
164 | 164 | ||
@@ -707,14 +707,14 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
707 | */ | 707 | */ |
708 | table_entry = | 708 | table_entry = |
709 | ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); | 709 | ACPI_CAST_PTR(u8, table) + sizeof(struct acpi_table_header); |
710 | acpi_gbl_root_table_list.count = 2; | 710 | acpi_gbl_root_table_list.current_table_count = 2; |
711 | 711 | ||
712 | /* | 712 | /* |
713 | * Initialize the root table array from the RSDT/XSDT | 713 | * Initialize the root table array from the RSDT/XSDT |
714 | */ | 714 | */ |
715 | for (i = 0; i < table_count; i++) { | 715 | for (i = 0; i < table_count; i++) { |
716 | if (acpi_gbl_root_table_list.count >= | 716 | if (acpi_gbl_root_table_list.current_table_count >= |
717 | acpi_gbl_root_table_list.size) { | 717 | acpi_gbl_root_table_list.max_table_count) { |
718 | 718 | ||
719 | /* There is no more room in the root table array, attempt resize */ | 719 | /* There is no more room in the root table array, attempt resize */ |
720 | 720 | ||
@@ -724,19 +724,20 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
724 | "Truncating %u table entries!", | 724 | "Truncating %u table entries!", |
725 | (unsigned) (table_count - | 725 | (unsigned) (table_count - |
726 | (acpi_gbl_root_table_list. | 726 | (acpi_gbl_root_table_list. |
727 | count - 2)))); | 727 | current_table_count - |
728 | 2)))); | ||
728 | break; | 729 | break; |
729 | } | 730 | } |
730 | } | 731 | } |
731 | 732 | ||
732 | /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ | 733 | /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ |
733 | 734 | ||
734 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list.count]. | 735 | acpi_gbl_root_table_list.tables[acpi_gbl_root_table_list. |
735 | address = | 736 | current_table_count].address = |
736 | acpi_tb_get_root_table_entry(table_entry, table_entry_size); | 737 | acpi_tb_get_root_table_entry(table_entry, table_entry_size); |
737 | 738 | ||
738 | table_entry += table_entry_size; | 739 | table_entry += table_entry_size; |
739 | acpi_gbl_root_table_list.count++; | 740 | acpi_gbl_root_table_list.current_table_count++; |
740 | } | 741 | } |
741 | 742 | ||
742 | /* | 743 | /* |
@@ -749,7 +750,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) | |||
749 | * Complete the initialization of the root table array by examining | 750 | * Complete the initialization of the root table array by examining |
750 | * the header of each table | 751 | * the header of each table |
751 | */ | 752 | */ |
752 | for (i = 2; i < acpi_gbl_root_table_list.count; i++) { | 753 | for (i = 2; i < acpi_gbl_root_table_list.current_table_count; i++) { |
753 | acpi_tb_install_table(acpi_gbl_root_table_list.tables[i]. | 754 | acpi_tb_install_table(acpi_gbl_root_table_list.tables[i]. |
754 | address, NULL, i); | 755 | address, NULL, i); |
755 | 756 | ||
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index adb7f56b853e..4a8b9e6ea57a 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -72,7 +72,7 @@ static int no_auto_ssdt; | |||
72 | acpi_status acpi_allocate_root_table(u32 initial_table_count) | 72 | acpi_status acpi_allocate_root_table(u32 initial_table_count) |
73 | { | 73 | { |
74 | 74 | ||
75 | acpi_gbl_root_table_list.size = initial_table_count; | 75 | acpi_gbl_root_table_list.max_table_count = initial_table_count; |
76 | acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE; | 76 | acpi_gbl_root_table_list.flags = ACPI_ROOT_ALLOW_RESIZE; |
77 | 77 | ||
78 | return (acpi_tb_resize_root_table_list()); | 78 | return (acpi_tb_resize_root_table_list()); |
@@ -130,7 +130,7 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array, | |||
130 | sizeof(struct acpi_table_desc)); | 130 | sizeof(struct acpi_table_desc)); |
131 | 131 | ||
132 | acpi_gbl_root_table_list.tables = initial_table_array; | 132 | acpi_gbl_root_table_list.tables = initial_table_array; |
133 | acpi_gbl_root_table_list.size = initial_table_count; | 133 | acpi_gbl_root_table_list.max_table_count = initial_table_count; |
134 | acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN; | 134 | acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN; |
135 | if (allow_resize) { | 135 | if (allow_resize) { |
136 | acpi_gbl_root_table_list.flags |= | 136 | acpi_gbl_root_table_list.flags |= |
@@ -189,7 +189,8 @@ acpi_status acpi_reallocate_root_table(void) | |||
189 | * increment to create the new table size. | 189 | * increment to create the new table size. |
190 | */ | 190 | */ |
191 | current_size = (acpi_size) | 191 | current_size = (acpi_size) |
192 | acpi_gbl_root_table_list.count * sizeof(struct acpi_table_desc); | 192 | acpi_gbl_root_table_list.current_table_count * |
193 | sizeof(struct acpi_table_desc); | ||
193 | 194 | ||
194 | new_size = current_size + | 195 | new_size = current_size + |
195 | (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc)); | 196 | (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc)); |
@@ -209,8 +210,9 @@ acpi_status acpi_reallocate_root_table(void) | |||
209 | * size of the original table list. | 210 | * size of the original table list. |
210 | */ | 211 | */ |
211 | acpi_gbl_root_table_list.tables = tables; | 212 | acpi_gbl_root_table_list.tables = tables; |
212 | acpi_gbl_root_table_list.size = | 213 | acpi_gbl_root_table_list.max_table_count = |
213 | acpi_gbl_root_table_list.count + ACPI_ROOT_TABLE_SIZE_INCREMENT; | 214 | acpi_gbl_root_table_list.current_table_count + |
215 | ACPI_ROOT_TABLE_SIZE_INCREMENT; | ||
214 | acpi_gbl_root_table_list.flags = | 216 | acpi_gbl_root_table_list.flags = |
215 | ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; | 217 | ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; |
216 | 218 | ||
@@ -291,7 +293,8 @@ acpi_get_table_header(char *signature, | |||
291 | 293 | ||
292 | /* Walk the root table list */ | 294 | /* Walk the root table list */ |
293 | 295 | ||
294 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { | 296 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; |
297 | i++) { | ||
295 | if (!ACPI_COMPARE_NAME | 298 | if (!ACPI_COMPARE_NAME |
296 | (&(acpi_gbl_root_table_list.tables[i].signature), | 299 | (&(acpi_gbl_root_table_list.tables[i].signature), |
297 | signature)) { | 300 | signature)) { |
@@ -354,7 +357,7 @@ acpi_status acpi_unload_table_id(acpi_owner_id id) | |||
354 | ACPI_FUNCTION_TRACE(acpi_unload_table_id); | 357 | ACPI_FUNCTION_TRACE(acpi_unload_table_id); |
355 | 358 | ||
356 | /* Find table in the global table list */ | 359 | /* Find table in the global table list */ |
357 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 360 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { |
358 | if (id != acpi_gbl_root_table_list.tables[i].owner_id) { | 361 | if (id != acpi_gbl_root_table_list.tables[i].owner_id) { |
359 | continue; | 362 | continue; |
360 | } | 363 | } |
@@ -404,7 +407,8 @@ acpi_get_table_with_size(char *signature, | |||
404 | 407 | ||
405 | /* Walk the root table list */ | 408 | /* Walk the root table list */ |
406 | 409 | ||
407 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.count; i++) { | 410 | for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count; |
411 | i++) { | ||
408 | if (!ACPI_COMPARE_NAME | 412 | if (!ACPI_COMPARE_NAME |
409 | (&(acpi_gbl_root_table_list.tables[i].signature), | 413 | (&(acpi_gbl_root_table_list.tables[i].signature), |
410 | signature)) { | 414 | signature)) { |
@@ -472,7 +476,7 @@ acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) | |||
472 | 476 | ||
473 | /* Validate index */ | 477 | /* Validate index */ |
474 | 478 | ||
475 | if (table_index >= acpi_gbl_root_table_list.count) { | 479 | if (table_index >= acpi_gbl_root_table_list.current_table_count) { |
476 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 480 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
477 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 481 | return_ACPI_STATUS(AE_BAD_PARAMETER); |
478 | } | 482 | } |
@@ -523,7 +527,7 @@ static acpi_status acpi_tb_load_namespace(void) | |||
523 | * Load the namespace. The DSDT is required, but any SSDT and | 527 | * Load the namespace. The DSDT is required, but any SSDT and |
524 | * PSDT tables are optional. Verify the DSDT. | 528 | * PSDT tables are optional. Verify the DSDT. |
525 | */ | 529 | */ |
526 | if (!acpi_gbl_root_table_list.count || | 530 | if (!acpi_gbl_root_table_list.current_table_count || |
527 | !ACPI_COMPARE_NAME(& | 531 | !ACPI_COMPARE_NAME(& |
528 | (acpi_gbl_root_table_list. | 532 | (acpi_gbl_root_table_list. |
529 | tables[ACPI_TABLE_INDEX_DSDT].signature), | 533 | tables[ACPI_TABLE_INDEX_DSDT].signature), |
@@ -577,7 +581,7 @@ static acpi_status acpi_tb_load_namespace(void) | |||
577 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ | 581 | /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ |
578 | 582 | ||
579 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 583 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
580 | for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { | 584 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { |
581 | if ((!ACPI_COMPARE_NAME | 585 | if ((!ACPI_COMPARE_NAME |
582 | (&(acpi_gbl_root_table_list.tables[i].signature), | 586 | (&(acpi_gbl_root_table_list.tables[i].signature), |
583 | ACPI_SIG_SSDT) | 587 | ACPI_SIG_SSDT) |