Browse Source

[librm] Discard argument as part of return from prot_call()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
9dc340d735

+ 3
- 3
src/arch/i386/interface/syslinux/comboot_call.c View File

@@ -663,7 +663,7 @@ void hook_comboot_interrupts ( ) {
663 663
 		              "pushl %0\n\t"
664 664
 		              "pushw %%cs\n\t"
665 665
 		              "call prot_call\n\t"
666
-		              "addw $4, %%sp\n\t"
666
+			      "clc\n\t"
667 667
 			      "call patch_cf\n\t"
668 668
 		              "iret\n\t" )
669 669
 		          : : "i" ( int20 ) );
@@ -675,7 +675,7 @@ void hook_comboot_interrupts ( ) {
675 675
 		              "pushl %0\n\t"
676 676
 		              "pushw %%cs\n\t"
677 677
 		              "call prot_call\n\t"
678
-		              "addw $4, %%sp\n\t"
678
+			      "clc\n\t"
679 679
 			      "call patch_cf\n\t"
680 680
 		              "iret\n\t" )
681 681
 		          : : "i" ( int21 ) );
@@ -687,7 +687,7 @@ void hook_comboot_interrupts ( ) {
687 687
 		              "pushl %0\n\t"
688 688
 		              "pushw %%cs\n\t"
689 689
 		              "call prot_call\n\t"
690
-		              "addw $4, %%sp\n\t"
690
+			      "clc\n\t"
691 691
 			      "call patch_cf\n\t"
692 692
 		              "iret\n\t" )
693 693
 		          : : "i" ( int22) );

+ 0
- 1
src/arch/x86/core/dumpregs.c View File

@@ -9,7 +9,6 @@ void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) {
9 9
 			      "pushl $_dump_regs\n\t"
10 10
 			      "pushw %%cs\n\t"
11 11
 			      "call prot_call\n\t"
12
-			      "addr32 leal 4(%%esp), %%esp\n\t"
13 12
 			      "ret\n\t" ) : : );
14 13
 
15 14
 	printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"

+ 0
- 1
src/arch/x86/interface/pcbios/bios_console.c View File

@@ -536,7 +536,6 @@ static void bios_inject_startup ( void ) {
536 536
 			      "pushl %0\n\t"
537 537
 			      "pushw %%cs\n\t"
538 538
 			      "call prot_call\n\t"
539
-			      "addw $4, %%sp\n\t"
540 539
 			      "\n1:\n\t"
541 540
 			      "popfw\n\t"
542 541
 			      "ljmp *%%cs:int16_vector\n\t" )

+ 0
- 1
src/arch/x86/interface/pxe/pxe_entry.S View File

@@ -123,7 +123,6 @@ pxenv_entry:
123 123
 	pushl	$pxe_api_call
124 124
 	pushw	%cs
125 125
 	call	prot_call
126
-	addl	$4, %esp
127 126
 	lret
128 127
 	.size	pxenv_entry, . - pxenv_entry
129 128
 

+ 0
- 1
src/arch/x86/prefix/dskprefix.S View File

@@ -373,7 +373,6 @@ start_runtime:
373 373
 	pushl	$main
374 374
 	pushw	%cs
375 375
 	call	prot_call
376
-	popl	%ecx /* discard */
377 376
 
378 377
 	/* Uninstall iPXE */
379 378
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/exeprefix.S View File

@@ -151,7 +151,6 @@ _exe_start:
151 151
 	pushl	$main
152 152
 	pushw	%cs
153 153
 	call	prot_call
154
-	popl	%ecx /* discard */
155 154
 
156 155
 	/* Uninstall iPXE */
157 156
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/hdprefix.S View File

@@ -102,7 +102,6 @@ start_image:
102 102
 	pushl	$main
103 103
 	pushw	%cs
104 104
 	call	prot_call
105
-	popl	%ecx /* discard */
106 105
 
107 106
 	/* Uninstall iPXE */
108 107
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/libprefix.S View File

@@ -880,7 +880,6 @@ payload_death_message:
880 880
 	movw	%ax, (prot_call_vector+2)
881 881
 	pushl	$relocate
882 882
 	lcall	*prot_call_vector
883
-	popl	%edx /* discard */
884 883
 
885 884
 	/* Copy code to new location */
886 885
 	progress "  copy\n"

+ 0
- 1
src/arch/x86/prefix/lkrnprefix.S View File

@@ -200,7 +200,6 @@ no_cmd_line:
200 200
 	pushl	$main
201 201
 	pushw	%cs
202 202
 	call	prot_call
203
-	popl	%ecx /* discard */
204 203
 
205 204
 	/* Uninstall iPXE */
206 205
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/nbiprefix.S View File

@@ -69,7 +69,6 @@ _nbi_start:
69 69
 	pushl	$main
70 70
 	pushw	%cs
71 71
 	call	prot_call
72
-	popl	%ecx /* discard */
73 72
 
74 73
 	/* Uninstall iPXE */
75 74
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/pxeprefix.S View File

@@ -823,7 +823,6 @@ run_ipxe:
823 823
 	pushl	$main
824 824
 	pushw	%cs
825 825
 	call	prot_call
826
-	popl	%ecx /* discard */
827 826
 
828 827
 	/* Uninstall iPXE */
829 828
 	call	uninstall

+ 0
- 1
src/arch/x86/prefix/romprefix.S View File

@@ -807,7 +807,6 @@ exec:	/* Set %ds = %cs */
807 807
 	pushl	$main
808 808
 	pushw	%cs
809 809
 	call	prot_call
810
-	popl	%eax /* discard */
811 810
 
812 811
 	/* Set up flat real mode for return to BIOS */
813 812
 	call	flatten_real_mode

+ 1
- 3
src/arch/x86/prefix/undiloader.S View File

@@ -41,9 +41,7 @@ undiloader:
41 41
 	pushw	%ax
42 42
 	pushw	$prot_call
43 43
 	lret
44
-1:	popw	%bx	/* discard */
45
-	popw	%bx	/* discard */
46
-	/* Restore registers and return */
44
+1:	/* Restore registers and return */
47 45
 	popw	%bx
48 46
 	popw	%es
49 47
 	popw	%ds

+ 2
- 4
src/arch/x86/transitions/librm.S View File

@@ -134,7 +134,6 @@ init_librm:
134 134
 	pushl	$init_idt
135 135
 	pushw	%cs
136 136
 	call	prot_call
137
-	popl	%eax /* discard */
138 137
 
139 138
 	/* Restore registers */
140 139
 	negl	%edi
@@ -385,8 +384,8 @@ rm_gdtr:
385 384
  *
386 385
  * Example usage:
387 386
  *	pushl	$pxe_api_call
387
+ *	pushw	%cs
388 388
  *	call	prot_call
389
- *	addw	$4, %sp
390 389
  * to call in to the C function
391 390
  *      void pxe_api_call ( struct i386_all_regs *ix86 );
392 391
  ****************************************************************************
@@ -455,7 +454,7 @@ pc_rmode:
455 454
 	 */
456 455
 	addr32 movl -20(%esp), %esp
457 456
 	popfl
458
-	lret
457
+	lret	$4
459 458
 
460 459
 /****************************************************************************
461 460
  * real_call (protected-mode near call, 32-bit virtual return address)
@@ -554,7 +553,6 @@ flatten_real_mode:
554 553
 	pushl	$flatten_dummy
555 554
 	pushw	%cs
556 555
 	call	prot_call
557
-	addw	$4, %sp
558 556
 	/* Restore GDT */
559 557
 	movb	$0x00, real_cs + 6
560 558
 	movb	$0x00, real_ds + 6

+ 0
- 1
src/arch/x86/transitions/librm_test.c View File

@@ -108,7 +108,6 @@ static void librm_test_exec ( void ) {
108 108
 						   "pushl %k3\n\t"
109 109
 						   "pushw %%cs\n\t"
110 110
 						   "call prot_call\n\t"
111
-						   "addw $4, %%sp\n\t"
112 111
 						   "rdtsc\n\t" )
113 112
 				       : "=a" ( stopped ), "=d" ( discard_d ),
114 113
 					 "=R" ( started )

Loading…
Cancel
Save