ACPICA: Implement simplified Table Manager

The Table Manager component has been completely
redesigned and reimplemented. The new design is much
simpler, and reduces the overall code and data size of
the kernel-resident ACPICA by approximately 5%. Also,
it is now possible to obtain the ACPI tables very early
during kernel initialization, even before dynamic memory
management is initialized.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
diff --git a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c
index de50fab..14e8111 100644
--- a/drivers/acpi/hardware/hwacpi.c
+++ b/drivers/acpi/hardware/hwacpi.c
@@ -65,13 +65,6 @@
 
 	ACPI_FUNCTION_TRACE(hw_initialize);
 
-	/* We must have the ACPI tables by the time we get here */
-
-	if (!acpi_gbl_FADT) {
-		ACPI_ERROR((AE_INFO, "No FADT is present"));
-		return_ACPI_STATUS(AE_NO_ACPI_TABLES);
-	}
-
 	/* Sanity check the FADT for valid values */
 
 	status = acpi_ut_validate_fadt();
@@ -106,7 +99,7 @@
 	 * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
 	 * system does not support mode transition.
 	 */
-	if (!acpi_gbl_FADT->smi_cmd) {
+	if (!acpi_gbl_FADT.smi_command) {
 		ACPI_ERROR((AE_INFO,
 			    "No SMI_CMD in FADT, mode transition failed"));
 		return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
@@ -119,7 +112,7 @@
 	 * we make sure both the numbers are zero to determine these
 	 * transitions are not supported.
 	 */
-	if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) {
+	if (!acpi_gbl_FADT.acpi_enable && !acpi_gbl_FADT.acpi_disable) {
 		ACPI_ERROR((AE_INFO,
 			    "No ACPI mode transition supported in this system (enable/disable both zero)"));
 		return_ACPI_STATUS(AE_OK);
@@ -130,9 +123,8 @@
 
 		/* BIOS should have disabled ALL fixed and GP events */
 
-		status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd,
-					    (u32) acpi_gbl_FADT->acpi_enable,
-					    8);
+		status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
+					    (u32) acpi_gbl_FADT.acpi_enable, 8);
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Attempting to enable ACPI mode\n"));
 		break;
@@ -143,8 +135,8 @@
 		 * BIOS should clear all fixed status bits and restore fixed event
 		 * enable bits to default
 		 */
-		status = acpi_os_write_port(acpi_gbl_FADT->smi_cmd,
-					    (u32) acpi_gbl_FADT->acpi_disable,
+		status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
+					    (u32) acpi_gbl_FADT.acpi_disable,
 					    8);
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Attempting to enable Legacy (non-ACPI) mode\n"));
@@ -204,7 +196,7 @@
 	 * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
 	 * system does not support mode transition.
 	 */
-	if (!acpi_gbl_FADT->smi_cmd) {
+	if (!acpi_gbl_FADT.smi_command) {
 		return_UINT32(ACPI_SYS_MODE_ACPI);
 	}