--- /dev/null
+;------------------------------------------------------------------------------\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