Skip to content

Commit

Permalink
x86, reboot: Fix the use of passed arguments in 32-bit BIOS reboot
Browse files Browse the repository at this point in the history
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 <brgerst@gmail.com>
LKML-Reference: <AANLkTikxqk=HEw9R-Du=v-1ti1HDGAY9vaNUep2XARaz@mail.gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthieu Castet <castet.matthieu@free.fr>
  • Loading branch information
H. Peter Anvin committed Feb 18, 2011
1 parent 3d35ac3 commit ee1b06e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch/x86/kernel/reboot_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ee1b06e

Please sign in to comment.