mirror of
https://github.com/ipxe/ipxe
synced 2026-01-13 00:48:39 +03:00
[librm] Provide an abstraction wrapper for prot_call
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -131,8 +131,7 @@ init_librm:
|
||||
addl $gdt, gdt_base
|
||||
|
||||
/* Initialise IDT */
|
||||
pushl $init_idt
|
||||
call prot_call
|
||||
virtcall init_idt
|
||||
|
||||
/* Restore registers */
|
||||
negl %edi
|
||||
@@ -554,8 +553,7 @@ flatten_real_mode:
|
||||
movb $0x8f, real_cs + 6
|
||||
movb $0x8f, real_ds + 6
|
||||
/* Call dummy protected-mode function */
|
||||
pushl $flatten_dummy
|
||||
call prot_call
|
||||
virtcall flatten_dummy
|
||||
/* Restore GDT */
|
||||
movb $0x00, real_cs + 6
|
||||
movb $0x00, real_ds + 6
|
||||
|
||||
@@ -56,9 +56,9 @@ static struct profiler real_call_profiler __profiler = { .name = "real_call" };
|
||||
static struct profiler prot_call_profiler __profiler = { .name = "prot_call" };
|
||||
|
||||
/**
|
||||
* Dummy protected-mode function
|
||||
* Dummy function for profiling tests
|
||||
*/
|
||||
static void librm_test_prot_call ( void ) {
|
||||
static __asmcall void librm_test_call ( struct i386_all_regs *ix86 __unused ) {
|
||||
/* Do nothing */
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ static void librm_test_exec ( void ) {
|
||||
/* Profile complete real-mode call cycle */
|
||||
for ( i = 0 ; i < PROFILE_COUNT ; i++ ) {
|
||||
profile_start ( &real_call_profiler );
|
||||
__asm__ __volatile__ ( REAL_CODE ( "" ) : : );
|
||||
__asm__ __volatile__ ( REAL_CODE ( "" ) );
|
||||
profile_stop ( &real_call_profiler );
|
||||
}
|
||||
|
||||
@@ -105,12 +105,10 @@ static void librm_test_exec ( void ) {
|
||||
for ( i = 0 ; i < PROFILE_COUNT ; i++ ) {
|
||||
__asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t"
|
||||
"movl %k0, %k2\n\t"
|
||||
"pushl %k3\n\t"
|
||||
"call prot_call\n\t"
|
||||
VIRT_CALL ( librm_test_call )
|
||||
"rdtsc\n\t" )
|
||||
: "=a" ( stopped ), "=d" ( discard_d ),
|
||||
"=R" ( started )
|
||||
: "i" ( librm_test_prot_call ) );
|
||||
"=R" ( started ) : );
|
||||
profile_start_at ( &prot_call_profiler, started );
|
||||
profile_stop_at ( &prot_call_profiler, stopped );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user