summaryrefslogtreecommitdiffstats
path: root/src/arch/x86/transitions/librm.S
diff options
context:
space:
mode:
authorMichael Brown2016-02-18 17:36:04 +0100
committerMichael Brown2016-02-18 18:12:16 +0100
commit196f0f2551a4f82d2968c6e3a50aaa54a45ec779 (patch)
treea253528f9e3c0851e348f7f57f0241bb3450fa4a /src/arch/x86/transitions/librm.S
parent[prefix] Standardise calls to prot_call() (diff)
downloadipxe-196f0f2551a4f82d2968c6e3a50aaa54a45ec779.tar.gz
ipxe-196f0f2551a4f82d2968c6e3a50aaa54a45ec779.tar.xz
ipxe-196f0f2551a4f82d2968c6e3a50aaa54a45ec779.zip
[librm] Convert prot_call() to a real-mode near call
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/transitions/librm.S')
-rw-r--r--src/arch/x86/transitions/librm.S12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/arch/x86/transitions/librm.S b/src/arch/x86/transitions/librm.S
index c702c0cc..46c1ab97 100644
--- a/src/arch/x86/transitions/librm.S
+++ b/src/arch/x86/transitions/librm.S
@@ -132,7 +132,6 @@ init_librm:
/* Initialise IDT */
pushl $init_idt
- pushw %cs
call prot_call
/* Restore registers */
@@ -358,7 +357,7 @@ rm_gdtr:
.long 0 /* Base */
/****************************************************************************
- * prot_call (real-mode far call, 16-bit real-mode far return address)
+ * prot_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
@@ -384,7 +383,6 @@ rm_gdtr:
*
* Example usage:
* pushl $pxe_api_call
- * pushw %cs
* call prot_call
* to call in to the C function
* void pxe_api_call ( struct i386_all_regs *ix86 );
@@ -394,7 +392,8 @@ rm_gdtr:
PC_OFFSET_GDT: .space 6
PC_OFFSET_IDT: .space 6
PC_OFFSET_IX86: .space SIZEOF_I386_ALL_REGS
-PC_OFFSET_RETADDR: .space 4
+PC_OFFSET_PADDING: .space 2 /* for alignment */
+PC_OFFSET_RETADDR: .space 2
PC_OFFSET_FUNCTION: .space 4
PC_OFFSET_END:
.previous
@@ -404,6 +403,7 @@ PC_OFFSET_END:
.globl prot_call
prot_call:
/* Preserve registers, flags and GDT on external RM stack */
+ pushfw /* padding */
pushfl
pushal
pushw %gs
@@ -455,7 +455,8 @@ pc_rmode:
*/
addr32 movl -20(%esp), %esp
popfl
- lret $4
+ popfw /* padding */
+ ret $4
/****************************************************************************
* real_call (protected-mode near call, 32-bit virtual return address)
@@ -554,7 +555,6 @@ flatten_real_mode:
movb $0x8f, real_ds + 6
/* Call dummy protected-mode function */
pushl $flatten_dummy
- pushw %cs
call prot_call
/* Restore GDT */
movb $0x00, real_cs + 6