]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[librm] Discard argument as part of return from prot_call()
authorMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 23:16:49 +0000 (23:16 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 23:16:49 +0000 (23:16 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
15 files changed:
src/arch/i386/interface/syslinux/comboot_call.c
src/arch/x86/core/dumpregs.c
src/arch/x86/interface/pcbios/bios_console.c
src/arch/x86/interface/pxe/pxe_entry.S
src/arch/x86/prefix/dskprefix.S
src/arch/x86/prefix/exeprefix.S
src/arch/x86/prefix/hdprefix.S
src/arch/x86/prefix/libprefix.S
src/arch/x86/prefix/lkrnprefix.S
src/arch/x86/prefix/nbiprefix.S
src/arch/x86/prefix/pxeprefix.S
src/arch/x86/prefix/romprefix.S
src/arch/x86/prefix/undiloader.S
src/arch/x86/transitions/librm.S
src/arch/x86/transitions/librm_test.c

index 22848006cf9c7a91c5a16c4dbf57f706245b399e..37cba1b77bdf9a17592c00a4b7c8a1568425a28e 100644 (file)
@@ -663,7 +663,7 @@ void hook_comboot_interrupts ( ) {
                              "pushl %0\n\t"
                              "pushw %%cs\n\t"
                              "call prot_call\n\t"
-                             "addw $4, %%sp\n\t"
+                             "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" )
                          : : "i" ( int20 ) );
@@ -675,7 +675,7 @@ void hook_comboot_interrupts ( ) {
                              "pushl %0\n\t"
                              "pushw %%cs\n\t"
                              "call prot_call\n\t"
-                             "addw $4, %%sp\n\t"
+                             "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" )
                          : : "i" ( int21 ) );
@@ -687,7 +687,7 @@ void hook_comboot_interrupts ( ) {
                              "pushl %0\n\t"
                              "pushw %%cs\n\t"
                              "call prot_call\n\t"
-                             "addw $4, %%sp\n\t"
+                             "clc\n\t"
                              "call patch_cf\n\t"
                              "iret\n\t" )
                          : : "i" ( int22) );
index 82dc21847e6b9a7208ff770395d9e937d4be6b28..d23988d306b96ab26b3143a6146a4dcfc85d601d 100644 (file)
@@ -9,7 +9,6 @@ void __asmcall _dump_regs ( struct i386_all_regs *ix86 ) {
                              "pushl $_dump_regs\n\t"
                              "pushw %%cs\n\t"
                              "call prot_call\n\t"
-                             "addr32 leal 4(%%esp), %%esp\n\t"
                              "ret\n\t" ) : : );
 
        printf ( "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
index cfffd95428d47f74644a2565e620ae6addd8eec6..364c294dac0796cc4c73e19ef4ac1af12995aaeb 100644 (file)
@@ -536,7 +536,6 @@ static void bios_inject_startup ( void ) {
                              "pushl %0\n\t"
                              "pushw %%cs\n\t"
                              "call prot_call\n\t"
-                             "addw $4, %%sp\n\t"
                              "\n1:\n\t"
                              "popfw\n\t"
                              "ljmp *%%cs:int16_vector\n\t" )
index 07852cd502a9a0e4d32dace58707f48db8b37a41..84eba1e0683d8d1af24685e5a940b16ccf5a988d 100644 (file)
@@ -123,7 +123,6 @@ pxenv_entry:
        pushl   $pxe_api_call
        pushw   %cs
        call    prot_call
-       addl    $4, %esp
        lret
        .size   pxenv_entry, . - pxenv_entry
 
index 7aa017ccdfc5a09bd192b358a9ad6b3af936600b..d716a30f031d81e1f4acb54cd4f69c252f2eb334 100644 (file)
@@ -373,7 +373,6 @@ start_runtime:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 5c648d51d0d5bdd691c68f7d8c6591e2159d89b6..35061b152a8f60e35e17e9d987ec230c3fe253e4 100644 (file)
@@ -151,7 +151,6 @@ _exe_start:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 1d012d80ba2366027716f85bc9b1c3ae2a4b7883..9f5752aa8669349aee2c4155cc5d3c760c177f42 100644 (file)
@@ -102,7 +102,6 @@ start_image:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 3cdb6ec9a466bc1695ad62a8f29062f5b54808c4..897a6656f8bdc3fff27d545bac9ad7ffe10fdd0f 100644 (file)
@@ -880,7 +880,6 @@ payload_death_message:
        movw    %ax, (prot_call_vector+2)
        pushl   $relocate
        lcall   *prot_call_vector
-       popl    %edx /* discard */
 
        /* Copy code to new location */
        progress "  copy\n"
index 64135e14b9e129ca07efbde8001eda01441f3aa3..34e2bdc8f556194a10b1fd7eac362ec66f59567e 100644 (file)
@@ -200,7 +200,6 @@ no_cmd_line:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 16c79566c3a610831da1fbab6d16773fe3ceca4d..539b5ebaee9d858102f343faad5fef130ebab8d1 100644 (file)
@@ -69,7 +69,6 @@ _nbi_start:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 465ce43459af4329356690da163fd1ca5dd5ef96..c742add6309f5caaf7dcd3c9704f0c93982456fe 100644 (file)
@@ -823,7 +823,6 @@ run_ipxe:
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %ecx /* discard */
 
        /* Uninstall iPXE */
        call    uninstall
index 8974c53982b8191a0bef7ae9df7245782d367f2d..57eb31af434cf74a000d711d708805ea692347f1 100644 (file)
@@ -807,7 +807,6 @@ exec:       /* Set %ds = %cs */
        pushl   $main
        pushw   %cs
        call    prot_call
-       popl    %eax /* discard */
 
        /* Set up flat real mode for return to BIOS */
        call    flatten_real_mode
index 5cace44b761ede1ca3b740105d99255f59dff4a9..9526613300f4b71241e60a3c5c98725077e6b9dd 100644 (file)
@@ -41,9 +41,7 @@ undiloader:
        pushw   %ax
        pushw   $prot_call
        lret
-1:     popw    %bx     /* discard */
-       popw    %bx     /* discard */
-       /* Restore registers and return */
+1:     /* Restore registers and return */
        popw    %bx
        popw    %es
        popw    %ds
index 863e224150e05acb15fcac2841e2e2f77e956d12..bf79637a8974faf0130c19c2781d75a94dd997b0 100644 (file)
@@ -134,7 +134,6 @@ init_librm:
        pushl   $init_idt
        pushw   %cs
        call    prot_call
-       popl    %eax /* discard */
 
        /* Restore registers */
        negl    %edi
@@ -385,8 +384,8 @@ rm_gdtr:
  *
  * Example usage:
  *     pushl   $pxe_api_call
+ *     pushw   %cs
  *     call    prot_call
- *     addw    $4, %sp
  * to call in to the C function
  *      void pxe_api_call ( struct i386_all_regs *ix86 );
  ****************************************************************************
@@ -455,7 +454,7 @@ pc_rmode:
         */
        addr32 movl -20(%esp), %esp
        popfl
-       lret
+       lret    $4
 
 /****************************************************************************
  * real_call (protected-mode near call, 32-bit virtual return address)
@@ -554,7 +553,6 @@ flatten_real_mode:
        pushl   $flatten_dummy
        pushw   %cs
        call    prot_call
-       addw    $4, %sp
        /* Restore GDT */
        movb    $0x00, real_cs + 6
        movb    $0x00, real_ds + 6
index 496d5612408fb67934c11ddc62cb0298a22cdb46..f86584e3f55cd57d9c67d808ed8deda3ba04b5c7 100644 (file)
@@ -108,7 +108,6 @@ static void librm_test_exec ( void ) {
                                                   "pushl %k3\n\t"
                                                   "pushw %%cs\n\t"
                                                   "call prot_call\n\t"
-                                                  "addw $4, %%sp\n\t"
                                                   "rdtsc\n\t" )
                                       : "=a" ( stopped ), "=d" ( discard_d ),
                                         "=R" ( started )