aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/tbxface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/tbxface.c')
-rw-r--r--drivers/acpi/acpica/tbxface.c41
1 files changed, 5 insertions, 36 deletions
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index 29e51bc01383..21101262e47a 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -159,14 +159,12 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
159 * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the 159 * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the
160 * root list from the previously provided scratch area. Should 160 * root list from the previously provided scratch area. Should
161 * be called once dynamic memory allocation is available in the 161 * be called once dynamic memory allocation is available in the
162 * kernel 162 * kernel.
163 * 163 *
164 ******************************************************************************/ 164 ******************************************************************************/
165acpi_status acpi_reallocate_root_table(void) 165acpi_status acpi_reallocate_root_table(void)
166{ 166{
167 struct acpi_table_desc *tables; 167 acpi_status status;
168 acpi_size new_size;
169 acpi_size current_size;
170 168
171 ACPI_FUNCTION_TRACE(acpi_reallocate_root_table); 169 ACPI_FUNCTION_TRACE(acpi_reallocate_root_table);
172 170
@@ -178,39 +176,10 @@ acpi_status acpi_reallocate_root_table(void)
178 return_ACPI_STATUS(AE_SUPPORT); 176 return_ACPI_STATUS(AE_SUPPORT);
179 } 177 }
180 178
181 /* 179 acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE;
182 * Get the current size of the root table and add the default
183 * increment to create the new table size.
184 */
185 current_size = (acpi_size)
186 acpi_gbl_root_table_list.current_table_count *
187 sizeof(struct acpi_table_desc);
188
189 new_size = current_size +
190 (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc));
191
192 /* Create new array and copy the old array */
193
194 tables = ACPI_ALLOCATE_ZEROED(new_size);
195 if (!tables) {
196 return_ACPI_STATUS(AE_NO_MEMORY);
197 }
198 180
199 ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, current_size); 181 status = acpi_tb_resize_root_table_list();
200 182 return_ACPI_STATUS(status);
201 /*
202 * Update the root table descriptor. The new size will be the current
203 * number of tables plus the increment, independent of the reserved
204 * size of the original table list.
205 */
206 acpi_gbl_root_table_list.tables = tables;
207 acpi_gbl_root_table_list.max_table_count =
208 acpi_gbl_root_table_list.current_table_count +
209 ACPI_ROOT_TABLE_SIZE_INCREMENT;
210 acpi_gbl_root_table_list.flags =
211 ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;
212
213 return_ACPI_STATUS(AE_OK);
214} 183}
215 184
216/******************************************************************************* 185/*******************************************************************************