]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/acpi/sleep: Provide registration for acpi_suspend_lowlevel.
authorLiang Tang <liang.tang@oracle.com>
Wed, 28 Sep 2011 03:29:46 +0000 (11:29 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 19 Oct 2011 17:07:38 +0000 (13:07 -0400)
Which by default will be x86_acpi_suspend_lowlevel.
This registration allows us to register another callback
if there is a need to use another platform specific callback.

CC: Thomas Gleixner <tglx@linutronix.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: x86@kernel.org
CC: Len Brown <len.brown@intel.com>
CC: Joseph Cihula <joseph.cihula@intel.com>
CC: Shane Wang <shane.wang@intel.com>
CC: linux-pm@lists.linux-foundation.org
CC: linux-acpi@vger.kernel.org
CC: Len Brown <len.brown@intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Liang Tang <liang.tang@oracle.com>
arch/x86/include/asm/acpi.h
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/acpi/sleep.c
arch/x86/kernel/acpi/sleep.h
drivers/acpi/sleep.c

index 0a46696649f0603c940872853eec4c371f3fccba..9b538dcc573582033126b92398d575891f07824e 100644 (file)
@@ -119,7 +119,7 @@ static inline void acpi_disable_pci(void)
 }
 
 /* Low-level suspend routine. */
-extern int acpi_suspend_lowlevel(void);
+extern int (*acpi_suspend_lowlevel)(void);
 
 extern const unsigned char acpi_wakeup_code[];
 #define acpi_wakeup_address (__pa(TRAMPOLINE_SYM(acpi_wakeup_code)))
index 7f30806c1c9becd168d00ced6e8d0e3a0a6d74c0..ddd081b59ca00eb25c131580401082175fde1eba 100644 (file)
@@ -44,6 +44,7 @@
 #include <asm/mpspec.h>
 #include <asm/smp.h>
 
+#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
 static int __initdata acpi_force = 0;
 u32 acpi_rsdt_forced;
 int acpi_disabled;
@@ -556,6 +557,7 @@ int (*__acpi_override_sleep)(u8 sleep_state, u32 pm1a_ctrl,
                             u32 pm1b_ctrl, bool *skip_rest) \
                           __attribute__ ((unused)) = NULL;
 
+int (*acpi_suspend_lowlevel)(void) = x86_acpi_suspend_lowlevel;
 /*
  * success: return IRQ number (>=0)
  * failure: return < 0
index 103b6ab368d39315bc752e02a7bdc5b83ede0acf..4d2d0b119047659f258eb051167bfbfaf484a9b8 100644 (file)
@@ -25,12 +25,12 @@ static char temp_stack[4096];
 #endif
 
 /**
- * acpi_suspend_lowlevel - save kernel state
+ * x86_acpi_suspend_lowlevel - save kernel state
  *
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  */
-int acpi_suspend_lowlevel(void)
+int x86_acpi_suspend_lowlevel(void)
 {
        struct wakeup_header *header;
        /* address in low memory of the wakeup routine. */
index 416d4be13fef6d16cc96936ae3f222a91040ccf0..4d3feb5a7216403f1fb3e717400d66395d811780 100644 (file)
@@ -13,3 +13,5 @@ extern unsigned long acpi_copy_wakeup_routine(unsigned long);
 extern void wakeup_long64(void);
 
 extern void do_suspend_lowlevel(void);
+
+extern int x86_acpi_suspend_lowlevel(void);
index 6c949602cbd111d18753217ea0ee4784054ec008..a6da454350d6ff1e013f954a84ff0243cd263926 100644 (file)
@@ -254,6 +254,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
                break;
 
        case ACPI_STATE_S3:
+               if (!acpi_suspend_lowlevel)
+                       return -ENODEV;
                error = acpi_suspend_lowlevel();
                if (error)
                        return error;