diff options
Diffstat (limited to 'drivers/acpi/tables/tbconvrt.c')
-rw-r--r-- | drivers/acpi/tables/tbconvrt.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c index 03b37d2223bc..d697fcb35d52 100644 --- a/drivers/acpi/tables/tbconvrt.c +++ b/drivers/acpi/tables/tbconvrt.c | |||
@@ -41,8 +41,6 @@ | |||
41 | * POSSIBILITY OF SUCH DAMAGES. | 41 | * POSSIBILITY OF SUCH DAMAGES. |
42 | */ | 42 | */ |
43 | 43 | ||
44 | #include <linux/module.h> | ||
45 | |||
46 | #include <acpi/acpi.h> | 44 | #include <acpi/acpi.h> |
47 | #include <acpi/actables.h> | 45 | #include <acpi/actables.h> |
48 | 46 | ||
@@ -56,15 +54,15 @@ acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct, | |||
56 | acpi_physical_address address); | 54 | acpi_physical_address address); |
57 | 55 | ||
58 | static void | 56 | static void |
59 | acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt, | 57 | acpi_tb_convert_fadt1(struct fadt_descriptor *local_fadt, |
60 | struct fadt_descriptor_rev1 *original_fadt); | 58 | struct fadt_descriptor_rev1 *original_fadt); |
61 | 59 | ||
62 | static void | 60 | static void |
63 | acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt, | 61 | acpi_tb_convert_fadt2(struct fadt_descriptor *local_fadt, |
64 | struct fadt_descriptor_rev2 *original_fadt); | 62 | struct fadt_descriptor *original_fadt); |
65 | 63 | ||
66 | u8 acpi_fadt_is_v1; | 64 | u8 acpi_fadt_is_v1; |
67 | EXPORT_SYMBOL(acpi_fadt_is_v1); | 65 | ACPI_EXPORT_SYMBOL(acpi_fadt_is_v1) |
68 | 66 | ||
69 | /******************************************************************************* | 67 | /******************************************************************************* |
70 | * | 68 | * |
@@ -122,7 +120,7 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info) | |||
122 | { | 120 | { |
123 | acpi_size table_size; | 121 | acpi_size table_size; |
124 | u32 i; | 122 | u32 i; |
125 | XSDT_DESCRIPTOR *new_table; | 123 | struct xsdt_descriptor *new_table; |
126 | 124 | ||
127 | ACPI_FUNCTION_ENTRY(); | 125 | ACPI_FUNCTION_ENTRY(); |
128 | 126 | ||
@@ -133,7 +131,7 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info) | |||
133 | 131 | ||
134 | /* Allocate an XSDT */ | 132 | /* Allocate an XSDT */ |
135 | 133 | ||
136 | new_table = ACPI_MEM_CALLOCATE(table_size); | 134 | new_table = ACPI_ALLOCATE_ZEROED(table_size); |
137 | if (!new_table) { | 135 | if (!new_table) { |
138 | return (AE_NO_MEMORY); | 136 | return (AE_NO_MEMORY); |
139 | } | 137 | } |
@@ -147,17 +145,18 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info) | |||
147 | /* Copy the table pointers */ | 145 | /* Copy the table pointers */ |
148 | 146 | ||
149 | for (i = 0; i < acpi_gbl_rsdt_table_count; i++) { | 147 | for (i = 0; i < acpi_gbl_rsdt_table_count; i++) { |
148 | |||
150 | /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */ | 149 | /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */ |
151 | 150 | ||
152 | if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { | 151 | if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { |
153 | ACPI_STORE_ADDRESS(new_table->table_offset_entry[i], | 152 | ACPI_STORE_ADDRESS(new_table->table_offset_entry[i], |
154 | (ACPI_CAST_PTR | 153 | (ACPI_CAST_PTR |
155 | (struct rsdt_descriptor_rev1, | 154 | (struct rsdt_descriptor, |
156 | table_info->pointer))-> | 155 | table_info->pointer))-> |
157 | table_offset_entry[i]); | 156 | table_offset_entry[i]); |
158 | } else { | 157 | } else { |
159 | new_table->table_offset_entry[i] = | 158 | new_table->table_offset_entry[i] = |
160 | (ACPI_CAST_PTR(XSDT_DESCRIPTOR, | 159 | (ACPI_CAST_PTR(struct xsdt_descriptor, |
161 | table_info->pointer))-> | 160 | table_info->pointer))-> |
162 | table_offset_entry[i]; | 161 | table_offset_entry[i]; |
163 | } | 162 | } |
@@ -219,7 +218,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct, | |||
219 | ******************************************************************************/ | 218 | ******************************************************************************/ |
220 | 219 | ||
221 | static void | 220 | static void |
222 | acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt, | 221 | acpi_tb_convert_fadt1(struct fadt_descriptor *local_fadt, |
223 | struct fadt_descriptor_rev1 *original_fadt) | 222 | struct fadt_descriptor_rev1 *original_fadt) |
224 | { | 223 | { |
225 | 224 | ||
@@ -365,14 +364,13 @@ acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt, | |||
365 | ******************************************************************************/ | 364 | ******************************************************************************/ |
366 | 365 | ||
367 | static void | 366 | static void |
368 | acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt, | 367 | acpi_tb_convert_fadt2(struct fadt_descriptor *local_fadt, |
369 | struct fadt_descriptor_rev2 *original_fadt) | 368 | struct fadt_descriptor *original_fadt) |
370 | { | 369 | { |
371 | 370 | ||
372 | /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ | 371 | /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ |
373 | 372 | ||
374 | ACPI_MEMCPY(local_fadt, original_fadt, | 373 | ACPI_MEMCPY(local_fadt, original_fadt, sizeof(struct fadt_descriptor)); |
375 | sizeof(struct fadt_descriptor_rev2)); | ||
376 | 374 | ||
377 | /* | 375 | /* |
378 | * "X" fields are optional extensions to the original V1.0 fields, so | 376 | * "X" fields are optional extensions to the original V1.0 fields, so |
@@ -491,10 +489,10 @@ acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt, | |||
491 | 489 | ||
492 | acpi_status acpi_tb_convert_table_fadt(void) | 490 | acpi_status acpi_tb_convert_table_fadt(void) |
493 | { | 491 | { |
494 | struct fadt_descriptor_rev2 *local_fadt; | 492 | struct fadt_descriptor *local_fadt; |
495 | struct acpi_table_desc *table_desc; | 493 | struct acpi_table_desc *table_desc; |
496 | 494 | ||
497 | ACPI_FUNCTION_TRACE("tb_convert_table_fadt"); | 495 | ACPI_FUNCTION_TRACE(tb_convert_table_fadt); |
498 | 496 | ||
499 | /* | 497 | /* |
500 | * acpi_gbl_FADT is valid. Validate the FADT length. The table must be | 498 | * acpi_gbl_FADT is valid. Validate the FADT length. The table must be |
@@ -508,13 +506,14 @@ acpi_status acpi_tb_convert_table_fadt(void) | |||
508 | 506 | ||
509 | /* Allocate buffer for the ACPI 2.0(+) FADT */ | 507 | /* Allocate buffer for the ACPI 2.0(+) FADT */ |
510 | 508 | ||
511 | local_fadt = ACPI_MEM_CALLOCATE(sizeof(struct fadt_descriptor_rev2)); | 509 | local_fadt = ACPI_ALLOCATE_ZEROED(sizeof(struct fadt_descriptor)); |
512 | if (!local_fadt) { | 510 | if (!local_fadt) { |
513 | return_ACPI_STATUS(AE_NO_MEMORY); | 511 | return_ACPI_STATUS(AE_NO_MEMORY); |
514 | } | 512 | } |
515 | 513 | ||
516 | if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) { | 514 | if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) { |
517 | if (acpi_gbl_FADT->length < sizeof(struct fadt_descriptor_rev2)) { | 515 | if (acpi_gbl_FADT->length < sizeof(struct fadt_descriptor)) { |
516 | |||
518 | /* Length is too short to be a V2.0 table */ | 517 | /* Length is too short to be a V2.0 table */ |
519 | 518 | ||
520 | ACPI_WARNING((AE_INFO, | 519 | ACPI_WARNING((AE_INFO, |
@@ -538,11 +537,11 @@ acpi_status acpi_tb_convert_table_fadt(void) | |||
538 | /* Global FADT pointer will point to the new common V2.0 FADT */ | 537 | /* Global FADT pointer will point to the new common V2.0 FADT */ |
539 | 538 | ||
540 | acpi_gbl_FADT = local_fadt; | 539 | acpi_gbl_FADT = local_fadt; |
541 | acpi_gbl_FADT->length = sizeof(FADT_DESCRIPTOR); | 540 | acpi_gbl_FADT->length = sizeof(struct fadt_descriptor); |
542 | 541 | ||
543 | /* Free the original table */ | 542 | /* Free the original table */ |
544 | 543 | ||
545 | table_desc = acpi_gbl_table_lists[ACPI_TABLE_FADT].next; | 544 | table_desc = acpi_gbl_table_lists[ACPI_TABLE_ID_FADT].next; |
546 | acpi_tb_delete_single_table(table_desc); | 545 | acpi_tb_delete_single_table(table_desc); |
547 | 546 | ||
548 | /* Install the new table */ | 547 | /* Install the new table */ |
@@ -550,7 +549,7 @@ acpi_status acpi_tb_convert_table_fadt(void) | |||
550 | table_desc->pointer = | 549 | table_desc->pointer = |
551 | ACPI_CAST_PTR(struct acpi_table_header, acpi_gbl_FADT); | 550 | ACPI_CAST_PTR(struct acpi_table_header, acpi_gbl_FADT); |
552 | table_desc->allocation = ACPI_MEM_ALLOCATED; | 551 | table_desc->allocation = ACPI_MEM_ALLOCATED; |
553 | table_desc->length = sizeof(struct fadt_descriptor_rev2); | 552 | table_desc->length = sizeof(struct fadt_descriptor); |
554 | 553 | ||
555 | /* Dump the entire FADT */ | 554 | /* Dump the entire FADT */ |
556 | 555 | ||
@@ -580,7 +579,7 @@ acpi_status acpi_tb_convert_table_fadt(void) | |||
580 | acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info) | 579 | acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info) |
581 | { | 580 | { |
582 | 581 | ||
583 | ACPI_FUNCTION_TRACE("tb_build_common_facs"); | 582 | ACPI_FUNCTION_TRACE(tb_build_common_facs); |
584 | 583 | ||
585 | /* Absolute minimum length is 24, but the ACPI spec says 64 */ | 584 | /* Absolute minimum length is 24, but the ACPI spec says 64 */ |
586 | 585 | ||
@@ -603,6 +602,7 @@ acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info) | |||
603 | if ((acpi_gbl_RSDP->revision < 2) || | 602 | if ((acpi_gbl_RSDP->revision < 2) || |
604 | (acpi_gbl_FACS->length < 32) || | 603 | (acpi_gbl_FACS->length < 32) || |
605 | (!(acpi_gbl_FACS->xfirmware_waking_vector))) { | 604 | (!(acpi_gbl_FACS->xfirmware_waking_vector))) { |
605 | |||
606 | /* ACPI 1.0 FACS or short table or optional X_ field is zero */ | 606 | /* ACPI 1.0 FACS or short table or optional X_ field is zero */ |
607 | 607 | ||
608 | acpi_gbl_common_fACS.firmware_waking_vector = ACPI_CAST_PTR(u64, | 608 | acpi_gbl_common_fACS.firmware_waking_vector = ACPI_CAST_PTR(u64, |