mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[prefix] Standardise calls to prot_call()
Use the standard "pushl $function ; pushw %cs ; call prot_call" sequence everywhere that prot_call() is used. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -867,6 +867,15 @@ payload_death_message:
|
|||||||
movw %ax, (init_librm_vector+2)
|
movw %ax, (init_librm_vector+2)
|
||||||
lcall *init_librm_vector
|
lcall *init_librm_vector
|
||||||
|
|
||||||
|
/* Prepare for return to .prefix segment */
|
||||||
|
pushw %cs
|
||||||
|
|
||||||
|
/* Jump to .text16 segment */
|
||||||
|
pushw %ax
|
||||||
|
pushw $1f
|
||||||
|
lret
|
||||||
|
.section ".text16.install_prealloc", "ax", @progbits
|
||||||
|
1:
|
||||||
/* Inhibit INT 15,e820 and INT 15,e801 if applicable */
|
/* Inhibit INT 15,e820 and INT 15,e801 if applicable */
|
||||||
testl %ebp, %ebp
|
testl %ebp, %ebp
|
||||||
jnz 1f
|
jnz 1f
|
||||||
@@ -878,10 +887,15 @@ payload_death_message:
|
|||||||
* ready for the copy to the new location.
|
* ready for the copy to the new location.
|
||||||
*/
|
*/
|
||||||
progress " relocate\n"
|
progress " relocate\n"
|
||||||
movw %ax, (prot_call_vector+2)
|
|
||||||
pushl $relocate
|
pushl $relocate
|
||||||
lcall *prot_call_vector
|
pushw %cs
|
||||||
|
call prot_call
|
||||||
|
|
||||||
|
/* Jump back to .prefix segment */
|
||||||
|
pushw $1f
|
||||||
|
lret
|
||||||
|
.section ".prefix.install_prealloc", "awx", @progbits
|
||||||
|
1:
|
||||||
/* Copy code to new location */
|
/* Copy code to new location */
|
||||||
progress " copy\n"
|
progress " copy\n"
|
||||||
pushl %edi
|
pushl %edi
|
||||||
@@ -929,10 +943,6 @@ init_librm_vector:
|
|||||||
.word init_librm
|
.word init_librm
|
||||||
.word 0
|
.word 0
|
||||||
.size init_librm_vector, . - init_librm_vector
|
.size init_librm_vector, . - init_librm_vector
|
||||||
prot_call_vector:
|
|
||||||
.word prot_call
|
|
||||||
.word 0
|
|
||||||
.size prot_call_vector, . - prot_call_vector
|
|
||||||
#endif
|
#endif
|
||||||
close_payload_vector:
|
close_payload_vector:
|
||||||
.word close_payload
|
.word close_payload
|
||||||
|
|||||||
@@ -18,13 +18,16 @@ undiloader:
|
|||||||
pushw %ds
|
pushw %ds
|
||||||
pushw %es
|
pushw %es
|
||||||
pushw %bx
|
pushw %bx
|
||||||
|
|
||||||
/* ROM segment address to %ds */
|
/* ROM segment address to %ds */
|
||||||
pushw %cs
|
pushw %cs
|
||||||
popw %ds
|
popw %ds
|
||||||
|
|
||||||
/* UNDI loader parameter structure address into %es:%di */
|
/* UNDI loader parameter structure address into %es:%di */
|
||||||
movw %sp, %bx
|
movw %sp, %bx
|
||||||
movw %ss:22(%bx), %di
|
movw %ss:22(%bx), %di
|
||||||
movw %ss:24(%bx), %es
|
movw %ss:24(%bx), %es
|
||||||
|
|
||||||
/* Install to specified real-mode addresses */
|
/* Install to specified real-mode addresses */
|
||||||
pushw %di
|
pushw %di
|
||||||
movw %es:12(%di), %bx
|
movw %es:12(%di), %bx
|
||||||
@@ -34,13 +37,18 @@ undiloader:
|
|||||||
orl $0xffffffff, %ebp /* Allow arbitrary relocation */
|
orl $0xffffffff, %ebp /* Allow arbitrary relocation */
|
||||||
call install_prealloc
|
call install_prealloc
|
||||||
popw %di
|
popw %di
|
||||||
|
|
||||||
|
/* Jump to .text16 segment */
|
||||||
|
pushw %ax
|
||||||
|
pushw $1f
|
||||||
|
lret
|
||||||
|
.section ".text16", "ax", @progbits
|
||||||
|
1:
|
||||||
/* Call UNDI loader C code */
|
/* Call UNDI loader C code */
|
||||||
pushl $pxe_loader_call
|
pushl $pxe_loader_call
|
||||||
pushw %cs
|
pushw %cs
|
||||||
pushw $1f
|
call prot_call
|
||||||
pushw %ax
|
|
||||||
pushw $prot_call
|
|
||||||
lret
|
|
||||||
1: /* Restore registers and return */
|
1: /* Restore registers and return */
|
||||||
popw %bx
|
popw %bx
|
||||||
popw %es
|
popw %es
|
||||||
@@ -49,4 +57,3 @@ undiloader:
|
|||||||
popl %edi
|
popl %edi
|
||||||
popl %esi
|
popl %esi
|
||||||
lret
|
lret
|
||||||
.size undiloader, . - undiloader
|
|
||||||
|
|||||||
Reference in New Issue
Block a user