<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Pavel Machek &lt;pavel@ucw.cz&gt;

&gt; &gt; arch/x86_64/kernel/suspend_asm.S:18: undefined reference to `do_magic_suspend_1'
&gt; &gt; arch/x86_64/kernel/built-in.o(.text+0x10714):arch/x86_64/kernel/suspend_asm.S:56: undefined reference to `do_magic_resume_1'
&gt; &gt; arch/x86_64/kernel/built-in.o(.text+0x106e2):arch/x86_64/kernel/suspend_asm.S:40: undefined reference to `do_magic_suspend_2'
&gt; &gt; arch/x86_64/kernel/built-in.o(.text+0x10830):arch/x86_64/kernel/suspend_asm.S:118: undefined reference to `do_magic_resume_2'
&gt; &gt; kernel/built-in.o(.text+0x263b2): In function `swsusp_suspend':
&gt; &gt; kernel/power/swsusp.c:872: undefined reference to `swsusp_arch_suspend'
&gt; &gt; kernel/built-in.o(.text+0x2641a): In function `swsusp_resume':
&gt; &gt; kernel/power/swsusp.c:894: undefined reference to `swsusp_arch_resume'
&gt; 

Here's fix.  Works for me, unless I try to use "platform" method (it really
should not be default).

Oh, it would be nice to move x86_64/kernel/suspend_asm.S into
x86_64/power/swsusp.S for consistency, but I guess that's easier done via
bitkeeper.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/arch/x86_64/kernel/suspend_asm.S |   35 +++++++++++++------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diff -puN arch/x86_64/kernel/suspend_asm.S~bk-power-x86_64-fix arch/x86_64/kernel/suspend_asm.S
--- 25/arch/x86_64/kernel/suspend_asm.S~bk-power-x86_64-fix	Tue Jul 27 15:29:55 2004
+++ 25-akpm/arch/x86_64/kernel/suspend_asm.S	Tue Jul 27 15:29:55 2004
@@ -1,22 +1,18 @@
-/* originally gcc generated, but now changed. don't overwrite. */
+/* Originally gcc generated, modified by hand
+ *
+ * This may not use any stack, nor any variable that is not "NoSave":
+ *
+ * Its rewriting one kernel image with another. What is stack in "old"
+ * image could very well be data page in "new" image, and overwriting
+ * your own stack under you is bad idea.
+ */
 	
 	.text
 #include &lt;linux/linkage.h&gt;
 #include &lt;asm/segment.h&gt;
 #include &lt;asm/page.h&gt;
 
-/* Input:
- * rdi	resume flag 
- */	
-			
-ENTRY(do_magic)
-.LFB5:
-	subq	$8, %rsp
-.LCFI2:
-	testl	%edi, %edi
-	jne	.L90
-	call	do_magic_suspend_1
-	call	save_processor_state
+ENTRY(swsusp_arch_suspend)
 
 	movq %rsp, saved_context_esp(%rip)
 	movq %rax, saved_context_eax(%rip)
@@ -36,9 +32,10 @@ ENTRY(do_magic)
 	movq %r15, saved_context_r15(%rip)
 	pushfq ; popq saved_context_eflags(%rip)
 
-	addq	$8, %rsp
-	jmp	do_magic_suspend_2
-.L90:
+	call swsusp_save
+	ret
+
+ENTRY(swsusp_arch_resume)
 	/* set up cr3 */	
 	leaq	init_level4_pgt(%rip),%rax
 	subq	$__START_KERNEL_map,%rax
@@ -53,7 +50,6 @@ ENTRY(do_magic)
 	movq %rcx, %cr3;                     
 	movq %rax, %cr4;  # turn PGE back on 
 
-	call	do_magic_resume_1
 	movl	nr_copy_pages(%rip), %eax
 	xorl	%ecx, %ecx
 	movq	$0, loop(%rip)
@@ -113,9 +109,8 @@ ENTRY(do_magic)
 	movq saved_context_r14(%rip), %r14
 	movq saved_context_r15(%rip), %r15
 	pushq saved_context_eflags(%rip) ; popfq
-	call	restore_processor_state
-	addq	$8, %rsp
-	jmp	do_magic_resume_2
+	call	swsusp_restore
+	ret
 
 	.section .data.nosave
 loop:
_
</pre></body></html>