]> err.no Git - linux-2.6/commitdiff
ACPICA: Fail AcpiEnable if ACPI tables not loaded.
authorBob Moore <robert.moore@intel.com>
Fri, 2 Feb 2007 16:48:23 +0000 (19:48 +0300)
committerLen Brown <len.brown@intel.com>
Sat, 3 Feb 2007 02:14:30 +0000 (21:14 -0500)
AcpiEnable will now fail if all of the required ACPI tables are not
loaded (FADT, FACS, DSDT). BZ 477

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/events/evxfevnt.c
drivers/acpi/tables/tbutils.c
include/acpi/actables.h

index a3d148e4d39f381a2625ade191fd276eae54d107..4eab4f5a10044399652118595ad5f91cc3b5a7c8 100644 (file)
@@ -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"));
index 0cb743962fafe8db48bd200a4e3cee8452ecbba4..0874ab2997845d678e4cdba7004222158c74b9f3 100644 (file)
@@ -52,6 +52,29 @@ static acpi_physical_address
 acpi_tb_get_root_table_entry(u8 * table_entry,
                             acpi_native_uint table_entry_size);
 
+/*******************************************************************************
+ *
+ * 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
index 5ef1b6939370470037c1c1ad0988b0f42bfe63d2..e7efb8a03a9ce57f432946fd863f50b4c90b21f0 100644 (file)
@@ -97,6 +97,8 @@ void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded);
 /*
  * 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);