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 <[email protected]> CC: Pavel Machek <[email protected]> CC: Linus Torvalds <[email protected]> CC: Steven Rostedt <[email protected]> CC: Ingo Molnar <[email protected]> CC: Borislav Petkov <[email protected]> CC: "H. Peter Anvin" <[email protected]> CC: Andy Lutomirski <[email protected]> CC: Oleg Nesterov <[email protected]> CC: Frederic Weisbecker <[email protected]> CC: Alexei Starovoitov <[email protected]> CC: Will Drewry <[email protected]> CC: Kees Cook <[email protected]> CC: [email protected] CC: [email protected] --- 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

