Skip to contentSkip to conversation

2/3 swsusp: use non-contiguous memory on ppc

PATCH Pavel Machek 1 participant 1 message Mar 9, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi!

This patch contains the necessary changes to the assembly routines etc. for ppc. It depends on the main resume part. It's a Hu Gang's patch.

Please apply,
Pavel

From: Hu Gang <[email protected]>

arch/ppc/Kconfig +2 -0
diff -Nru linux-2.6.11-a/arch/ppc/Kconfig linux-2.6.11-b/arch/ppc/Kconfig
@@ -1046,6 +1046,8 @@
 
 source "drivers/zorro/Kconfig"
 
+source kernel/power/Kconfig
+
 endmenu
 
 menu "Bus options"
arch/ppc/kernel/asm-offsets.c +5 -0
diff -Nru linux-2.6.11-a/arch/ppc/kernel/asm-offsets.c linux-2.6.11-b/arch/ppc/kernel/asm-offsets.c
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/ptrace.h>
+#include <linux/suspend.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
 #include <asm/io.h>
@@ -136,6 +137,10 @@
 	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
 	DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
 
+	DEFINE(pbe_address, offsetof(struct pbe, address));
+	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
+	DEFINE(pbe_next, offsetof(struct pbe, next));
+
 	DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
 	return 0;
 }
arch/ppc/kernel/Makefile +1 -0
diff -Nru linux-2.6.11-a/arch/ppc/kernel/Makefile linux-2.6.11-b/arch/ppc/kernel/Makefile
@@ -16,6 +16,7 @@
 					semaphore.o syscalls.o setup.o \
 					cputable.o ppc_htab.o perfmon.o
 obj-$(CONFIG_6xx)		+= l2cr.o cpu_setup_6xx.o
+obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
 obj-$(CONFIG_POWER4)		+= cpu_setup_power4.o
 obj-$(CONFIG_MODULES)		+= module.o ppc_ksyms.o
 obj-$(CONFIG_NOT_COHERENT_CACHE)	+= dma-mapping.o
arch/ppc/kernel/signal.c +10 -0
diff -Nru linux-2.6.11-a/arch/ppc/kernel/signal.c linux-2.6.11-b/arch/ppc/kernel/signal.c
@@ -28,6 +28,7 @@
 #include <linux/elf.h>
 #include <linux/tty.h>
 #include <linux/binfmts.h>
+#include <linux/suspend.h>
 #include <asm/ucontext.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -704,6 +705,14 @@
 	unsigned long frame, newsp;
 	int signr, ret;
 
+	if (current->flags & PF_FREEZE) {
+		refrigerator(PF_FREEZE);
+		signr = 0;
+		ret = regs->gpr[3];
+		if (!signal_pending(current))
+			goto no_signal;
+	}
+
 	if (!oldset)
 		oldset = &current->blocked;
 
@@ -726,6 +735,7 @@
 			regs->gpr[3] = EINTR;
 			/* note that the cr0.SO bit is already set */
 		} else {
+no_signal:
 			regs->nip -= 4;	/* Back up & retry system call */
 			regs->result = 0;
 			regs->trap = 0;
arch/ppc/kernel/swsusp.S +349 -0

349 lines not on this page · raw message

arch/ppc/kernel/vmlinux.lds.S +6 -0
diff -Nru linux-2.6.11-a/arch/ppc/kernel/vmlinux.lds.S linux-2.6.11-b/arch/ppc/kernel/vmlinux.lds.S
@@ -74,6 +74,12 @@
     CONSTRUCTORS
   }
 
+  . = ALIGN(4096);
+  __nosave_begin = .;
+  .data_nosave : { *(.data.nosave) }
+  . = ALIGN(4096);
+  __nosave_end = .;
+
   . = ALIGN(32);
   .data.cacheline_aligned : { *(.data.cacheline_aligned) }
 
arch/ppc/platforms/pmac_setup.c +55 -0

77 lines not on this page · raw message

drivers/macintosh/via-pmu.c +84 -2

110 lines not on this page · raw message

include/asm-ppc/suspend.h +12 -0
diff -Nru linux-2.6.11-a/include/asm-ppc/suspend.h linux-2.6.11-b/include/asm-ppc/suspend.h
@@ -0,0 +1,12 @@
+static inline int arch_prepare_suspend(void)
+{
+	return 0;
+}
+
+static inline void save_processor_state(void)
+{
+}
+
+static inline void restore_processor_state(void)
+{
+}
include/linux/suspend.h +1 -1
diff -Nru linux-2.6.11-a/include/linux/suspend.h linux-2.6.11-b/include/linux/suspend.h
@@ -1,7 +1,7 @@
 #ifndef _LINUX_SWSUSP_H
 #define _LINUX_SWSUSP_H
 
-#if defined(CONFIG_X86) || defined(CONFIG_FRV)
+#if defined(CONFIG_X86) || defined(CONFIG_FRV) || defined(CONFIG_PPC32)
 #include <asm/suspend.h>
 #endif
 #include <linux/swap.h>
Signature · 9 lines
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

----- End forwarded message -----

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!