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 9 years ago
parent
commit
9dc340d735

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

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

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

9
 			      "pushl $_dump_regs\n\t"
9
 			      "pushl $_dump_regs\n\t"
10
 			      "pushw %%cs\n\t"
10
 			      "pushw %%cs\n\t"
11
 			      "call prot_call\n\t"
11
 			      "call prot_call\n\t"
12
-			      "addr32 leal 4(%%esp), %%esp\n\t"
13
 			      "ret\n\t" ) : : );
12
 			      "ret\n\t" ) : : );
14
 
13
 
15
 	printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
14
 	printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"

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

536
 			      "pushl %0\n\t"
536
 			      "pushl %0\n\t"
537
 			      "pushw %%cs\n\t"
537
 			      "pushw %%cs\n\t"
538
 			      "call prot_call\n\t"
538
 			      "call prot_call\n\t"
539
-			      "addw $4, %%sp\n\t"
540
 			      "\n1:\n\t"
539
 			      "\n1:\n\t"
541
 			      "popfw\n\t"
540
 			      "popfw\n\t"
542
 			      "ljmp *%%cs:int16_vector\n\t" )
541
 			      "ljmp *%%cs:int16_vector\n\t" )

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

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

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

373
 	pushl	$main
373
 	pushl	$main
374
 	pushw	%cs
374
 	pushw	%cs
375
 	call	prot_call
375
 	call	prot_call
376
-	popl	%ecx /* discard */
377
 
376
 
378
 	/* Uninstall iPXE */
377
 	/* Uninstall iPXE */
379
 	call	uninstall
378
 	call	uninstall

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

151
 	pushl	$main
151
 	pushl	$main
152
 	pushw	%cs
152
 	pushw	%cs
153
 	call	prot_call
153
 	call	prot_call
154
-	popl	%ecx /* discard */
155
 
154
 
156
 	/* Uninstall iPXE */
155
 	/* Uninstall iPXE */
157
 	call	uninstall
156
 	call	uninstall

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

102
 	pushl	$main
102
 	pushl	$main
103
 	pushw	%cs
103
 	pushw	%cs
104
 	call	prot_call
104
 	call	prot_call
105
-	popl	%ecx /* discard */
106
 
105
 
107
 	/* Uninstall iPXE */
106
 	/* Uninstall iPXE */
108
 	call	uninstall
107
 	call	uninstall

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

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

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

200
 	pushl	$main
200
 	pushl	$main
201
 	pushw	%cs
201
 	pushw	%cs
202
 	call	prot_call
202
 	call	prot_call
203
-	popl	%ecx /* discard */
204
 
203
 
205
 	/* Uninstall iPXE */
204
 	/* Uninstall iPXE */
206
 	call	uninstall
205
 	call	uninstall

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

69
 	pushl	$main
69
 	pushl	$main
70
 	pushw	%cs
70
 	pushw	%cs
71
 	call	prot_call
71
 	call	prot_call
72
-	popl	%ecx /* discard */
73
 
72
 
74
 	/* Uninstall iPXE */
73
 	/* Uninstall iPXE */
75
 	call	uninstall
74
 	call	uninstall

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

823
 	pushl	$main
823
 	pushl	$main
824
 	pushw	%cs
824
 	pushw	%cs
825
 	call	prot_call
825
 	call	prot_call
826
-	popl	%ecx /* discard */
827
 
826
 
828
 	/* Uninstall iPXE */
827
 	/* Uninstall iPXE */
829
 	call	uninstall
828
 	call	uninstall

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

807
 	pushl	$main
807
 	pushl	$main
808
 	pushw	%cs
808
 	pushw	%cs
809
 	call	prot_call
809
 	call	prot_call
810
-	popl	%eax /* discard */
811
 
810
 
812
 	/* Set up flat real mode for return to BIOS */
811
 	/* Set up flat real mode for return to BIOS */
813
 	call	flatten_real_mode
812
 	call	flatten_real_mode

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

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

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

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

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

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

Loading…
Cancel
Save