]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg BaseLib: Convert X64/SetJump.asm to NASM
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 31 May 2016 01:52:00 +0000 (18:52 -0700)
committerLiming Gao <liming.gao@intel.com>
Tue, 28 Jun 2016 01:49:27 +0000 (09:49 +0800)
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
X64/SetJump.asm to X64/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/X64/SetJump.nasm [new file with mode: 0644]

index f9628e5805d3c0137c9917628fc0e1e971478a43..e3408f28e3c8db040710c1df80a5de2e9c773333 100644 (file)
   X64/CpuId.asm\r
   X64/LongJump.nasm\r
   X64/LongJump.asm\r
+  X64/SetJump.nasm\r
   X64/SetJump.asm\r
   X64/SwitchStack.asm\r
   X64/EnableCache.asm\r
   X64/GccInline.c | GCC\r
   X64/Thunk16.S | XCODE \r
   X64/SwitchStack.S | GCC \r
+  X64/SetJump.nasm| GCC\r
   X64/SetJump.S | GCC \r
   X64/LongJump.nasm| GCC\r
   X64/LongJump.S | GCC \r
diff --git a/MdePkg/Library/BaseLib/X64/SetJump.nasm b/MdePkg/Library/BaseLib/X64/SetJump.nasm
new file mode 100644 (file)
index 0000000..b1d0ff7
--- /dev/null
@@ -0,0 +1,66 @@
+;------------------------------------------------------------------------------\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 x64.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    DEFAULT REL\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    rcx\r
+    add     rsp, -0x20\r
+    call    ASM_PFX(InternalAssertJumpBuffer)\r
+    add     rsp, 0x20\r
+    pop     rcx\r
+    pop     rdx\r
+    mov     [rcx], rbx\r
+    mov     [rcx + 8], rsp\r
+    mov     [rcx + 0x10], rbp\r
+    mov     [rcx + 0x18], rdi\r
+    mov     [rcx + 0x20], rsi\r
+    mov     [rcx + 0x28], r12\r
+    mov     [rcx + 0x30], r13\r
+    mov     [rcx + 0x38], r14\r
+    mov     [rcx + 0x40], r15\r
+    mov     [rcx + 0x48], rdx\r
+    ; save non-volatile fp registers\r
+    stmxcsr [rcx + 0x50]\r
+    movdqu  [rcx + 0x58], xmm6\r
+    movdqu  [rcx + 0x68], xmm7\r
+    movdqu  [rcx + 0x78], xmm8\r
+    movdqu  [rcx + 0x88], xmm9\r
+    movdqu  [rcx + 0x98], xmm10\r
+    movdqu  [rcx + 0xA8], xmm11\r
+    movdqu  [rcx + 0xB8], xmm12\r
+    movdqu  [rcx + 0xC8], xmm13\r
+    movdqu  [rcx + 0xD8], xmm14\r
+    movdqu  [rcx + 0xE8], xmm15\r
+    xor     rax, rax\r
+    jmp     rdx\r
+\r