summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/hardware/hwxfsleep.c')
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c93
1 files changed, 59 insertions, 34 deletions
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index 8d5ba97..5610398 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -51,6 +51,14 @@
/* Local prototypes */
+#if (!ACPI_REDUCED_HARDWARE)
+static ACPI_STATUS
+AcpiHwSetFirmwareWakingVector (
+ ACPI_TABLE_FACS *Facs,
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress,
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress64);
+#endif
+
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
@@ -77,29 +85,33 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
/*
* These functions are removed for the ACPI_REDUCED_HARDWARE case:
* AcpiSetFirmwareWakingVector
- * AcpiSetFirmwareWakingVector64
* AcpiEnterSleepStateS4bios
*/
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
- * FUNCTION: AcpiSetFirmwareWakingVector
+ * FUNCTION: AcpiHwSetFirmwareWakingVector
*
- * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
- * entry point.
+ * PARAMETERS: Facs - Pointer to FACS table
+ * PhysicalAddress - 32-bit physical address of ACPI real mode
+ * entry point
+ * PhysicalAddress64 - 64-bit physical address of ACPI protected
+ * entry point
*
* RETURN: Status
*
- * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
+ * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
*
******************************************************************************/
-ACPI_STATUS
-AcpiSetFirmwareWakingVector (
- UINT32 PhysicalAddress)
+static ACPI_STATUS
+AcpiHwSetFirmwareWakingVector (
+ ACPI_TABLE_FACS *Facs,
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress,
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
{
- ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
+ ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector);
/*
@@ -112,60 +124,73 @@ AcpiSetFirmwareWakingVector (
/* Set the 32-bit vector */
- AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
+ Facs->FirmwareWakingVector = (UINT32) PhysicalAddress;
- /* Clear the 64-bit vector if it exists */
-
- if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
+ if (Facs->Length > 32)
{
- AcpiGbl_FACS->XFirmwareWakingVector = 0;
+ if (Facs->Version >= 1)
+ {
+ /* Set the 64-bit vector */
+
+ Facs->XFirmwareWakingVector = PhysicalAddress64;
+ }
+ else
+ {
+ /* Clear the 64-bit vector if it exists */
+
+ Facs->XFirmwareWakingVector = 0;
+ }
}
return_ACPI_STATUS (AE_OK);
}
-ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
-
-#if ACPI_MACHINE_WIDTH == 64
/*******************************************************************************
*
- * FUNCTION: AcpiSetFirmwareWakingVector64
+ * FUNCTION: AcpiSetFirmwareWakingVector
*
- * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
- * mode entry point.
+ * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
+ * entry point
+ * PhysicalAddress64 - 64-bit physical address of ACPI protected
+ * entry point
*
* RETURN: Status
*
- * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
- * it exists in the table. This function is intended for use with
- * 64-bit host operating systems.
+ * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
*
******************************************************************************/
ACPI_STATUS
-AcpiSetFirmwareWakingVector64 (
- UINT64 PhysicalAddress)
+AcpiSetFirmwareWakingVector (
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress,
+ ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
{
- ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
+ ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
- /* Determine if the 64-bit vector actually exists */
+ /* If Hardware Reduced flag is set, there is no FACS */
- if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
+ if (AcpiGbl_ReducedHardware)
{
- return_ACPI_STATUS (AE_NOT_EXIST);
+ return_ACPI_STATUS (AE_OK);
}
- /* Clear 32-bit vector, set the 64-bit X_ vector */
+ if (AcpiGbl_Facs32)
+ {
+ (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs32,
+ PhysicalAddress, PhysicalAddress64);
+ }
+ if (AcpiGbl_Facs64)
+ {
+ (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs64,
+ PhysicalAddress, PhysicalAddress64);
+ }
- AcpiGbl_FACS->FirmwareWakingVector = 0;
- AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
-ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
-#endif
+ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
/*******************************************************************************
OpenPOWER on IntegriCloud