From fdbad6e3a27eb5b8aca9cfa765748e7b9d0d860d Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com> References: <410c2f0190f74c35505beda6ff3f2da7819f8bac.1164352285.git.len.brown@intel.com> From: Robert Moore Date: Tue, 14 Nov 2006 20:10:23 +0300 Subject: [PATCH 63/65] ACPICA: Fail AcpiEnable if ACPI tables not loaded. Reply-To: Len Brown Organization: Intel Open Source Technology Center AcpiEnable will now fail if all of the required ACPI tables are not loaded (FADT, FACS, DSDT). BZ 477 Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/events/evxfevnt.c | 8 ++++++++ drivers/acpi/tables/tbutils.c | 23 +++++++++++++++++++++++ include/acpi/actables.h | 2 ++ 3 files changed, 33 insertions(+), 0 deletions(-) diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c index a3d148e..4eab4f5 100644 --- a/drivers/acpi/events/evxfevnt.c +++ b/drivers/acpi/events/evxfevnt.c @@ -65,6 +65,14 @@ acpi_status acpi_enable(void) ACPI_FUNCTION_TRACE(acpi_enable); + /* ACPI tables must be present */ + + if (!acpi_tb_tables_loaded()) { + return_ACPI_STATUS(AE_NO_ACPI_TABLES); + } + + /* Check current mode */ + if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { ACPI_DEBUG_PRINT((ACPI_DB_INIT, "System is already in ACPI mode\n")); diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index a456e6c..d191920 100644 --- a/drivers/acpi/tables/tbutils.c +++ b/drivers/acpi/tables/tbutils.c @@ -54,6 +54,29 @@ acpi_tb_get_root_table_entry(u8 * table_ /******************************************************************************* * + * FUNCTION: acpi_tb_tables_loaded + * + * PARAMETERS: None + * + * RETURN: TRUE if required ACPI tables are loaded + * + * DESCRIPTION: Determine if the minimum required ACPI tables are present + * (FADT, FACS, DSDT) + * + ******************************************************************************/ + +u8 acpi_tb_tables_loaded(void) +{ + + if (acpi_gbl_root_table_list.count >= 3) { + return (TRUE); + } + + return (FALSE); +} + +/******************************************************************************* + * * FUNCTION: acpi_tb_print_table_header * * PARAMETERS: Address - Table physical address diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 5ef1b69..e7efb8a 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h @@ -97,6 +97,8 @@ void acpi_tb_set_table_loaded_flag(acpi_ /* * tbutils - table manager utilities */ +u8 acpi_tb_tables_loaded(void); + void acpi_tb_print_table_header(acpi_physical_address address, struct acpi_table_header *header); -- 1.4.4.1