diff options
author | Bob Moore <robert.moore@intel.com> | 2007-02-02 11:48:23 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-02 21:14:30 -0500 |
commit | c857303ad496e1f52955e95994a67869882e89f9 (patch) | |
tree | f08011d43627bc7fc401253b5f8446bab708d87d | |
parent | 987c21a0b0081d480ec3cd04875509cdc10e15e7 (diff) |
ACPICA: Fail AcpiEnable if ACPI tables not loaded.
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>
-rw-r--r-- | drivers/acpi/events/evxfevnt.c | 8 | ||||
-rw-r--r-- | drivers/acpi/tables/tbutils.c | 23 | ||||
-rw-r--r-- | 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 a3d148e4d39f..4eab4f5a1004 100644 --- a/drivers/acpi/events/evxfevnt.c +++ b/drivers/acpi/events/evxfevnt.c | |||
@@ -65,6 +65,14 @@ acpi_status acpi_enable(void) | |||
65 | 65 | ||
66 | ACPI_FUNCTION_TRACE(acpi_enable); | 66 | ACPI_FUNCTION_TRACE(acpi_enable); |
67 | 67 | ||
68 | /* ACPI tables must be present */ | ||
69 | |||
70 | if (!acpi_tb_tables_loaded()) { | ||
71 | return_ACPI_STATUS(AE_NO_ACPI_TABLES); | ||
72 | } | ||
73 | |||
74 | /* Check current mode */ | ||
75 | |||
68 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { | 76 | if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) { |
69 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 77 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, |
70 | "System is already in ACPI mode\n")); | 78 | "System is already in ACPI mode\n")); |
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index 0cb743962faf..0874ab299784 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_entry, | |||
54 | 54 | ||
55 | /******************************************************************************* | 55 | /******************************************************************************* |
56 | * | 56 | * |
57 | * FUNCTION: acpi_tb_tables_loaded | ||
58 | * | ||
59 | * PARAMETERS: None | ||
60 | * | ||
61 | * RETURN: TRUE if required ACPI tables are loaded | ||
62 | * | ||
63 | * DESCRIPTION: Determine if the minimum required ACPI tables are present | ||
64 | * (FADT, FACS, DSDT) | ||
65 | * | ||
66 | ******************************************************************************/ | ||
67 | |||
68 | u8 acpi_tb_tables_loaded(void) | ||
69 | { | ||
70 | |||
71 | if (acpi_gbl_root_table_list.count >= 3) { | ||
72 | return (TRUE); | ||
73 | } | ||
74 | |||
75 | return (FALSE); | ||
76 | } | ||
77 | |||
78 | /******************************************************************************* | ||
79 | * | ||
57 | * FUNCTION: acpi_tb_print_table_header | 80 | * FUNCTION: acpi_tb_print_table_header |
58 | * | 81 | * |
59 | * PARAMETERS: Address - Table physical address | 82 | * PARAMETERS: Address - Table physical address |
diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 5ef1b6939370..e7efb8a03a9c 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h | |||
@@ -97,6 +97,8 @@ void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded); | |||
97 | /* | 97 | /* |
98 | * tbutils - table manager utilities | 98 | * tbutils - table manager utilities |
99 | */ | 99 | */ |
100 | u8 acpi_tb_tables_loaded(void); | ||
101 | |||
100 | void | 102 | void |
101 | acpi_tb_print_table_header(acpi_physical_address address, | 103 | acpi_tb_print_table_header(acpi_physical_address address, |
102 | struct acpi_table_header *header); | 104 | struct acpi_table_header *header); |