aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbinstal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables/tbinstal.c')
-rw-r--r--drivers/acpi/tables/tbinstal.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index ce57a195577a..7ca2df75bb11 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -73,11 +73,11 @@ acpi_tb_match_signature(char *signature,
73{ 73{
74 acpi_native_uint i; 74 acpi_native_uint i;
75 75
76 ACPI_FUNCTION_TRACE("tb_match_signature"); 76 ACPI_FUNCTION_TRACE(tb_match_signature);
77 77
78 /* Search for a signature match among the known table types */ 78 /* Search for a signature match among the known table types */
79 79
80 for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) { 80 for (i = 0; i < (ACPI_TABLE_ID_MAX + 1); i++) {
81 if (!(acpi_gbl_table_data[i].flags & search_type)) { 81 if (!(acpi_gbl_table_data[i].flags & search_type)) {
82 continue; 82 continue;
83 } 83 }
@@ -123,7 +123,7 @@ acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info)
123{ 123{
124 acpi_status status; 124 acpi_status status;
125 125
126 ACPI_FUNCTION_TRACE("tb_install_table"); 126 ACPI_FUNCTION_TRACE(tb_install_table);
127 127
128 /* Lock tables while installing */ 128 /* Lock tables while installing */
129 129
@@ -188,7 +188,7 @@ acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type)
188 struct acpi_table_header *table_header; 188 struct acpi_table_header *table_header;
189 acpi_status status; 189 acpi_status status;
190 190
191 ACPI_FUNCTION_TRACE("tb_recognize_table"); 191 ACPI_FUNCTION_TRACE(tb_recognize_table);
192 192
193 /* Ensure that we have a valid table pointer */ 193 /* Ensure that we have a valid table pointer */
194 194
@@ -219,7 +219,6 @@ acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type)
219 /* Return the table type and length via the info struct */ 219 /* Return the table type and length via the info struct */
220 220
221 table_info->length = (acpi_size) table_header->length; 221 table_info->length = (acpi_size) table_header->length;
222
223 return_ACPI_STATUS(status); 222 return_ACPI_STATUS(status);
224} 223}
225 224
@@ -244,7 +243,7 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
244 struct acpi_table_desc *table_desc; 243 struct acpi_table_desc *table_desc;
245 acpi_status status; 244 acpi_status status;
246 245
247 ACPI_FUNCTION_TRACE_U32("tb_init_table_descriptor", table_type); 246 ACPI_FUNCTION_TRACE_U32(tb_init_table_descriptor, table_type);
248 247
249 /* Allocate a descriptor for this table */ 248 /* Allocate a descriptor for this table */
250 249
@@ -313,15 +312,14 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
313 312
314 /* Finish initialization of the table descriptor */ 313 /* Finish initialization of the table descriptor */
315 314
315 table_desc->loaded_into_namespace = FALSE;
316 table_desc->type = (u8) table_type; 316 table_desc->type = (u8) table_type;
317 table_desc->pointer = table_info->pointer; 317 table_desc->pointer = table_info->pointer;
318 table_desc->length = table_info->length; 318 table_desc->length = table_info->length;
319 table_desc->allocation = table_info->allocation; 319 table_desc->allocation = table_info->allocation;
320 table_desc->aml_start = (u8 *) (table_desc->pointer + 1), 320 table_desc->aml_start = (u8 *) (table_desc->pointer + 1),
321 table_desc->aml_length = (u32) (table_desc->length - 321 table_desc->aml_length = (u32)
322 (u32) sizeof(struct 322 (table_desc->length - (u32) sizeof(struct acpi_table_header));
323 acpi_table_header));
324 table_desc->loaded_into_namespace = FALSE;
325 323
326 /* 324 /*
327 * Set the appropriate global pointer (if there is one) to point to the 325 * Set the appropriate global pointer (if there is one) to point to the
@@ -336,7 +334,6 @@ acpi_tb_init_table_descriptor(acpi_table_type table_type,
336 334
337 table_info->owner_id = table_desc->owner_id; 335 table_info->owner_id = table_desc->owner_id;
338 table_info->installed_desc = table_desc; 336 table_info->installed_desc = table_desc;
339
340 return_ACPI_STATUS(AE_OK); 337 return_ACPI_STATUS(AE_OK);
341} 338}
342 339
@@ -360,7 +357,7 @@ void acpi_tb_delete_all_tables(void)
360 * Free memory allocated for ACPI tables 357 * Free memory allocated for ACPI tables
361 * Memory can either be mapped or allocated 358 * Memory can either be mapped or allocated
362 */ 359 */
363 for (type = 0; type < NUM_ACPI_TABLE_TYPES; type++) { 360 for (type = 0; type < (ACPI_TABLE_ID_MAX + 1); type++) {
364 acpi_tb_delete_tables_by_type(type); 361 acpi_tb_delete_tables_by_type(type);
365 } 362 }
366} 363}
@@ -384,9 +381,9 @@ void acpi_tb_delete_tables_by_type(acpi_table_type type)
384 u32 count; 381 u32 count;
385 u32 i; 382 u32 i;
386 383
387 ACPI_FUNCTION_TRACE_U32("tb_delete_tables_by_type", type); 384 ACPI_FUNCTION_TRACE_U32(tb_delete_tables_by_type, type);
388 385
389 if (type > ACPI_TABLE_MAX) { 386 if (type > ACPI_TABLE_ID_MAX) {
390 return_VOID; 387 return_VOID;
391 } 388 }
392 389
@@ -397,28 +394,28 @@ void acpi_tb_delete_tables_by_type(acpi_table_type type)
397 /* Clear the appropriate "typed" global table pointer */ 394 /* Clear the appropriate "typed" global table pointer */
398 395
399 switch (type) { 396 switch (type) {
400 case ACPI_TABLE_RSDP: 397 case ACPI_TABLE_ID_RSDP:
401 acpi_gbl_RSDP = NULL; 398 acpi_gbl_RSDP = NULL;
402 break; 399 break;
403 400
404 case ACPI_TABLE_DSDT: 401 case ACPI_TABLE_ID_DSDT:
405 acpi_gbl_DSDT = NULL; 402 acpi_gbl_DSDT = NULL;
406 break; 403 break;
407 404
408 case ACPI_TABLE_FADT: 405 case ACPI_TABLE_ID_FADT:
409 acpi_gbl_FADT = NULL; 406 acpi_gbl_FADT = NULL;
410 break; 407 break;
411 408
412 case ACPI_TABLE_FACS: 409 case ACPI_TABLE_ID_FACS:
413 acpi_gbl_FACS = NULL; 410 acpi_gbl_FACS = NULL;
414 break; 411 break;
415 412
416 case ACPI_TABLE_XSDT: 413 case ACPI_TABLE_ID_XSDT:
417 acpi_gbl_XSDT = NULL; 414 acpi_gbl_XSDT = NULL;
418 break; 415 break;
419 416
420 case ACPI_TABLE_SSDT: 417 case ACPI_TABLE_ID_SSDT:
421 case ACPI_TABLE_PSDT: 418 case ACPI_TABLE_ID_PSDT:
422 default: 419 default:
423 break; 420 break;
424 } 421 }
@@ -504,7 +501,7 @@ struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc
504{ 501{
505 struct acpi_table_desc *next_desc; 502 struct acpi_table_desc *next_desc;
506 503
507 ACPI_FUNCTION_TRACE_PTR("tb_uninstall_table", table_desc); 504 ACPI_FUNCTION_TRACE_PTR(tb_uninstall_table, table_desc);
508 505
509 if (!table_desc) { 506 if (!table_desc) {
510 return_PTR(NULL); 507 return_PTR(NULL);