Commit:     c8cbee61c9d53ee28473ad33bbb54f6a88f5e3af
Parent:     e5d2861f31474b373ce7754dc5122b414a176c64
Author:     Tian Kevin <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 23 17:16:52 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Jun 24 08:59:12 2007 -0700

    ACPI: preserve the ebx value in acpi_copy_wakeup_routine
    Register %ebx serves as the "global offset table base register" for
    position-independent code.  For absolute code, %ebx serves as a local
    register and has no specified role in the function calling sequence.  In
    either case, a function must preserve the register value for the caller.
    acpi_copy_wakeup_routine overrides %ebx without saving it, this may corrupt
    the called data.
    Kevin found that most time the value of Sx is saved in %esi, however
    sometimes compiler also uses %ebx.  When this happens, suspends fails since
    sleep value in ebx is changed by acpi_copy_wakeup_routine.
    The same funtion in X86_64 doesn't have this problem.
    Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
    Looks-okay-to: Pavel Machek <[EMAIL PROTECTED]>
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Acked-by: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 arch/i386/kernel/acpi/wakeup.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index b781b38..a2295a3 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -230,6 +230,7 @@ bogus_magic:
+       pushl   %ebx
        sgdt    saved_gdt
        sidt    saved_idt
        sldt    saved_ldt
@@ -263,6 +264,7 @@ ENTRY(acpi_copy_wakeup_routine)
        movl    %edx, video_flags - wakeup_start (%eax)
        movl    $0x12345678, real_magic - wakeup_start (%eax)
        movl    $0x12345678, saved_magic
+       popl    %ebx
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to