diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-02-22 00:49:08 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-02-22 00:50:32 +0000 |
commit | e2cf3138f073905d31b1e6cad3cc69c6a63c34ac (patch) | |
tree | db4a4578cdcb2b59eb86c4fcbf1114d8abdbcef8 /src/arch/x86/transitions | |
parent | 4c1f2486e664e9c88164cfff917a99bfe6beed52 (diff) | |
download | ipxe-e2cf3138f073905d31b1e6cad3cc69c6a63c34ac.tar.gz |
[librm] Rename prot_call() to virt_call()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/transitions')
-rw-r--r-- | src/arch/x86/transitions/librm.S | 62 | ||||
-rw-r--r-- | src/arch/x86/transitions/librm_test.c | 10 |
2 files changed, 36 insertions, 36 deletions
diff --git a/src/arch/x86/transitions/librm.S b/src/arch/x86/transitions/librm.S index a3046987e..af22dee97 100644 --- a/src/arch/x86/transitions/librm.S +++ b/src/arch/x86/transitions/librm.S @@ -640,19 +640,19 @@ intr_to_prot: .equ _intr_to_virt, intr_to_prot /**************************************************************************** - * prot_call (real-mode near call, 16-bit real-mode near return address) + * virt_call (real-mode near call, 16-bit real-mode near return address) * * Call a specific C function in the protected-mode code. The * prototype of the C function must be * void function ( struct i386_all_regs *ix86 ); * ix86 will point to a struct containing the real-mode registers - * at entry to prot_call. + * at entry to virt_call(). * - * All registers will be preserved across prot_call(), unless the C + * All registers will be preserved across virt_call(), unless the C * function explicitly overwrites values in ix86. Interrupt status * and GDT will also be preserved. Gate A20 will be enabled. * - * Note that prot_call() does not rely on the real-mode stack + * Note that virt_call() does not rely on the real-mode stack * remaining intact in order to return, since everything relevant is * copied to the protected-mode stack for the duration of the call. * In particular, this means that a real-mode prefix can make a call @@ -666,26 +666,26 @@ intr_to_prot: * * Example usage: * pushl $pxe_api_call - * call prot_call + * call virt_call * to call in to the C function * void pxe_api_call ( struct i386_all_regs *ix86 ); **************************************************************************** */ .struct 0 -PC_OFFSET_GDT: .space 6 -PC_OFFSET_IDT: .space 6 -PC_OFFSET_IX86: .space SIZEOF_I386_ALL_REGS -PC_OFFSET_PADDING: .space 2 /* for alignment */ -PC_OFFSET_RETADDR: .space 2 -PC_OFFSET_PARAMS: -PC_OFFSET_FUNCTION: .space 4 -PC_OFFSET_END: +VC_OFFSET_GDT: .space 6 +VC_OFFSET_IDT: .space 6 +VC_OFFSET_IX86: .space SIZEOF_I386_ALL_REGS +VC_OFFSET_PADDING: .space 2 /* for alignment */ +VC_OFFSET_RETADDR: .space 2 +VC_OFFSET_PARAMS: +VC_OFFSET_FUNCTION: .space 4 +VC_OFFSET_END: .previous - .section ".text16.prot_call", "ax", @progbits + .section ".text16.virt_call", "ax", @progbits .code16 - .globl prot_call -prot_call: + .globl virt_call +virt_call: /* Preserve registers, flags and GDT on external RM stack */ pushfw /* padding */ pushfl @@ -696,37 +696,37 @@ prot_call: pushw %ds pushw %ss pushw %cs - subw $PC_OFFSET_IX86, %sp + subw $VC_OFFSET_IX86, %sp movw %sp, %bp - sidt PC_OFFSET_IDT(%bp) - sgdt PC_OFFSET_GDT(%bp) + sidt VC_OFFSET_IDT(%bp) + sgdt VC_OFFSET_GDT(%bp) /* For sanity's sake, clear the direction flag as soon as possible */ cld /* Switch to protected mode and move register dump to PM stack */ - movl $PC_OFFSET_END, %ecx - pushl $VIRTUAL(pc_pmode) + movl $VC_OFFSET_END, %ecx + pushl $VIRTUAL(vc_pmode) jmp real_to_prot - .section ".text.prot_call", "ax", @progbits + .section ".text.virt_call", "ax", @progbits .code32 -pc_pmode: +vc_pmode: /* Call function */ - leal PC_OFFSET_IX86(%esp), %eax + leal VC_OFFSET_IX86(%esp), %eax pushl %eax - call *(PC_OFFSET_FUNCTION+4)(%esp) + call *(VC_OFFSET_FUNCTION+4)(%esp) popl %eax /* discard */ /* Switch to real mode and move register dump back to RM stack */ - movl $PC_OFFSET_END, %ecx + movl $VC_OFFSET_END, %ecx movl %esp, %esi - pushl $pc_rmode + pushl $vc_rmode jmp prot_to_real - .section ".text16.prot_call", "ax", @progbits + .section ".text16.virt_call", "ax", @progbits .code16 -pc_rmode: +vc_rmode: /* Restore registers and flags and return */ - addw $( PC_OFFSET_IX86 + 4 /* also skip %cs and %ss */ ), %sp + addw $( VC_OFFSET_IX86 + 4 /* also skip %cs and %ss */ ), %sp popw %ds popw %es popw %fs @@ -742,7 +742,7 @@ pc_rmode: popfw /* padding */ /* Return and discard function parameters */ - ret $( PC_OFFSET_END - PC_OFFSET_PARAMS ) + ret $( VC_OFFSET_END - VC_OFFSET_PARAMS ) /**************************************************************************** * real_call (protected-mode near call, 32-bit virtual return address) diff --git a/src/arch/x86/transitions/librm_test.c b/src/arch/x86/transitions/librm_test.c index 3f9ead218..ba4254fe4 100644 --- a/src/arch/x86/transitions/librm_test.c +++ b/src/arch/x86/transitions/librm_test.c @@ -52,8 +52,8 @@ static struct profiler r2p_profiler __profiler = { .name = "r2p" }; /** Real-mode call profiler */ static struct profiler real_call_profiler __profiler = { .name = "real_call" }; -/** Protected-mode call profiler */ -static struct profiler prot_call_profiler __profiler = { .name = "prot_call" }; +/** Virtual call profiler */ +static struct profiler virt_call_profiler __profiler = { .name = "virt_call" }; /** * Dummy function for profiling tests @@ -101,7 +101,7 @@ static void librm_test_exec ( void ) { profile_stop ( &real_call_profiler ); } - /* Profile complete protected-mode call cycle */ + /* Profile complete virtual call cycle */ for ( i = 0 ; i < PROFILE_COUNT ; i++ ) { __asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t" "movl %k0, %k2\n\t" @@ -109,8 +109,8 @@ static void librm_test_exec ( void ) { "rdtsc\n\t" ) : "=a" ( stopped ), "=d" ( discard_d ), "=R" ( started ) : ); - profile_start_at ( &prot_call_profiler, started ); - profile_stop_at ( &prot_call_profiler, stopped ); + profile_start_at ( &virt_call_profiler, started ); + profile_stop_at ( &virt_call_profiler, stopped ); } } |