Hi, On 1 July 2015 at 02:27, Bin Meng <[email protected]> wrote: > From: Jian Luo <[email protected]> > > PCI option rom may use different SS during its execution, so it is not > safe to assume esp pointed to the same location in the protected mode. > > Signed-off-by: Jian Luo <[email protected]> > Reviewed-by: Bin Meng <[email protected]> > Tested-by: Bin Meng <[email protected]> > --- > > arch/x86/lib/bios_asm.S | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/arch/x86/lib/bios_asm.S b/arch/x86/lib/bios_asm.S > index 4faa70e..a29fe0e 100644 > --- a/arch/x86/lib/bios_asm.S > +++ b/arch/x86/lib/bios_asm.S > @@ -246,6 +246,8 @@ __interrupt_handler_16bit = PTR_TO_REAL_MODE(.) > push %fs > push %gs > > + movw %ss, %cs:__realmode_ss > + > /* Clear DF to not break ABI assumptions */ > cld > > @@ -258,12 +260,22 @@ __interrupt_handler_16bit = PTR_TO_REAL_MODE(.) > > enter_protected_mode >
Please can you add a comment here for the next person who changes this, about what is going on? It looks like it is saving and restoring the real mode SS register? > + movzwl %cs:__realmode_ss, %ecx > + shll $4, %ecx > + addl %ecx, %esp > + > /* Call the C interrupt handler */ > movl $interrupt_handler, %eax > call *%eax > > + movzwl %cs:__realmode_ss, %ecx > + shll $4, %ecx > + subl %ecx, %esp > + > enter_real_mode > > + movw %cs:__realmode_ss, %ss > + > /* > * Restore all registers, including those manipulated by the C > * handler > @@ -276,6 +288,9 @@ __interrupt_handler_16bit = PTR_TO_REAL_MODE(.) > popal > iret > > +__realmode_ss = PTR_TO_REAL_MODE(.) > + .word 0 > + > .globl asm_realmode_code_size > asm_realmode_code_size: > .long . - asm_realmode_code > -- > 1.8.2.1 > Regards, Simon _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

