diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-18 05:19:35 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-18 05:19:35 +0000 |
commit | f7eb3b463c8d0a0c31a7ae12e93c880863dc781e (patch) | |
tree | cb48bb50ef75e3db5ea374eab5f39b2f0450776e | |
parent | 6479447102c482444c7586eaec9b69f2377a1af1 (diff) | |
download | edk2-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
-rw-r--r-- | MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S | 5 | ||||
-rw-r--r-- | MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm | 5 | ||||
-rw-r--r-- | MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S | 5 | ||||
-rw-r--r-- | MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm | 5 | ||||
-rw-r--r-- | UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S | 5 | ||||
-rw-r--r-- | UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm | 5 | ||||
-rw-r--r-- | UefiCpuPkg/CpuDxe/X64/CpuAsm.S | 5 | ||||
-rw-r--r-- | UefiCpuPkg/CpuDxe/X64/CpuAsm.asm | 5 |
8 files changed, 32 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S index 671c8dbdf3..938ea04b8c 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S @@ -1,7 +1,7 @@ #/**@file
# Low leve IA32 specific debug support functions.
#
-# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
+# Copyright (c) 2006 - 2011, Intel Corporation. <BR>
# 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
@@ -276,6 +276,9 @@ ASM_PFX(CommonIdtEntry): # They MUST be. If they are not, a GP fault will occur.
fxsave (%edi)
+## UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear
+ cld
+
## UINT32 ExceptionData;
mov 0x0,%eax
push %eax
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm index 3cf75025ad..61e20f7c16 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm +++ b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm @@ -1,7 +1,7 @@ ;/** @file
; Low leve IA32 specific debug support functions.
;
-; Copyright (c) 2006, Intel Corporation. <BR>
+; Copyright (c) 2006 - 2011, Intel Corporation. <BR>
; 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
@@ -363,6 +363,9 @@ CommonIdtEntry:: ; They MUST be. If they are not, a GP fault will occur.
FXSTOR_EDI
+;; UEFI calling convention for IA32 requires that Direction flag in EFLAGs is clear
+ cld
+
;; UINT32 ExceptionData;
mov eax, ExceptData
push eax
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S index 8eeca3e8a8..5a56bbe4b8 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S +++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S @@ -1,7 +1,7 @@ ///**@file // Low leve x64 specific debug support functions. // -// Copyright (c) 2006 - 2010, Intel Corporation +// Copyright (c) 2006 - 2011, Intel Corporation // Portions copyright (c) 2008-2009 Apple Inc. All rights reserved. // All rights reserved. This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License @@ -357,6 +357,9 @@ ExtraPushDone: # FXSTOR_RDI fxsave (%rdi) +// UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear + cld + // UINT64 ExceptionData; movq ASM_PFX(ExceptData)(%rip), %rax pushq %rax diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm index f254e078da..afa0c08059 100644 --- a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm +++ b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm @@ -1,7 +1,7 @@ ;/** @file
; Low level x64 routines used by the debug support driver.
;
-; Copyright (c) 2007 - 2010, Intel Corporation.
+; Copyright (c) 2007 - 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
@@ -393,6 +393,9 @@ ExtraPushDone: ; They MUST be. If they are not, a GP fault will occur.
FXSTOR_RDI
+;; UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear
+ cld
+
;; UINT64 ExceptionData;
mov rax, ExceptData
push rax
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]
|