X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Ftables%2Ftbconvrt.c;h=334327c1f66f5b965ca1c4528881a3b3d3cea2b0;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=ee68188326652d6642bd13ca00d80a57df7d705f;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c index ee6818832..334327c1f 100644 --- a/drivers/acpi/tables/tbconvrt.c +++ b/drivers/acpi/tables/tbconvrt.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#include #include #include @@ -50,6 +51,9 @@ ACPI_MODULE_NAME ("tbconvrt") +u8 acpi_fadt_is_v1; +EXPORT_SYMBOL(acpi_fadt_is_v1); + /******************************************************************************* * * FUNCTION: acpi_tb_get_table_count @@ -186,7 +190,7 @@ acpi_tb_init_generic_address ( new_gas_struct->address_space_id = ACPI_ADR_SPACE_SYSTEM_IO; new_gas_struct->register_bit_width = register_bit_width; new_gas_struct->register_bit_offset = 0; - new_gas_struct->reserved = 0; + new_gas_struct->access_width = 0; } @@ -212,6 +216,7 @@ acpi_tb_convert_fadt1 ( /* ACPI 1.0 FACS */ /* The BIOS stored FADT should agree with Revision 1.0 */ + acpi_fadt_is_v1 = 1; /* * Copy the table header and the common part of the tables. @@ -240,9 +245,12 @@ acpi_tb_convert_fadt1 ( /* * Processor Performance State Control. This is the value OSPM writes to * the SMI_CMD register to assume processor performance state control - * responsibility. There isn't any equivalence in 1.0, leave it zeroed. + * responsibility. There isn't any equivalence in 1.0, but as many 1.x + * ACPI tables contain _PCT and _PSS we also keep this value, unless + * acpi_strict is set. */ - local_fadt->pstate_cnt = 0; + if (acpi_strict) + local_fadt->pstate_cnt = 0; /* * Support for the _CST object and C States change notification. @@ -251,10 +259,26 @@ acpi_tb_convert_fadt1 ( local_fadt->cst_cnt = 0; /* - * Since there isn't any equivalence in 1.0 and since it highly likely - * that a 1.0 system has legacy support. + * FADT Rev 2 was an interim FADT released between ACPI 1.0 and ACPI 2.0. + * It primarily adds the FADT reset mechanism. */ - local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES; + if ((original_fadt->revision == 2) && + (original_fadt->length == sizeof (struct fadt_descriptor_rev2_minus))) { + /* + * Grab the entire generic address struct, plus the 1-byte reset value + * that immediately follows. + */ + ACPI_MEMCPY (&local_fadt->reset_register, + &(ACPI_CAST_PTR (struct fadt_descriptor_rev2_minus, original_fadt))->reset_register, + sizeof (struct acpi_generic_address) + 1); + } + else { + /* + * Since there isn't any equivalence in 1.0 and since it is highly + * likely that a 1.0 system has legacy support. + */ + local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES; + } /* * Convert the V1.0 block addresses to V2.0 GAS structures @@ -418,23 +442,21 @@ acpi_tb_convert_table_fadt (void) /* - * acpi_gbl_FADT is valid - * Allocate and zero the 2.0 FADT buffer - */ - local_fadt = ACPI_MEM_CALLOCATE (sizeof (struct fadt_descriptor_rev2)); - if (local_fadt == NULL) { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* - * FADT length and version validation. The table must be at least as - * long as the version 1.0 FADT + * acpi_gbl_FADT is valid. Validate the FADT length. The table must be + * at least as long as the version 1.0 FADT */ if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev1)) { - ACPI_REPORT_ERROR (("Invalid FADT table length: 0x%X\n", acpi_gbl_FADT->length)); + ACPI_REPORT_ERROR (("FADT is invalid, too short: 0x%X\n", acpi_gbl_FADT->length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } + /* Allocate buffer for the ACPI 2.0(+) FADT */ + + local_fadt = ACPI_MEM_CALLOCATE (sizeof (struct fadt_descriptor_rev2)); + if (!local_fadt) { + return_ACPI_STATUS (AE_NO_MEMORY); + } + if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) { if (acpi_gbl_FADT->length < sizeof (struct fadt_descriptor_rev2)) { /* Length is too short to be a V2.0 table */ @@ -488,7 +510,7 @@ acpi_tb_convert_table_fadt (void) * * FUNCTION: acpi_tb_convert_table_facs * - * PARAMETERS: table_info - Info for currently installad FACS + * PARAMETERS: table_info - Info for currently installed FACS * * RETURN: Status *