summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/interface
diff options
context:
space:
mode:
authorMichael Brown2016-02-19 00:23:38 +0100
committerMichael Brown2016-02-19 00:23:38 +0100
commit31b5c2e753dbcb3d5023bccc8e644d0bcb56b2ad (patch)
tree536967f3f34fba94970a31cbde3fe1d2cf657cce /src/arch/x86/interface
parent[librm] Convert prot_call() to a real-mode near call (diff)
downloadipxe-31b5c2e753dbcb3d5023bccc8e644d0bcb56b2ad.tar.gz
ipxe-31b5c2e753dbcb3d5023bccc8e644d0bcb56b2ad.tar.xz
ipxe-31b5c2e753dbcb3d5023bccc8e644d0bcb56b2ad.zip
[librm] Provide an abstraction wrapper for prot_call
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/interface')
-rw-r--r--src/arch/x86/interface/pcbios/bios_console.c8
-rw-r--r--src/arch/x86/interface/pcbios/bios_reboot.c2
-rw-r--r--src/arch/x86/interface/pcbios/int13.c6
-rw-r--r--src/arch/x86/interface/pxe/pxe_entry.S5
4 files changed, 9 insertions, 12 deletions
diff --git a/src/arch/x86/interface/pcbios/bios_console.c b/src/arch/x86/interface/pcbios/bios_console.c
index 72d5b2093..c081a41e6 100644
--- a/src/arch/x86/interface/pcbios/bios_console.c
+++ b/src/arch/x86/interface/pcbios/bios_console.c
@@ -531,14 +531,12 @@ static void bios_inject_startup ( void ) {
__asm__ __volatile__ (
TEXT16_CODE ( "\nint16_wrapper:\n\t"
"pushfw\n\t"
- "cmpb $0, %%cs:bios_inject_lock\n\t"
+ "cmpb $0, %cs:bios_inject_lock\n\t"
"jnz 1f\n\t"
- "pushl %0\n\t"
- "call prot_call\n\t"
+ VIRT_CALL ( bios_inject )
"\n1:\n\t"
"popfw\n\t"
- "ljmp *%%cs:int16_vector\n\t" )
- : : "i" ( bios_inject ) );
+ "ljmp *%cs:int16_vector\n\t" ) );
/* Hook INT 16 */
hook_bios_interrupt ( 0x16, ( ( intptr_t ) int16_wrapper ),
diff --git a/src/arch/x86/interface/pcbios/bios_reboot.c b/src/arch/x86/interface/pcbios/bios_reboot.c
index 10a1ecb89..ed18dde0b 100644
--- a/src/arch/x86/interface/pcbios/bios_reboot.c
+++ b/src/arch/x86/interface/pcbios/bios_reboot.c
@@ -46,7 +46,7 @@ static void bios_reboot ( int warm ) {
put_real ( flag, BDA_SEG, BDA_REBOOT );
/* Jump to system reset vector */
- __asm__ __volatile__ ( REAL_CODE ( "ljmp $0xf000, $0xfff0" ) : : );
+ __asm__ __volatile__ ( REAL_CODE ( "ljmp $0xf000, $0xfff0" ) );
}
PROVIDE_REBOOT ( pcbios, reboot, bios_reboot );
diff --git a/src/arch/x86/interface/pcbios/int13.c b/src/arch/x86/interface/pcbios/int13.c
index 7fe247b5f..38880e4f0 100644
--- a/src/arch/x86/interface/pcbios/int13.c
+++ b/src/arch/x86/interface/pcbios/int13.c
@@ -1480,8 +1480,7 @@ static void int13_hook_vector ( void ) {
/* Clear OF, set CF, call int13() */
"orb $0, %%al\n\t"
"stc\n\t"
- "pushl %0\n\t"
- "call prot_call\n\t"
+ VIRT_CALL ( int13 )
/* Chain if OF not set */
"jo 1f\n\t"
"pushfw\n\t"
@@ -1512,8 +1511,7 @@ static void int13_hook_vector ( void ) {
"\n3:\n\t"
"movw %%bp, %%sp\n\t"
"popw %%bp\n\t"
- "iret\n\t" )
- : : "i" ( int13 ) );
+ "iret\n\t" ) : : );
hook_bios_interrupt ( 0x13, ( intptr_t ) int13_wrapper, &int13_vector );
}
diff --git a/src/arch/x86/interface/pxe/pxe_entry.S b/src/arch/x86/interface/pxe/pxe_entry.S
index 2ce1ced2b..663aa842e 100644
--- a/src/arch/x86/interface/pxe/pxe_entry.S
+++ b/src/arch/x86/interface/pxe/pxe_entry.S
@@ -24,6 +24,8 @@
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
+#include <librm.h>
+
.arch i386
/****************************************************************************
@@ -120,8 +122,7 @@ pxenv_null_entry:
.section ".text16", "ax", @progbits
.code16
pxenv_entry:
- pushl $pxe_api_call
- call prot_call
+ virtcall pxe_api_call
lret
.size pxenv_entry, . - pxenv_entry