This change simply block-moves bodies of "save_registers"
and "restore_registers" routines into their callers.

Well, almost. In save_registers, we were saving %esp+4
to saved_context_esp, because we were in a subroutine,
there was one additional word (return address) on stack.
Now it is gone, and we are saving %esp to saved_context_esp.

(The patch looks more confusing than the change really is.)

Run-tested.

Signed-off-by: Denys Vlasenko <dvlas...@redhat.com>
CC: Pavel Machek <pa...@ucw.cz>
CC: Linus Torvalds <torva...@linux-foundation.org>
CC: Steven Rostedt <rost...@goodmis.org>
CC: Ingo Molnar <mi...@kernel.org>
CC: Borislav Petkov <b...@alien8.de>
CC: "H. Peter Anvin" <h...@zytor.com>
CC: Andy Lutomirski <l...@amacapital.net>
CC: Oleg Nesterov <o...@redhat.com>
CC: Frederic Weisbecker <fweis...@gmail.com>
CC: Alexei Starovoitov <a...@plumgrid.com>
CC: Will Drewry <w...@chromium.org>
CC: Kees Cook <keesc...@chromium.org>
CC: x...@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/kernel/acpi/wakeup_32.S | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 5fec9b0..b8ab4d3 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -36,13 +36,13 @@ bogus_magic:
        jmp     bogus_magic
 
 
-save_registers:
+ENTRY(do_suspend_lowlevel)
+       call    save_processor_state
+
        sidt    saved_idt
        sldt    saved_ldt
        str     saved_tss
-
-       leal    4(%esp), %eax
-       movl    %eax, saved_context_esp
+       movl    %esp, saved_context_esp
        movl    %ebx, saved_context_ebx
        movl    %ebp, saved_context_ebp
        movl    %esi, saved_context_esi
@@ -50,28 +50,19 @@ save_registers:
        pushfl
        popl    saved_context_eflags
 
-       ret
-
+       pushl   $3
+       call    x86_acpi_enter_sleep_state
+       addl    $4, %esp
+# If S3 fails, we simply fall through to S3 wakeup code:
 
-restore_registers:
+ret_point:
        movl    saved_context_ebp, %ebp
        movl    saved_context_ebx, %ebx
        movl    saved_context_esi, %esi
        movl    saved_context_edi, %edi
        pushl   saved_context_eflags
        popfl
-       ret
-
-ENTRY(do_suspend_lowlevel)
-       call    save_processor_state
-       call    save_registers
-       pushl   $3
-       call    x86_acpi_enter_sleep_state
-       addl    $4, %esp
-# If S3 fails, we simply fall through to S3 wakeup code:
 
-ret_point:
-       call    restore_registers
        call    restore_processor_state
        ret
 
-- 
1.8.1.4

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

Reply via email to