summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-26 01:54:49 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-26 01:54:49 +0000
commit3e99020dbf0a159e34b84e7ae9125f2e368d5390 (patch)
tree0eb6339318f7bf7da1b679b8009cf267b2234566 /EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64
parent68bb5ce77e51cf35791e46f2202e36da97e5e6be (diff)
downloadedk2-platforms-3e99020dbf0a159e34b84e7ae9125f2e368d5390.tar.xz
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11094 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c5
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S30
4 files changed, 61 insertions, 8 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
index 9e01b2cd9e..884ec1cc27 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -35,6 +35,8 @@ typedef struct {
UINT64 R14;
UINT64 R15;
UINT64 Rip;
+ UINT32 MxCsr;
+ UINT8 XmmBuffer[160]; // XMM6-XMM15
} EFI_JUMP_BUFFER;
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
index aa366c2a1f..c930486183 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -84,8 +84,6 @@ Returns:
--*/
{
*This = &mTransferControl;
- mTransferControl.SetJump = TransferControlSetJump;
- mTransferControl.LongJump = TransferControlLongJump;
return EFI_SUCCESS;
}
@@ -112,7 +110,6 @@ Returns:
--*/
{
*This = &mFlushInstructionCache;
- mFlushInstructionCache.Flush = FlushInstructionCacheFlush;
return EFI_SUCCESS;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
index b6be0b2f60..418400c15a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
@@ -73,6 +73,8 @@ _r13 QWORD ?
_r14 QWORD ?
_r15 QWORD ?
_rip QWORD ?
+_MxCsr DWORD ?
+_XmmBuffer DB 160 DUP (?)
_EFI_JUMP_BUFFER ENDS
EFI_JUMP_BUFFER TYPEDEF _EFI_JUMP_BUFFER
@@ -116,6 +118,19 @@ TransferControlSetJump PROC
mov (EFI_JUMP_BUFFER PTR [rdx])._r13, r13
mov (EFI_JUMP_BUFFER PTR [rdx])._r14, r14
mov (EFI_JUMP_BUFFER PTR [rdx])._r15, r15
+ ; save non-volatile fp registers
+ stmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
+ lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
+ movdqu [rax], xmm6
+ movdqu [rax + 10h], xmm7
+ movdqu [rax + 20h], xmm8
+ movdqu [rax + 30h], xmm9
+ movdqu [rax + 40h], xmm10
+ movdqu [rax + 50h], xmm11
+ movdqu [rax + 60h], xmm12
+ movdqu [rax + 70h], xmm13
+ movdqu [rax + 80h], xmm14
+ movdqu [rax + 90h], xmm15
mov rax, QWORD PTR [rsp+0]
mov (EFI_JUMP_BUFFER PTR [rdx])._rip, rax
mov rax, EFI_SUCCESS
@@ -134,6 +149,19 @@ TransferControlSetJump ENDP
;
PUBLIC TransferControlLongJump
TransferControlLongJump PROC
+ ; load non-volatile fp registers
+ ldmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
+ lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
+ movdqu xmm6, [rax]
+ movdqu xmm7, [rax + 10h]
+ movdqu xmm8, [rax + 20h]
+ movdqu xmm9, [rax + 30h]
+ movdqu xmm10, [rax + 40h]
+ movdqu xmm11, [rax + 50h]
+ movdqu xmm12, [rax + 60h]
+ movdqu xmm13, [rax + 70h]
+ movdqu xmm14, [rax + 80h]
+ movdqu xmm15, [rax + 90h]
; set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
mov rax, EFI_WARN_RETURN_FROM_LONG_JUMP
mov rbx, (EFI_JUMP_BUFFER PTR [rdx])._rbx
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
index 5253c0e2d1..2d464488cc 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -99,6 +99,19 @@ ASM_PFX(TransferControlSetJump):
mov %r13,0x40(%rdx)
mov %r14,0x48(%rdx)
mov %r15,0x50(%rdx)
+ #; save non-volatile fp registers
+ stmxcsr 0x60(%rdx)
+ lea 0x68(%rdx), %rax
+ movdqu %xmm6, (%rax)
+ movdqu %xmm7, 0x10(%rax)
+ movdqu %xmm8, 0x20(%rax)
+ movdqu %xmm9, 0x30(%rax)
+ movdqu %xmm10, 0x40(%rax)
+ movdqu %xmm11, 0x50(%rax)
+ movdqu %xmm12, 0x60(%rax)
+ movdqu %xmm13, 0x70(%rax)
+ movdqu %xmm14, 0x80(%rax)
+ movdqu %xmm15, 0x90(%rax)
mov (%rsp),%rax
mov %rax,0x58(%rdx)
mov $0x0,%rax
@@ -115,7 +128,20 @@ ASM_PFX(TransferControlSetJump):
#
#
ASM_PFX(TransferControlLongJump):
- # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
+ # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
+ #; load non-volatile fp registers
+ ldmxcsr 0x60(%rdx)
+ lea 0x68(%rdx), %rax
+ movdqu (%rax), %xmm6
+ movdqu 0x10(%rax), %xmm7
+ movdqu 0x20(%rax), %xmm8
+ movdqu 0x30(%rax), %xmm9
+ movdqu 0x40(%rax), %xmm10
+ movdqu 0x50(%rax), %xmm11
+ movdqu 0x60(%rax), %xmm12
+ movdqu 0x70(%rax), %xmm13
+ movdqu 0x80(%rax), %xmm14
+ movdqu 0x90(%rax), %xmm15
mov $0x5,%rax
mov (%rdx),%rbx
mov 0x8(%rdx),%rsp