Skip to contentSkip to conversation

Fix suspend-to-RAM in 2.5.20

PATCH Pavel Machek 1 participant 1 message Jun 3, 2002 ACPI

lore
Share & tools
lore
#0 lore raw

Hi!

I created arch/i386/suspend.c not to clash with ACPI people so much in future. (More stuff is going to move into it in the future, to clean up functions that really do not belong to the headers.) Please apply,

Pavel

arch/i386/kernel/Makefile +2 -0
@@ -24,6 +24,8 @@
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-$(CONFIG_X86_LOCAL_APIC)	+= mpparse.o apic.o nmi.o
 obj-$(CONFIG_X86_IO_APIC)	+= io_apic.o
+obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend.o
+obj-$(CONFIG_ACPI_SLEEP)	+= suspend.o
 ifdef CONFIG_VISWS
 obj-y += setup-visws.o
 obj-$(CONFIG_X86_VISWS_APIC)	+= visws_apic.o
arch/i386/kernel/suspend.c +45 -0

45 lines not on this page · raw message

drivers/acpi/system.c +0 -4
@@ -260,10 +260,8 @@
 	u32			state)
 {
 	acpi_status		status = AE_ERROR;
-#if 0
 	unsigned long		flags = 0;
 
-	/* this is very broken, so don't do anything until it's fixed */
 	save_flags(flags);
 	
 	switch (state)
@@ -289,8 +287,6 @@
 	fix_processor_context();
 
 	restore_flags(flags);
-#endif
-	printk("ACPI: ACPI-based suspend currently broken, aborting\n");
 
 	return status;
 }
include/asm-i386/suspend.h +24 -0
@@ -294,3 +294,27 @@
 }
 #endif 
 
+#ifdef CONFIG_ACPI_SLEEP
+extern unsigned long saved_eip;
+extern unsigned long saved_esp;
+extern unsigned long saved_ebp;
+extern unsigned long saved_ebx;
+extern unsigned long saved_esi;
+extern unsigned long saved_edi;
+
+static inline void acpi_save_register_state(unsigned long return_point)
+{
+	saved_eip = return_point;
+	asm volatile ("movl %%esp,(%0)" : "=m" (saved_esp));
+	asm volatile ("movl %%ebp,(%0)" : "=m" (saved_ebp));
+	asm volatile ("movl %%ebx,(%0)" : "=m" (saved_ebx));
+	asm volatile ("movl %%edi,(%0)" : "=m" (saved_edi));
+	asm volatile ("movl %%esi,(%0)" : "=m" (saved_esi));
+}
+
+#define acpi_restore_register_state()  do {} while (0)
+
+/* routines for saving/restoring kernel state */
+extern int acpi_save_state_mem(void);
+extern int acpi_save_state_disk(void);
+#endif
Signature · 2 lines
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa