ACPICA: Update FACS waking vector interfaces
authorBob Moore <robert.moore@intel.com>
Wed, 12 Nov 2008 06:54:05 +0000 (14:54 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 30 Dec 2008 03:38:36 +0000 (22:38 -0500)
Split AcpiSetFirmwareWakingVector into two: one for the 32-bit
vector, another for the 64-bit vector. This is required because the
host OS must setup the wake much differently for each vector (real
vs. protected mode, etc.) and the interface should not be deciding
which vector to use.  Also eliminate the GetFirmwareWakingVector
interface, as it served no purpose (only the firmware reads the
vector, OS only writes the vector.)  ACPICA BZ 731.

http://www.acpica.org/bugzilla/show_bug.cgi?id=731

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/hardware/hwsleep.c
include/acpi/acpixf.h

index 25dccdf179b9e4814ca52669f268f4409b34ce6b..6a30c8095ff1644f2b290fa1b07a46b4018a71e9 100644 (file)
@@ -52,16 +52,16 @@ ACPI_MODULE_NAME("hwsleep")
  *
  * FUNCTION:    acpi_set_firmware_waking_vector
  *
- * PARAMETERS:  physical_address    - Physical address of ACPI real mode
+ * PARAMETERS:  physical_address    - 32-bit physical address of ACPI real mode
  *                                    entry point.
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Access function for the firmware_waking_vector field in FACS
+ * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS
  *
  ******************************************************************************/
 acpi_status
-acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
+acpi_set_firmware_waking_vector(u32 physical_address)
 {
        struct acpi_table_facs *facs;
        acpi_status status;
@@ -85,10 +85,16 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address)
         * Protected Mode.  Some systems (for example HP dv5-1004nr) are known
         * to fail to resume if the 64-bit vector is used.
         */
-       if (facs->version >= 1)
-               facs->xfirmware_waking_vector = 0;
 
-       facs->firmware_waking_vector = (u32)physical_address;
+       /* Set the 32-bit vector */
+
+       facs->firmware_waking_vector = physical_address;
+
+       /* Clear the 64-bit vector if it exists */
+
+       if ((facs->length > 32) && (facs->version >= 1)) {
+               facs->xfirmware_waking_vector = 0;
+       }
 
        return_ACPI_STATUS(AE_OK);
 }
@@ -97,29 +103,25 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector)
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_get_firmware_waking_vector
+ * FUNCTION:    acpi_set_firmware_waking_vector64
  *
- * PARAMETERS:  *physical_address   - Where the contents of
- *                                    the firmware_waking_vector field of
- *                                    the FACS will be returned.
+ * PARAMETERS:  physical_address    - 64-bit physical address of ACPI protected
+ *                                    mode entry point.
  *
- * RETURN:      Status, vector
+ * RETURN:      Status
  *
- * DESCRIPTION: Access function for the firmware_waking_vector field in FACS
+ * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if
+ *              it exists in the table.
  *
  ******************************************************************************/
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
-acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
+acpi_set_firmware_waking_vector64(u64 physical_address)
 {
        struct acpi_table_facs *facs;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE(acpi_get_firmware_waking_vector);
+       ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64);
 
-       if (!physical_address) {
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
-       }
 
        /* Get the FACS */
 
@@ -131,14 +133,22 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
                return_ACPI_STATUS(status);
        }
 
-       /* Get the vector */
-       *physical_address = (acpi_physical_address)facs->firmware_waking_vector;
+       /* Determine if the 64-bit vector actually exists */
+
+       if ((facs->length <= 32) || (facs->version < 1)) {
+               return_ACPI_STATUS(AE_NOT_EXIST);
+       }
+
+       /* Clear 32-bit vector, set the 64-bit X_ vector */
+
+       facs->firmware_waking_vector = 0;
+       facs->xfirmware_waking_vector = physical_address;
 
        return_ACPI_STATUS(AE_OK);
 }
 
-ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector)
-#endif
+ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_enter_sleep_state_prep
index 33bc0e3b19546e8c1e8fb4225ec8615162c69d12..c9b903f3625abe594ef8d18e0357d5ee3ce42466 100644 (file)
@@ -320,12 +320,10 @@ acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
 acpi_status acpi_set_register(u32 register_id, u32 value);
 
 acpi_status
-acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
+acpi_set_firmware_waking_vector(u32 physical_address);
 
-#ifdef ACPI_FUTURE_USAGE
 acpi_status
-acpi_get_firmware_waking_vector(acpi_physical_address * physical_address);
-#endif
+acpi_set_firmware_waking_vector64(u64 physical_address);
 
 acpi_status
 acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);