Selaa lähdekoodia

[librm] Rename prot_call() to virt_call()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 vuotta sitten
vanhempi
commit
e2cf3138f0

+ 2
- 2
src/arch/x86/include/librm.h Näytä tiedosto

@@ -58,7 +58,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
58 58
  */
59 59
 .macro virtcall function
60 60
 	pushl	$VIRTUAL(\function)
61
-	call	prot_call
61
+	call	virt_call
62 62
 .endm
63 63
 
64 64
 #else /* ASSEMBLY */
@@ -76,7 +76,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
76 76
  */
77 77
 #define VIRT_CALL( function )						\
78 78
 	"pushl $( " _S2 ( VIRTUAL ( function ) ) " )\n\t"		\
79
-	"call prot_call\n\t"
79
+	"call virt_call\n\t"
80 80
 
81 81
 /* Variables in librm.S */
82 82
 extern const unsigned long virt_offset;

+ 1
- 1
src/arch/x86/include/registers.h Näytä tiedosto

@@ -167,7 +167,7 @@ struct i386_seg_regs {
167 167
  *
168 168
  * @endcode
169 169
  *
170
- * prot_call() and kir_call() create this data structure on the stack
170
+ * virt_call() and kir_call() create this data structure on the stack
171 171
  * and pass in a pointer to this structure.
172 172
  *
173 173
  */

+ 31
- 31
src/arch/x86/transitions/librm.S Näytä tiedosto

@@ -640,19 +640,19 @@ intr_to_prot:
640 640
 	.equ	_intr_to_virt, intr_to_prot
641 641
 
642 642
 /****************************************************************************
643
- * prot_call (real-mode near call, 16-bit real-mode near return address)
643
+ * virt_call (real-mode near call, 16-bit real-mode near return address)
644 644
  *
645 645
  * Call a specific C function in the protected-mode code.  The
646 646
  * prototype of the C function must be
647 647
  *   void function ( struct i386_all_regs *ix86 ); 
648 648
  * ix86 will point to a struct containing the real-mode registers
649
- * at entry to prot_call.  
649
+ * at entry to virt_call().
650 650
  *
651
- * All registers will be preserved across prot_call(), unless the C
651
+ * All registers will be preserved across virt_call(), unless the C
652 652
  * function explicitly overwrites values in ix86.  Interrupt status
653 653
  * and GDT will also be preserved.  Gate A20 will be enabled.
654 654
  *
655
- * Note that prot_call() does not rely on the real-mode stack
655
+ * Note that virt_call() does not rely on the real-mode stack
656 656
  * remaining intact in order to return, since everything relevant is
657 657
  * copied to the protected-mode stack for the duration of the call.
658 658
  * In particular, this means that a real-mode prefix can make a call
@@ -666,26 +666,26 @@ intr_to_prot:
666 666
  *
667 667
  * Example usage:
668 668
  *	pushl	$pxe_api_call
669
- *	call	prot_call
669
+ *	call	virt_call
670 670
  * to call in to the C function
671 671
  *      void pxe_api_call ( struct i386_all_regs *ix86 );
672 672
  ****************************************************************************
673 673
  */
674 674
 	.struct	0
675
-PC_OFFSET_GDT:		.space	6
676
-PC_OFFSET_IDT:		.space	6
677
-PC_OFFSET_IX86:		.space	SIZEOF_I386_ALL_REGS
678
-PC_OFFSET_PADDING:	.space	2 /* for alignment */
679
-PC_OFFSET_RETADDR:	.space	2
680
-PC_OFFSET_PARAMS:
681
-PC_OFFSET_FUNCTION:	.space	4
682
-PC_OFFSET_END:
675
+VC_OFFSET_GDT:		.space	6
676
+VC_OFFSET_IDT:		.space	6
677
+VC_OFFSET_IX86:		.space	SIZEOF_I386_ALL_REGS
678
+VC_OFFSET_PADDING:	.space	2 /* for alignment */
679
+VC_OFFSET_RETADDR:	.space	2
680
+VC_OFFSET_PARAMS:
681
+VC_OFFSET_FUNCTION:	.space	4
682
+VC_OFFSET_END:
683 683
 	.previous
684 684
 
685
-	.section ".text16.prot_call", "ax", @progbits
685
+	.section ".text16.virt_call", "ax", @progbits
686 686
 	.code16
687
-	.globl prot_call
688
-prot_call:
687
+	.globl virt_call
688
+virt_call:
689 689
 	/* Preserve registers, flags and GDT on external RM stack */
690 690
 	pushfw	/* padding */
691 691
 	pushfl
@@ -696,37 +696,37 @@ prot_call:
696 696
 	pushw	%ds
697 697
 	pushw	%ss
698 698
 	pushw	%cs
699
-	subw	$PC_OFFSET_IX86, %sp
699
+	subw	$VC_OFFSET_IX86, %sp
700 700
 	movw	%sp, %bp
701
-	sidt	PC_OFFSET_IDT(%bp)
702
-	sgdt	PC_OFFSET_GDT(%bp)
701
+	sidt	VC_OFFSET_IDT(%bp)
702
+	sgdt	VC_OFFSET_GDT(%bp)
703 703
 
704 704
 	/* For sanity's sake, clear the direction flag as soon as possible */
705 705
 	cld
706 706
 
707 707
 	/* Switch to protected mode and move register dump to PM stack */
708
-	movl	$PC_OFFSET_END, %ecx
709
-	pushl	$VIRTUAL(pc_pmode)
708
+	movl	$VC_OFFSET_END, %ecx
709
+	pushl	$VIRTUAL(vc_pmode)
710 710
 	jmp	real_to_prot
711
-	.section ".text.prot_call", "ax", @progbits
711
+	.section ".text.virt_call", "ax", @progbits
712 712
 	.code32
713
-pc_pmode:
713
+vc_pmode:
714 714
 	/* Call function */
715
-	leal	PC_OFFSET_IX86(%esp), %eax
715
+	leal	VC_OFFSET_IX86(%esp), %eax
716 716
 	pushl	%eax
717
-	call	*(PC_OFFSET_FUNCTION+4)(%esp)
717
+	call	*(VC_OFFSET_FUNCTION+4)(%esp)
718 718
 	popl	%eax /* discard */
719 719
 
720 720
 	/* Switch to real mode and move register dump back to RM stack */
721
-	movl	$PC_OFFSET_END, %ecx
721
+	movl	$VC_OFFSET_END, %ecx
722 722
 	movl	%esp, %esi
723
-	pushl	$pc_rmode
723
+	pushl	$vc_rmode
724 724
 	jmp	prot_to_real
725
-	.section ".text16.prot_call", "ax", @progbits
725
+	.section ".text16.virt_call", "ax", @progbits
726 726
 	.code16
727
-pc_rmode:
727
+vc_rmode:
728 728
 	/* Restore registers and flags and return */
729
-	addw	$( PC_OFFSET_IX86 + 4 /* also skip %cs and %ss */ ), %sp
729
+	addw	$( VC_OFFSET_IX86 + 4 /* also skip %cs and %ss */ ), %sp
730 730
 	popw	%ds
731 731
 	popw	%es
732 732
 	popw	%fs
@@ -742,7 +742,7 @@ pc_rmode:
742 742
 	popfw	/* padding */
743 743
 
744 744
 	/* Return and discard function parameters */
745
-	ret	$( PC_OFFSET_END - PC_OFFSET_PARAMS )
745
+	ret	$( VC_OFFSET_END - VC_OFFSET_PARAMS )
746 746
 
747 747
 /****************************************************************************
748 748
  * real_call (protected-mode near call, 32-bit virtual return address)

+ 5
- 5
src/arch/x86/transitions/librm_test.c Näytä tiedosto

@@ -52,8 +52,8 @@ static struct profiler r2p_profiler __profiler = { .name = "r2p" };
52 52
 /** Real-mode call profiler */
53 53
 static struct profiler real_call_profiler __profiler = { .name = "real_call" };
54 54
 
55
-/** Protected-mode call profiler */
56
-static struct profiler prot_call_profiler __profiler = { .name = "prot_call" };
55
+/** Virtual call profiler */
56
+static struct profiler virt_call_profiler __profiler = { .name = "virt_call" };
57 57
 
58 58
 /**
59 59
  * Dummy function for profiling tests
@@ -101,7 +101,7 @@ static void librm_test_exec ( void ) {
101 101
 		profile_stop ( &real_call_profiler );
102 102
 	}
103 103
 
104
-	/* Profile complete protected-mode call cycle */
104
+	/* Profile complete virtual call cycle */
105 105
 	for ( i = 0 ; i < PROFILE_COUNT ; i++ ) {
106 106
 		__asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t"
107 107
 						   "movl %k0, %k2\n\t"
@@ -109,8 +109,8 @@ static void librm_test_exec ( void ) {
109 109
 						   "rdtsc\n\t" )
110 110
 				       : "=a" ( stopped ), "=d" ( discard_d ),
111 111
 					 "=R" ( started ) : );
112
-		profile_start_at ( &prot_call_profiler, started );
113
-		profile_stop_at ( &prot_call_profiler, stopped );
112
+		profile_start_at ( &virt_call_profiler, started );
113
+		profile_stop_at ( &virt_call_profiler, stopped );
114 114
 	}
115 115
 }
116 116
 

Loading…
Peruuta
Tallenna