]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg BaseLib: Convert Ia32/SetJump.asm to NASM
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 31 May 2016 01:51:55 +0000 (18:51 -0700)
committerLiming Gao <liming.gao@intel.com>
Tue, 28 Jun 2016 01:48:45 +0000 (09:48 +0800)
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
Ia32/SetJump.asm to Ia32/SetJump.nasm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
MdePkg/Library/BaseLib/BaseLib.inf
MdePkg/Library/BaseLib/Ia32/SetJump.nasm [new file with mode: 0644]

index dd81c671cb6d41fafa31406cfb9d804dd5aa3297..7f13d837e8f71cd498cbb9b73349b92cf2aaba4f 100644 (file)
   Ia32/WriteMsr64.asm | INTEL \r
   Ia32/SwapBytes64.nasm| INTEL\r
   Ia32/SwapBytes64.asm | INTEL \r
+  Ia32/SetJump.nasm| INTEL\r
   Ia32/SetJump.asm | INTEL \r
   Ia32/RRotU64.asm | INTEL \r
   Ia32/RShiftU64.asm | INTEL \r
   Ia32/CpuIdEx.S | GCC \r
   Ia32/CpuId.S | GCC \r
   Ia32/LongJump.S | GCC \r
+  Ia32/SetJump.nasm| GCC\r
   Ia32/SetJump.S | GCC \r
   Ia32/SwapBytes64.nasm| GCC\r
   Ia32/SwapBytes64.S | GCC \r
diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm
new file mode 100644 (file)
index 0000000..6d3a5a2
--- /dev/null
@@ -0,0 +1,48 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   SetJump.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   Implementation of SetJump() on IA-32.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    SECTION .text\r
+\r
+extern ASM_PFX(InternalAssertJumpBuffer)\r
+\r
+;------------------------------------------------------------------------------\r
+; UINTN\r
+; EFIAPI\r
+; SetJump (\r
+;   OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+;   );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(SetJump)\r
+ASM_PFX(SetJump):\r
+    push    DWORD [esp + 4]\r
+    call    ASM_PFX(InternalAssertJumpBuffer)    ; To validate JumpBuffer\r
+    pop     ecx\r
+    pop     ecx                         ; ecx <- return address\r
+    mov     edx, [esp]\r
+    mov     [edx], ebx\r
+    mov     [edx + 4], esi\r
+    mov     [edx + 8], edi\r
+    mov     [edx + 12], ebp\r
+    mov     [edx + 16], esp\r
+    mov     [edx + 20], ecx             ; eip value to restore in LongJump\r
+    xor     eax, eax\r
+    jmp     ecx\r
+\r