[PM] Split SOFTWARE_SUSPEND and ACPI_SLEEP

From: Pavel Machek (pavel@ucw.cz)
Date: Sat Jul 26 2003 - 17:39:58 EST


Hi!

Splits two config options to avoid user confusion. Patrick already has
better version of that patch in his tree, and probably wants to avoid
applying this.

                                                                Pavel

Index: linux/arch/i386/kernel/Makefile
===================================================================
--- linux.orig/arch/i386/kernel/Makefile 2003-07-22 13:39:42.000000000 +0200
+++ linux/arch/i386/kernel/Makefile 2003-07-17 22:22:58.000000000 +0200
@@ -24,7 +24,8 @@
 obj-$(CONFIG_X86_MPPARSE) += mpparse.o
 obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
 obj-$(CONFIG_X86_IO_APIC) += io_apic.o
-obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o suspend_asm.o
+obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend.o
+obj-$(CONFIG_PM) += suspend_asm.o
 obj-$(CONFIG_X86_NUMAQ) += numaq.o
 obj-$(CONFIG_X86_SUMMIT) += summit.o
 obj-$(CONFIG_EDD) += edd.o
Index: linux/arch/i386/kernel/suspend_asm.S
===================================================================
--- linux.orig/arch/i386/kernel/suspend_asm.S 2003-07-22 13:39:42.000000000 +0200
+++ linux/arch/i386/kernel/suspend_asm.S 2003-07-20 15:02:12.000000000 +0200
@@ -32,6 +32,7 @@
 saved_context_eflags:
         .long 0
 
+#ifdef CONFIG_SOFTWARE_SUSPEND
         .text
 
 ENTRY(do_magic)
@@ -117,4 +118,4 @@
 loop2:
        .quad 0
        .previous
-
\ No newline at end of file
+#endif
Index: linux/drivers/acpi/Kconfig
===================================================================
--- linux.orig/drivers/acpi/Kconfig 2003-07-22 13:39:42.000000000 +0200
+++ linux/drivers/acpi/Kconfig 2003-07-17 22:22:58.000000000 +0200
@@ -58,8 +58,8 @@
         default y
 
 config ACPI_SLEEP
- bool "Sleep States"
- depends on X86 && ACPI && !ACPI_HT_ONLY && SOFTWARE_SUSPEND
+ bool "Sleep States (EXPERIMENTAL)"
+ depends on X86 && ACPI && !ACPI_HT_ONLY && EXPERIMENTAL
         ---help---
           This option adds support for ACPI suspend states.
 
Index: linux/include/linux/suspend.h
===================================================================
--- linux.orig/include/linux/suspend.h 2003-07-22 13:39:42.000000000 +0200
+++ linux/include/linux/suspend.h 2003-07-22 12:54:08.000000000 +0200
@@ -55,10 +55,6 @@
 
 extern int register_suspend_notifier(struct notifier_block *);
 extern int unregister_suspend_notifier(struct notifier_block *);
-extern void refrigerator(unsigned long);
-
-extern int freeze_processes(void);
-extern void thaw_processes(void);
 
 extern unsigned int nr_copy_pages __nosavedata;
 extern suspend_pagedir_t *pagedir_nosave __nosavedata;
@@ -76,15 +72,20 @@
 extern void do_suspend_lowlevel_s4bios(int resume);
 
 #else
-static inline void software_suspend(void)
-{
-}
+static inline void software_suspend(void) { }
 #define software_resume() do { } while(0)
 #define register_suspend_notifier(a) do { } while(0)
 #define unregister_suspend_notifier(a) do { } while(0)
+#endif
+
+#ifdef CONFIG_PM
+extern void refrigerator(unsigned long);
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+#else
 #define refrigerator(a) do { BUG(); } while(0)
 #define freeze_processes() do { panic("You need CONFIG_SOFTWARE_SUSPEND to do sleeps."); } while(0)
 #define thaw_processes() do { } while(0)
 #endif
 
 #endif /* _LINUX_SWSUSP_H */

Index: linux/kernel/suspend.c
===================================================================
--- linux.orig/kernel/suspend.c 2003-07-22 13:39:43.000000000 +0200
+++ linux/kernel/suspend.c 2003-07-22 13:46:26.000000000 +0200
@@ -65,6 +65,7 @@
 #include <asm/pgtable.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_SOFTWARE_SUSPEND
 extern long sys_sync(void);
 
 unsigned char software_suspend_enabled = 0;
@@ -139,3 +139,4 @@
 
 static const char name_suspend[] = "Suspend Machine: ";
 static const char name_resume[] = "Resume Machine: ";
+#endif

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:30 EST