summaryrefslogtreecommitdiffstats
path: root/src/arch/i386
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/i386
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/i386')
-rw-r--r--src/arch/i386/include/bits/compiler.h2
-rw-r--r--src/arch/i386/interface/syslinux/comboot_call.c18
2 files changed, 7 insertions, 13 deletions
diff --git a/src/arch/i386/include/bits/compiler.h b/src/arch/i386/include/bits/compiler.h
index 87201135f..7c4a09396 100644
--- a/src/arch/i386/include/bits/compiler.h
+++ b/src/arch/i386/include/bits/compiler.h
@@ -9,7 +9,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#ifndef ASSEMBLY
/** Declare a function with standard calling conventions */
-#define __asmcall __attribute__ (( cdecl, regparm(0) ))
+#define __asmcall __attribute__ (( used, cdecl, regparm(0) ))
/**
* Declare a function with libgcc implicit linkage
diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c
index 277ec4475..565977811 100644
--- a/src/arch/i386/interface/syslinux/comboot_call.c
+++ b/src/arch/i386/interface/syslinux/comboot_call.c
@@ -660,34 +660,28 @@ void hook_comboot_interrupts ( ) {
__asm__ __volatile__ (
TEXT16_CODE ( "\nint20_wrapper:\n\t"
- "pushl %0\n\t"
- "call prot_call\n\t"
+ VIRT_CALL ( int20 )
"clc\n\t"
"call patch_cf\n\t"
- "iret\n\t" )
- : : "i" ( int20 ) );
+ "iret\n\t" ) );
hook_bios_interrupt ( 0x20, ( intptr_t ) int20_wrapper, &int20_vector );
__asm__ __volatile__ (
TEXT16_CODE ( "\nint21_wrapper:\n\t"
- "pushl %0\n\t"
- "call prot_call\n\t"
+ VIRT_CALL ( int21 )
"clc\n\t"
"call patch_cf\n\t"
- "iret\n\t" )
- : : "i" ( int21 ) );
+ "iret\n\t" ) );
hook_bios_interrupt ( 0x21, ( intptr_t ) int21_wrapper, &int21_vector );
__asm__ __volatile__ (
TEXT16_CODE ( "\nint22_wrapper:\n\t"
- "pushl %0\n\t"
- "call prot_call\n\t"
+ VIRT_CALL ( int22 )
"clc\n\t"
"call patch_cf\n\t"
- "iret\n\t" )
- : : "i" ( int22) );
+ "iret\n\t" ) );
hook_bios_interrupt ( 0x22, ( intptr_t ) int22_wrapper, &int22_vector );
}