summaryrefslogtreecommitdiffstats
path: root/tools/power/acpi/os_specific
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-04-30 10:05:48 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-07 00:55:02 +0200
commitc79322677d95c7cab65e02828677b43d8656eb61 (patch)
tree1e9beedc40d76f21884a82f927fa2fb2707b38d0 /tools/power/acpi/os_specific
parentfea79bc01cb184432309148af9bf53a961a4d920 (diff)
downloadlinux-c79322677d95c7cab65e02828677b43d8656eb61.tar.bz2
ACPICA: acpidump: Add support to force using RSDT.
This patch adds "-x" and "-x -x" options to disable XSDT for acpidump. The single "-x" can be used to stop using XSDT, RSDT will be forced to find static tables, note that XSDT will still be dumped. The double "-x" can stop dumping XSDT, which is useful when the XSDT address reported by RSDP is pointing to an invalid address. It is reported there are platforms having broken XSDT shipped, acpidump will stop working while accessing such XSDT. This patch adds new option so that users can force acpidump to dump tables listed in the RSDT. Lv Zheng. Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911 Buglink: https://bugs.archlinux.org/task/39811 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com> Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power/acpi/os_specific')
-rw-r--r--tools/power/acpi/os_specific/service_layers/oslinuxtbl.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index a8cd344d621b..e0699e6e1f26 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -505,6 +505,28 @@ static acpi_status osl_load_rsdp(void)
/******************************************************************************
*
+ * FUNCTION: osl_can_use_xsdt
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if XSDT is allowed to be used.
+ *
+ * DESCRIPTION: This function collects logic that can be used to determine if
+ * XSDT should be used instead of RSDT.
+ *
+ *****************************************************************************/
+
+static u8 osl_can_use_xsdt(void)
+{
+ if (gbl_revision && !acpi_gbl_do_not_use_xsdt) {
+ return (TRUE);
+ } else {
+ return (FALSE);
+ }
+}
+
+/******************************************************************************
+ *
* FUNCTION: osl_table_initialize
*
* PARAMETERS: None
@@ -535,7 +557,7 @@ static acpi_status osl_table_initialize(void)
/* Get XSDT from memory */
- if (gbl_rsdp.revision) {
+ if (gbl_rsdp.revision && !gbl_do_not_dump_xsdt) {
if (gbl_xsdt) {
free(gbl_xsdt);
gbl_xsdt = NULL;
@@ -668,7 +690,7 @@ static acpi_status osl_list_bios_tables(void)
acpi_status status = AE_OK;
u32 i;
- if (gbl_revision) {
+ if (osl_can_use_xsdt()) {
item_size = sizeof(u64);
table_data =
ACPI_CAST8(gbl_xsdt) + sizeof(struct acpi_table_header);
@@ -690,7 +712,7 @@ static acpi_status osl_list_bios_tables(void)
/* Search RSDT/XSDT for the requested table */
for (i = 0; i < number_of_tables; ++i, table_data += item_size) {
- if (gbl_revision) {
+ if (osl_can_use_xsdt()) {
table_address =
(acpi_physical_address) (*ACPI_CAST64(table_data));
} else {
@@ -809,7 +831,7 @@ osl_get_bios_table(char *signature,
table_length = ap_get_table_length(mapped_table);
} else { /* Case for a normal ACPI table */
- if (gbl_revision) {
+ if (osl_can_use_xsdt()) {
item_size = sizeof(u64);
table_data =
ACPI_CAST8(gbl_xsdt) +
@@ -833,7 +855,7 @@ osl_get_bios_table(char *signature,
/* Search RSDT/XSDT for the requested table */
for (i = 0; i < number_of_tables; ++i, table_data += item_size) {
- if (gbl_revision) {
+ if (osl_can_use_xsdt()) {
table_address =
(acpi_physical_address) (*ACPI_CAST64
(table_data));