summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-10 07:14:17 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-10 07:14:17 +0000
commit9b9641c6d92c5222a2ad457273cdb9a3b32ecaa3 (patch)
treea3aa52b39940f0cb19cf508555cbe9d6d7edadb6 /MdePkg
parent6fcb2d910a60879e4fe8e50ec59eab160ad864e3 (diff)
downloadedk2-platforms-9b9641c6d92c5222a2ad457273cdb9a3b32ecaa3.tar.xz
Save/Restore xmm6-xmm15 in function setJump/longJump.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8506 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/BaseLib.h2
-rw-r--r--MdePkg/Library/BaseLib/X64/LongJump.asm14
-rw-r--r--MdePkg/Library/BaseLib/X64/SetJump.asm12
3 files changed, 27 insertions, 1 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 32887b18e3..25d61f1448 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -101,6 +101,8 @@ typedef struct {
UINT64 R14;
UINT64 R15;
UINT64 Rip;
+ UINT64 MxCsr;
+ UINT8 XmmBuffer[160]; ///< XMM6-XMM15
} BASE_LIBRARY_JUMP_BUFFER;
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
diff --git a/MdePkg/Library/BaseLib/X64/LongJump.asm b/MdePkg/Library/BaseLib/X64/LongJump.asm
index 38e5606081..2b63fabc98 100644
--- a/MdePkg/Library/BaseLib/X64/LongJump.asm
+++ b/MdePkg/Library/BaseLib/X64/LongJump.asm
@@ -39,7 +39,19 @@ InternalLongJump PROC
mov r13, [rcx + 30h]
mov r14, [rcx + 38h]
mov r15, [rcx + 40h]
- mov rax, rdx ; set return value
+ ; load non-volatile fp registers
+ ldmxcsr [rcx + 50h]
+ movdqu xmm6, [rcx + 58h]
+ movdqu xmm7, [rcx + 68h]
+ movdqu xmm8, [rcx + 78h]
+ movdqu xmm9, [rcx + 88h]
+ movdqu xmm10, [rcx + 98h]
+ movdqu xmm11, [rcx + 0A8h]
+ movdqu xmm12, [rcx + 0B8h]
+ movdqu xmm13, [rcx + 0C8h]
+ movdqu xmm14, [rcx + 0D8h]
+ movdqu xmm15, [rcx + 0E8h]
+ mov rax, rdx ; set return value
jmp qword ptr [rcx + 48h]
InternalLongJump ENDP
diff --git a/MdePkg/Library/BaseLib/X64/SetJump.asm b/MdePkg/Library/BaseLib/X64/SetJump.asm
index 2ed581ea9d..5ef8de3bcb 100644
--- a/MdePkg/Library/BaseLib/X64/SetJump.asm
+++ b/MdePkg/Library/BaseLib/X64/SetJump.asm
@@ -47,6 +47,18 @@ SetJump PROC
mov [rcx + 38h], r14
mov [rcx + 40h], r15
mov [rcx + 48h], rdx
+ ; save non-volatile fp registers
+ stmxcsr [rcx + 50h]
+ movdqu [rcx + 58h], xmm6
+ movdqu [rcx + 68h], xmm7
+ movdqu [rcx + 78h], xmm8
+ movdqu [rcx + 88h], xmm9
+ movdqu [rcx + 98h], xmm10
+ movdqu [rcx + 0A8h], xmm11
+ movdqu [rcx + 0B8h], xmm12
+ movdqu [rcx + 0C8h], xmm13
+ movdqu [rcx + 0D8h], xmm14
+ movdqu [rcx + 0E8h], xmm15
xor rax, rax
jmp rdx
SetJump ENDP