提交 3b3ea775 编写于 作者: B Bob Moore 提交者: Len Brown

ACPICA: Table manager: deploy new firmware error/warning interfaces

Emit firmware error/warning messages where appropriate for table
and FADT errors.
Signed-off-by: NBob Moore <robert.moore@intel.com>
Signed-off-by: NLin Ming <ming.m.lin@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 62cdd141
...@@ -303,11 +303,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) ...@@ -303,11 +303,11 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
* a warning. * a warning.
*/ */
if (length > sizeof(struct acpi_table_fadt)) { if (length > sizeof(struct acpi_table_fadt)) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"FADT (revision %u) is longer than ACPI 5.0 version, " "FADT (revision %u) is longer than ACPI 5.0 version, "
"truncating length %u to %u", "truncating length %u to %u",
table->revision, length, table->revision, length,
(u32)sizeof(struct acpi_table_fadt))); (u32)sizeof(struct acpi_table_fadt)));
} }
/* Clear the entire local FADT */ /* Clear the entire local FADT */
...@@ -452,11 +452,13 @@ static void acpi_tb_convert_fadt(void) ...@@ -452,11 +452,13 @@ static void acpi_tb_convert_fadt(void)
* they must match. * they must match.
*/ */
if (address64->address && address32 && if (address64->address && address32 &&
(address64->address != (u64) address32)) { (address64->address != (u64)address32)) {
ACPI_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", "32/64X address mismatch in FADT/%s: "
fadt_info_table[i].name, address32, "0x%8.8X/0x%8.8X%8.8X, using 32",
ACPI_FORMAT_UINT64(address64->address))); fadt_info_table[i].name, address32,
ACPI_FORMAT_UINT64(address64->
address)));
} }
/* Always use 32-bit address if it is valid (non-null) */ /* Always use 32-bit address if it is valid (non-null) */
...@@ -511,25 +513,25 @@ static void acpi_tb_validate_fadt(void) ...@@ -511,25 +513,25 @@ static void acpi_tb_validate_fadt(void)
* DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
*/ */
if (acpi_gbl_FADT.facs && if (acpi_gbl_FADT.facs &&
(acpi_gbl_FADT.Xfacs != (u64) acpi_gbl_FADT.facs)) { (acpi_gbl_FADT.Xfacs != (u64)acpi_gbl_FADT.facs)) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"32/64X FACS address mismatch in FADT - " "32/64X FACS address mismatch in FADT - "
"0x%8.8X/0x%8.8X%8.8X, using 32", "0x%8.8X/0x%8.8X%8.8X, using 32",
acpi_gbl_FADT.facs, acpi_gbl_FADT.facs,
ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs))); ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xfacs)));
acpi_gbl_FADT.Xfacs = (u64) acpi_gbl_FADT.facs; acpi_gbl_FADT.Xfacs = (u64)acpi_gbl_FADT.facs;
} }
if (acpi_gbl_FADT.dsdt && if (acpi_gbl_FADT.dsdt &&
(acpi_gbl_FADT.Xdsdt != (u64) acpi_gbl_FADT.dsdt)) { (acpi_gbl_FADT.Xdsdt != (u64)acpi_gbl_FADT.dsdt)) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"32/64X DSDT address mismatch in FADT - " "32/64X DSDT address mismatch in FADT - "
"0x%8.8X/0x%8.8X%8.8X, using 32", "0x%8.8X/0x%8.8X%8.8X, using 32",
acpi_gbl_FADT.dsdt, acpi_gbl_FADT.dsdt,
ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt)));
acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; acpi_gbl_FADT.Xdsdt = (u64)acpi_gbl_FADT.dsdt;
} }
/* If Hardware Reduced flag is set, we are all done */ /* If Hardware Reduced flag is set, we are all done */
...@@ -559,10 +561,10 @@ static void acpi_tb_validate_fadt(void) ...@@ -559,10 +561,10 @@ static void acpi_tb_validate_fadt(void)
*/ */
if (address64->address && if (address64->address &&
(address64->bit_width != ACPI_MUL_8(length))) { (address64->bit_width != ACPI_MUL_8(length))) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"32/64X length mismatch in %s: %u/%u", "32/64X length mismatch in FADT/%s: %u/%u",
name, ACPI_MUL_8(length), name, ACPI_MUL_8(length),
address64->bit_width)); address64->bit_width));
} }
if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) { if (fadt_info_table[i].type & ACPI_FADT_REQUIRED) {
...@@ -571,13 +573,13 @@ static void acpi_tb_validate_fadt(void) ...@@ -571,13 +573,13 @@ static void acpi_tb_validate_fadt(void)
* Both the address and length must be non-zero. * Both the address and length must be non-zero.
*/ */
if (!address64->address || !length) { if (!address64->address || !length) {
ACPI_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"Required field %s has zero address and/or length:" "Required FADT field %s has zero address and/or length: "
" 0x%8.8X%8.8X/0x%X", "0x%8.8X%8.8X/0x%X",
name, name,
ACPI_FORMAT_UINT64(address64-> ACPI_FORMAT_UINT64(address64->
address), address),
length)); length));
} }
} else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) { } else if (fadt_info_table[i].type & ACPI_FADT_SEPARATE_LENGTH) {
/* /*
...@@ -587,13 +589,13 @@ static void acpi_tb_validate_fadt(void) ...@@ -587,13 +589,13 @@ static void acpi_tb_validate_fadt(void)
*/ */
if ((address64->address && !length) || if ((address64->address && !length) ||
(!address64->address && length)) { (!address64->address && length)) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"Optional field %s has zero address or length: " "Optional FADT field %s has zero address or length: "
"0x%8.8X%8.8X/0x%X", "0x%8.8X%8.8X/0x%X",
name, name,
ACPI_FORMAT_UINT64(address64-> ACPI_FORMAT_UINT64
address), (address64->address),
length)); length));
} }
} }
} }
...@@ -638,12 +640,12 @@ static void acpi_tb_setup_fadt_registers(void) ...@@ -638,12 +640,12 @@ static void acpi_tb_setup_fadt_registers(void)
(fadt_info_table[i].default_length > 0) && (fadt_info_table[i].default_length > 0) &&
(fadt_info_table[i].default_length != (fadt_info_table[i].default_length !=
target64->bit_width)) { target64->bit_width)) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"Invalid length for %s: %u, using default %u", "Invalid length for FADT/%s: %u, using default %u",
fadt_info_table[i].name, fadt_info_table[i].name,
target64->bit_width, target64->bit_width,
fadt_info_table[i]. fadt_info_table[i].
default_length)); default_length));
/* Incorrect size, set width to the default */ /* Incorrect size, set width to the default */
......
...@@ -138,13 +138,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) ...@@ -138,13 +138,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
if ((table_desc->pointer->signature[0] != 0x00) && if ((table_desc->pointer->signature[0] != 0x00) &&
(!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)) (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
&& (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) { && (ACPI_STRNCMP(table_desc->pointer->signature, "OEM", 3))) {
ACPI_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", "Table has invalid signature [%4.4s] (0x%8.8X), "
acpi_ut_valid_acpi_name(*(u32 *)table_desc-> "must be SSDT or OEMx",
pointer-> acpi_ut_valid_acpi_name(*(u32 *)table_desc->
signature) ? table_desc-> pointer->
pointer->signature : "????", signature) ?
*(u32 *)table_desc->pointer->signature)); table_desc->pointer->signature : "????",
*(u32 *)table_desc->pointer->signature));
return_ACPI_STATUS(AE_BAD_SIGNATURE); return_ACPI_STATUS(AE_BAD_SIGNATURE);
} }
......
...@@ -317,10 +317,11 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) ...@@ -317,10 +317,11 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length)
/* Checksum ok? (should be zero) */ /* Checksum ok? (should be zero) */
if (checksum) { if (checksum) {
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
table->signature, table->checksum, "should be 0x%2.2X",
(u8) (table->checksum - checksum))); table->signature, table->checksum,
(u8)(table->checksum - checksum)));
#if (ACPI_CHECKSUM_ABORT) #if (ACPI_CHECKSUM_ABORT)
...@@ -377,8 +378,9 @@ void acpi_tb_check_dsdt_header(void) ...@@ -377,8 +378,9 @@ void acpi_tb_check_dsdt_header(void)
if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length || if (acpi_gbl_original_dsdt_header.length != acpi_gbl_DSDT->length ||
acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) { acpi_gbl_original_dsdt_header.checksum != acpi_gbl_DSDT->checksum) {
ACPI_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"The DSDT has been corrupted or replaced - old, new headers below")); "The DSDT has been corrupted or replaced - "
"old, new headers below"));
acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
acpi_tb_print_table_header(0, acpi_gbl_DSDT); acpi_tb_print_table_header(0, acpi_gbl_DSDT);
...@@ -480,9 +482,10 @@ acpi_tb_install_table(acpi_physical_address address, ...@@ -480,9 +482,10 @@ acpi_tb_install_table(acpi_physical_address address,
/* If a particular signature is expected (DSDT/FACS), it must match */ /* If a particular signature is expected (DSDT/FACS), it must match */
if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) {
ACPI_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"Invalid signature 0x%X for ACPI table, expected [%s]", "Invalid signature 0x%X for ACPI table, expected [%s]",
*ACPI_CAST_PTR(u32, table->signature), signature)); *ACPI_CAST_PTR(u32, table->signature),
signature));
goto unmap_and_exit; goto unmap_and_exit;
} }
...@@ -589,10 +592,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) ...@@ -589,10 +592,10 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
/* Will truncate 64-bit address to 32 bits, issue warning */ /* Will truncate 64-bit address to 32 bits, issue warning */
ACPI_WARNING((AE_INFO, ACPI_BIOS_WARNING((AE_INFO,
"64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X),"
" truncating", " truncating",
ACPI_FORMAT_UINT64(address64))); ACPI_FORMAT_UINT64(address64)));
} }
#endif #endif
return ((acpi_physical_address) (address64)); return ((acpi_physical_address) (address64));
...@@ -694,8 +697,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ...@@ -694,8 +697,9 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
if (length < sizeof(struct acpi_table_header)) { if (length < sizeof(struct acpi_table_header)) {
ACPI_ERROR((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", ACPI_BIOS_ERROR((AE_INFO,
length)); "Invalid table length 0x%X in RSDT/XSDT",
length));
return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
} }
......
...@@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address) ...@@ -216,7 +216,7 @@ acpi_status acpi_find_root_pointer(acpi_size *table_address)
/* A valid RSDP was not found */ /* A valid RSDP was not found */
ACPI_ERROR((AE_INFO, "A valid RSDP was not found")); ACPI_BIOS_ERROR((AE_INFO, "A valid RSDP was not found"));
return_ACPI_STATUS(AE_NOT_FOUND); return_ACPI_STATUS(AE_NOT_FOUND);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册