- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / drivers / acpi / acpica / hwsleep.c
index 3c4a922..cfcbcc2 100644 (file)
@@ -237,7 +237,11 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
        u32 pm1b_control;
        struct acpi_bit_register_info *sleep_type_reg_info;
        struct acpi_bit_register_info *sleep_enable_reg_info;
+#if !(defined(CONFIG_XEN) && defined(CONFIG_X86))
        u32 in_value;
+#else
+       int err;
+#endif
        struct acpi_object_list arg_list;
        union acpi_object arg;
        acpi_status status;
@@ -348,6 +352,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
 
        /* Write #2: Write both SLP_TYP + SLP_EN */
 
+#if !(defined(CONFIG_XEN) && defined(CONFIG_X86))
        status = acpi_hw_write_pm1_control(pm1a_control, pm1b_control);
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
@@ -387,6 +392,15 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
                /* Spin until we wake */
 
        } while (!in_value);
+#else
+       /* PV ACPI just need check hypercall return value */
+       err = acpi_notify_hypervisor_state(sleep_state,
+                       pm1a_control, pm1b_control);
+       if (err) {
+               printk(KERN_ERR "ACPI: Hypervisor failure [%d]\n", err);
+               return_ACPI_STATUS(AE_ERROR);
+       }
+#endif
 
        return_ACPI_STATUS(AE_OK);
 }
@@ -405,6 +419,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
  *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
  *
  ******************************************************************************/
+#ifndef CONFIG_XEN
 acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
 {
        u32 in_value;
@@ -458,6 +473,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
+#endif
 
 /*******************************************************************************
  *