Print this page
acpica-unix2-20130823
PANKOVs restructure
@@ -1,14 +1,13 @@
-
/******************************************************************************
*
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2013, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -50,10 +49,11 @@
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwacpi")
+#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
*
* FUNCTION: AcpiHwSetMode
*
* PARAMETERS: Mode - SYS_MODE_ACPI or SYS_MODE_LEGACY
@@ -73,10 +73,18 @@
UINT32 Retry;
ACPI_FUNCTION_TRACE (HwSetMode);
+
+ /* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
/*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
* system does not support mode transition.
*/
if (!AcpiGbl_FADT.SmiCommand)
@@ -110,11 +118,10 @@
(UINT32) AcpiGbl_FADT.AcpiEnable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
break;
case ACPI_SYS_MODE_LEGACY:
-
/*
* BIOS should clear all fixed status bits and restore fixed event
* enable bits to default
*/
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
@@ -122,10 +129,11 @@
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Attempting to enable Legacy (non-ACPI) mode\n"));
break;
default:
+
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
if (ACPI_FAILURE (Status))
{
@@ -139,17 +147,17 @@
* do so, but allow faster systems to proceed more quickly.
*/
Retry = 3000;
while (Retry)
{
- if (AcpiHwGetMode() == Mode)
+ if (AcpiHwGetMode () == Mode)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n",
Mode));
return_ACPI_STATUS (AE_OK);
}
- AcpiOsStall(1000);
+ AcpiOsStall (ACPI_USEC_PER_MSEC);
Retry--;
}
ACPI_ERROR ((AE_INFO, "Hardware did not change modes"));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
@@ -178,10 +186,17 @@
ACPI_FUNCTION_TRACE (HwGetMode);
+ /* If the Hardware Reduced flag is set, machine is always in acpi mode */
+
+ if (AcpiGbl_ReducedHardware)
+ {
+ return_UINT32 (ACPI_SYS_MODE_ACPI);
+ }
+
/*
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
* system does not support mode transition.
*/
if (!AcpiGbl_FADT.SmiCommand)
@@ -202,5 +217,7 @@
else
{
return_UINT32 (ACPI_SYS_MODE_LEGACY);
}
}
+
+#endif /* !ACPI_REDUCED_HARDWARE */