Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193487
b: refs/heads/master
c: 333b04a
h: refs/heads/master
i:
  193485: 8112934
  193483: 12166cb
  193479: d407ce6
  193471: 5560c5a
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Apr 20, 2010
1 parent 29724cf commit d70971c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7499bc84eabb200f9dc23770a46d9a31b1e763a
refs/heads/master: 333b04ae338e3421297d46c508f053a6767d2883
23 changes: 18 additions & 5 deletions trunk/drivers/acpi/acpica/tbxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ acpi_status acpi_reallocate_root_table(void)
{
struct acpi_table_desc *tables;
acpi_size new_size;
acpi_size current_size;

ACPI_FUNCTION_TRACE(acpi_reallocate_root_table);

Expand All @@ -183,9 +184,15 @@ acpi_status acpi_reallocate_root_table(void)
return_ACPI_STATUS(AE_SUPPORT);
}

new_size = ((acpi_size) acpi_gbl_root_table_list.count +
ACPI_ROOT_TABLE_SIZE_INCREMENT) *
sizeof(struct acpi_table_desc);
/*
* Get the current size of the root table and add the default
* increment to create the new table size.
*/
current_size = (acpi_size)
acpi_gbl_root_table_list.count * sizeof(struct acpi_table_desc);

new_size = current_size +
(ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc));

/* Create new array and copy the old array */

Expand All @@ -194,10 +201,16 @@ acpi_status acpi_reallocate_root_table(void)
return_ACPI_STATUS(AE_NO_MEMORY);
}

ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, new_size);
ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, current_size);

acpi_gbl_root_table_list.size = acpi_gbl_root_table_list.count;
/*
* Update the root table descriptor. The new size will be the current
* number of tables plus the increment, independent of the reserved
* size of the original table list.
*/
acpi_gbl_root_table_list.tables = tables;
acpi_gbl_root_table_list.size =
acpi_gbl_root_table_list.count + ACPI_ROOT_TABLE_SIZE_INCREMENT;
acpi_gbl_root_table_list.flags =
ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;

Expand Down

0 comments on commit d70971c

Please sign in to comment.