Messages in this thread Patch in this message | | | From | Denys Vlasenko <> | Subject | [PATCH 3/3] x86, acpi: Fold {save,restore}_registers into their single callers | Date | Sun, 14 Jun 2015 15:23:10 +0200 |
| |
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 <dvlasenk@redhat.com> CC: Pavel Machek <pavel@ucw.cz> CC: Linus Torvalds <torvalds@linux-foundation.org> CC: Steven Rostedt <rostedt@goodmis.org> CC: Ingo Molnar <mingo@kernel.org> CC: Borislav Petkov <bp@alien8.de> CC: "H. Peter Anvin" <hpa@zytor.com> CC: Andy Lutomirski <luto@amacapital.net> CC: Oleg Nesterov <oleg@redhat.com> CC: Frederic Weisbecker <fweisbec@gmail.com> CC: Alexei Starovoitov <ast@plumgrid.com> CC: Will Drewry <wad@chromium.org> CC: Kees Cook <keescook@chromium.org> CC: x86@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
| |