aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/actables.h2
-rw-r--r--drivers/acpi/acpica/tbxfroot.c33
-rw-r--r--tools/power/acpi/tools/acpidump/apdump.c2
3 files changed, 35 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index f14882788eee..1afe46e44dac 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -49,6 +49,8 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count);
49/* 49/*
50 * tbxfroot - Root pointer utilities 50 * tbxfroot - Root pointer utilities
51 */ 51 */
52u32 acpi_tb_get_rsdp_length(struct acpi_table_rsdp *rsdp);
53
52acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp); 54acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp);
53 55
54u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length); 56u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 65ab8fed3d5e..43a54af2b548 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -50,6 +50,36 @@ ACPI_MODULE_NAME("tbxfroot")
50 50
51/******************************************************************************* 51/*******************************************************************************
52 * 52 *
53 * FUNCTION: acpi_tb_get_rsdp_length
54 *
55 * PARAMETERS: rsdp - Pointer to RSDP
56 *
57 * RETURN: Table length
58 *
59 * DESCRIPTION: Get the length of the RSDP
60 *
61 ******************************************************************************/
62u32 acpi_tb_get_rsdp_length(struct acpi_table_rsdp *rsdp)
63{
64
65 if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) {
66
67 /* BAD Signature */
68
69 return (0);
70 }
71
72 /* "Length" field is available if table version >= 2 */
73
74 if (rsdp->revision >= 2) {
75 return (rsdp->length);
76 } else {
77 return (ACPI_RSDP_CHECKSUM_LENGTH);
78 }
79}
80
81/*******************************************************************************
82 *
53 * FUNCTION: acpi_tb_validate_rsdp 83 * FUNCTION: acpi_tb_validate_rsdp
54 * 84 *
55 * PARAMETERS: rsdp - Pointer to unvalidated RSDP 85 * PARAMETERS: rsdp - Pointer to unvalidated RSDP
@@ -59,7 +89,8 @@ ACPI_MODULE_NAME("tbxfroot")
59 * DESCRIPTION: Validate the RSDP (ptr) 89 * DESCRIPTION: Validate the RSDP (ptr)
60 * 90 *
61 ******************************************************************************/ 91 ******************************************************************************/
62acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) 92
93acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp)
63{ 94{
64 95
65 /* 96 /*
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index 53cee781e24e..24d32968802d 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -146,7 +146,7 @@ u32 ap_get_table_length(struct acpi_table_header *table)
146 146
147 if (ACPI_VALIDATE_RSDP_SIG(table->signature)) { 147 if (ACPI_VALIDATE_RSDP_SIG(table->signature)) {
148 rsdp = ACPI_CAST_PTR(struct acpi_table_rsdp, table); 148 rsdp = ACPI_CAST_PTR(struct acpi_table_rsdp, table);
149 return (rsdp->length); 149 return (acpi_tb_get_rsdp_length(rsdp));
150 } 150 }
151 151
152 /* Normal ACPI table */ 152 /* Normal ACPI table */