aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <[email protected]>2011-02-18 15:47:42 -0800
committerH. Peter Anvin <[email protected]>2011-02-18 15:47:42 -0800
commitee1b06ea6aed979da3b4e6b6ffea98ad55a3c5c1 (patch)
tree06b0420b33bdba387d89faba3ed1271492fad9f1
parent3d35ac346e981162eeba391e496faceed4753e7b (diff)
x86, reboot: Fix the use of passed arguments in 32-bit BIOS reboot
The initial version of this patch had %eax being a segment and %ecx being the mode. I had changed the interfaces, but not the actual implementation! Reported-by: Brian Gerst <[email protected]> LKML-Reference: <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Matthieu Castet <[email protected]>
-rw-r--r--arch/x86/kernel/reboot_32.S10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kernel/reboot_32.S b/arch/x86/kernel/reboot_32.S
index f242356a096e..29092b38d816 100644
--- a/arch/x86/kernel/reboot_32.S
+++ b/arch/x86/kernel/reboot_32.S
@@ -23,10 +23,14 @@ r_base = .
1: popl %ebx
subl $1b, %ebx
+ /* Compute the equivalent real-mode segment */
+ movl %ebx, %ecx
+ shrl $4, %ecx
+
/* Patch post-real-mode segment jump */
- movw dispatch_table(%ebx,%ecx,2),%cx
- movw %cx, 101f(%ebx)
- movw %ax, 102f(%ebx)
+ movw dispatch_table(%ebx,%eax,2),%ax
+ movw %ax, 101f(%ebx)
+ movw %cx, 102f(%ebx)
/* Set up the IDT for real mode. */
lidtl machine_real_restart_idt(%ebx)