Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755693AbbGCUJ1 (ORCPT ); Fri, 3 Jul 2015 16:09:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59337 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755815AbbGCUJF (ORCPT ); Fri, 3 Jul 2015 16:09:05 -0400 From: Denys Vlasenko To: Ingo Molnar Cc: Denys Vlasenko , Pavel Machek , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3 RESEND] x86, acpi: Fold {save,restore}_registers into their single callers Date: Fri, 3 Jul 2015 22:08:35 +0200 Message-Id: <1435954115-1800-3-git-send-email-dvlasenk@redhat.com> In-Reply-To: <1435954115-1800-1-git-send-email-dvlasenk@redhat.com> References: <1435954115-1800-1-git-send-email-dvlasenk@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2595 Lines: 95 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 CC: Pavel Machek CC: Linus Torvalds CC: Steven Rostedt CC: Ingo Molnar CC: Borislav Petkov CC: "H. Peter Anvin" CC: Andy Lutomirski CC: Oleg Nesterov CC: Frederic Weisbecker CC: Alexei Starovoitov CC: Will Drewry CC: Kees Cook 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/