Files
ipxe/src/arch/i386/prefix/undiloader.S
Frediano Ziglio 9df238a8aa [romprefix] Fix incorrect pointer offset in undiloader.S
Commit 2422647 ("[prefix] Allow prefix to specify an arbitrary maximum
address for relocation") introduced a regression into the UNDI ROM
loader by preserving an extra register on the stack without modifying
the %sp-relative addresses used in the routine.

Fix by correcting the %sp-relative addresses to allow for the extra
preserved variable.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-05-14 14:51:19 +01:00

55 lines
1020 B
ArmAsm

FILE_LICENCE ( GPL2_OR_LATER )
.text
.code16
.arch i386
.section ".prefix", "ax", @progbits
/* UNDI loader
*
* Called by an external program to load our PXE stack.
*/
.globl undiloader
undiloader:
/* Save registers */
pushl %esi
pushl %edi
pushl %ebp
pushw %ds
pushw %es
pushw %bx
/* ROM segment address to %ds */
pushw %cs
popw %ds
/* UNDI loader parameter structure address into %es:%di */
movw %sp, %bx
movw %ss:22(%bx), %di
movw %ss:24(%bx), %es
/* Install to specified real-mode addresses */
pushw %di
movw %es:12(%di), %bx
movw %es:14(%di), %ax
movl image_source, %esi
movl decompress_to, %edi
orl $0xffffffff, %ebp /* Allow arbitrary relocation */
call install_prealloc
popw %di
/* Call UNDI loader C code */
pushl $pxe_loader_call
pushw %cs
pushw $1f
pushw %ax
pushw $prot_call
lret
1: popw %bx /* discard */
popw %bx /* discard */
/* Restore registers and return */
popw %bx
popw %es
popw %ds
popl %ebp
popl %edi
popl %esi
lret
.size undiloader, . - undiloader