aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorTian Kevin <kevin.tian@intel.com>2007-06-23 20:16:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-24 11:59:12 -0400
commitc8cbee61c9d53ee28473ad33bbb54f6a88f5e3af (patch)
treead0b767e80ef169ad319860274482ae0bbf8ab4c /arch/i386
parente5d2861f31474b373ce7754dc5122b414a176c64 (diff)
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 <rui.zhang@intel.com> Looks-okay-to: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Len Brown <lenb@kernel.org> Acked-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/acpi/wakeup.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index b781b38131c0..a2295a34b2c7 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -230,6 +230,7 @@ bogus_magic:
230# 230#
231ENTRY(acpi_copy_wakeup_routine) 231ENTRY(acpi_copy_wakeup_routine)
232 232
233 pushl %ebx
233 sgdt saved_gdt 234 sgdt saved_gdt
234 sidt saved_idt 235 sidt saved_idt
235 sldt saved_ldt 236 sldt saved_ldt
@@ -263,6 +264,7 @@ ENTRY(acpi_copy_wakeup_routine)
263 movl %edx, video_flags - wakeup_start (%eax) 264 movl %edx, video_flags - wakeup_start (%eax)
264 movl $0x12345678, real_magic - wakeup_start (%eax) 265 movl $0x12345678, real_magic - wakeup_start (%eax)
265 movl $0x12345678, saved_magic 266 movl $0x12345678, saved_magic
267 popl %ebx
266 ret 268 ret
267 269
268save_registers: 270save_registers: