Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62493
b: refs/heads/master
c: 55f8f3c
h: refs/heads/master
i:
  62491: ddd5061
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Jul 3, 2007
1 parent 16689d5 commit 54437ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 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: e0b91050f208ab370fac9269f8e42bc746889422
refs/heads/master: 55f8f3cc4f7c47c7896e2ad08e29eccc292c0c68
44 changes: 26 additions & 18 deletions trunk/drivers/acpi/tables/tbfadt.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,17 @@ void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
* DESCRIPTION: Get a local copy of the FADT and convert it to a common format.
* Performs validation on some important FADT fields.
*
* NOTE: We create a local copy of the FADT regardless of the version.
*
******************************************************************************/

void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{

/*
* Check if the FADT is larger than what we know about (ACPI 2.0 version).
* Truncate the table, but make some noise.
* Check if the FADT is larger than the largest table that we expect
* (the ACPI 2.0/3.0 version). If so, truncate the table, and issue
* a warning.
*/
if (length > sizeof(struct acpi_table_fadt)) {
ACPI_WARNING((AE_INFO,
Expand All @@ -227,10 +230,12 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
sizeof(struct acpi_table_fadt)));
}

/* Copy the entire FADT locally. Zero first for tb_convert_fadt */
/* Clear the entire local FADT */

ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));

/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */

ACPI_MEMCPY(&acpi_gbl_FADT, table,
ACPI_MIN(length, sizeof(struct acpi_table_fadt)));

Expand All @@ -251,7 +256,7 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
* RETURN: None
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
* -> Expand all 32-bit addresses to 64-bit.
* Expand all 32-bit addresses to 64-bit.
*
* NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt),
* and must contain a copy of the actual FADT.
Expand Down Expand Up @@ -292,8 +297,23 @@ static void acpi_tb_convert_fadt(void)
}

/*
* Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address
* structures as necessary.
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
*
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
* offset 45, 55, 95, and the word located at offset 109, 110.
*/
if (acpi_gbl_FADT.header.revision < 3) {
acpi_gbl_FADT.preferred_profile = 0;
acpi_gbl_FADT.pstate_control = 0;
acpi_gbl_FADT.cst_control = 0;
acpi_gbl_FADT.boot_flags = 0;
}

/*
* Expand the ACPI 1.0 32-bit V1.0 addresses to the ACPI 2.0 64-bit "X"
* generic address structures as necessary.
*/
for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
target =
Expand Down Expand Up @@ -349,18 +369,6 @@ static void acpi_tb_convert_fadt(void)
acpi_gbl_FADT.xpm1a_event_block.space_id;

}

/*
* For ACPI 1.0 FADTs, ensure that reserved fields (which should be zero)
* are indeed zero. This will workaround BIOSs that inadvertently placed
* values in these fields.
*/
if (acpi_gbl_FADT.header.revision < 3) {
acpi_gbl_FADT.preferred_profile = 0;
acpi_gbl_FADT.pstate_control = 0;
acpi_gbl_FADT.cst_control = 0;
acpi_gbl_FADT.boot_flags = 0;
}
}

/******************************************************************************
Expand Down

0 comments on commit 54437ff

Please sign in to comment.