summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-18 05:19:35 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-18 05:19:35 +0000
commitf7eb3b463c8d0a0c31a7ae12e93c880863dc781e (patch)
treecb48bb50ef75e3db5ea374eab5f39b2f0450776e /UefiCpuPkg
parent6479447102c482444c7586eaec9b69f2377a1af1 (diff)
downloadedk2-f7eb3b463c8d0a0c31a7ae12e93c880863dc781e.tar.gz
sync patch r11664, r11670 from main trunk.
Clear the direction flag in interrupt/exception handlers' assembly entry code before calling C functions to follow the UEFI calling convention. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2010@11677 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S5
-rw-r--r--UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm5
-rw-r--r--UefiCpuPkg/CpuDxe/X64/CpuAsm.S5
-rw-r--r--UefiCpuPkg/CpuDxe/X64/CpuAsm.asm5
4 files changed, 16 insertions, 4 deletions
diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
index fc00f4ff2b..1aa63e988b 100644
--- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
+++ b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#*
-#* Copyright 2006 - 2009, Intel Corporation
+#* Copyright 2006 - 2011, Intel Corporation
#* All rights reserved. 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
@@ -282,6 +282,9 @@ ErrorCodeAndVectorOnStack:
movl %esp, %edi
.byte 0x0f, 0x0ae, 0x07 #fxsave [edi]
+#; UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear
+ cld
+
#; UINT32 ExceptionData;
pushl 8(%ebp)
diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
index dfcbc0deff..5b07561e6c 100644
--- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
+++ b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
@@ -1,7 +1,7 @@
TITLE CpuAsm.asm:
;------------------------------------------------------------------------------
;*
-;* Copyright 2006 - 2009, Intel Corporation
+;* Copyright 2006 - 2011, Intel Corporation
;* All rights reserved. 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
@@ -280,6 +280,9 @@ ErrorCodeAndVectorOnStack:
mov edi, esp
db 0fh, 0aeh, 07h ;fxsave [edi]
+;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear
+ cld
+
;; UINT32 ExceptionData;
push dword ptr [ebp + 2 * 4]
diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.S b/UefiCpuPkg/CpuDxe/X64/CpuAsm.S
index 2f84cf0235..9782ca030d 100644
--- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.S
+++ b/UefiCpuPkg/CpuDxe/X64/CpuAsm.S
@@ -2,7 +2,7 @@
#------------------------------------------------------------------------------
#*
-#* Copyright 2008 - 2009, Intel Corporation
+#* Copyright 2008 - 2011, Intel Corporation
#* All rights reserved. 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
@@ -242,6 +242,9 @@ CommonInterruptEntry_al_0000:
movq %rsp, %rdi
.byte 0x0f, 0x0ae, 0x07 #fxsave [rdi]
+#; UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear
+ cld
+
#; UINT32 ExceptionData;
pushq 16(%rbp)
diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm b/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm
index 05d9bca119..6ccc49e125 100644
--- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm
+++ b/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm
@@ -1,7 +1,7 @@
TITLE CpuAsm.asm:
;------------------------------------------------------------------------------
;*
-;* Copyright 2008 - 2009, Intel Corporation
+;* Copyright 2008 - 2011, Intel Corporation
;* All rights reserved. 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
@@ -231,6 +231,9 @@ NoErrorCode:
mov rdi, rsp
db 0fh, 0aeh, 07h ;fxsave [rdi]
+;; UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear
+ cld
+
;; UINT32 ExceptionData;
push qword ptr [rbp + 16]