diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-24 02:04:05 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-24 02:04:05 +0000 |
commit | 3a531e32ae7f00013b62076220f83c43ccaddef6 (patch) | |
tree | 018a9646f204d6ab230c51230000d985843e8972 | |
parent | 6d15fb6b6cb2c7e6e42bbf9bf1d9b4d9210a6d55 (diff) | |
download | edk2-3a531e32ae7f00013b62076220f83c43ccaddef6.tar.gz edk2-3a531e32ae7f00013b62076220f83c43ccaddef6.tar.bz2 edk2-3a531e32ae7f00013b62076220f83c43ccaddef6.zip |
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/UDK2008@11696 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 | ||||
-rwxr-xr-x | UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S | 5 | ||||
-rwxr-xr-x | UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm | 5 | ||||
-rwxr-xr-x | UefiCpuPkg/CpuDxe/X64/CpuAsm.S | 5 | ||||
-rwxr-xr-x | 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 44efd231fb..786f927382 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 - 2008, Intel Corporation
+# Copyright (c) 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
@@ -360,6 +360,9 @@ ExtraPushDone: # FXSTOR_RDI
fxsave [rdi]
+// UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear
+ cld
+
## UINT64 ExceptionData;
mov rax, ASM_PFX(ExceptData)
push rax
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm b/MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm index 6b047066ca..b7bdb4098b 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 - 2008, 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 69fe215637..a2de6cb5a9 100755 --- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S +++ b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S @@ -5,7 +5,7 @@ #------------------------------------------------------------------------------ #* -#* 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 @@ -291,6 +291,9 @@ ErrorCodeAndVectorOnStack: mov edi, esp .byte 0x0f, 0x0ae, 0x07 #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/Ia32/CpuAsm.asm b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm index dfcbc0deff..5b07561e6c 100755 --- 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 9d4c26190e..790ee51ab4 100755 --- 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 @@ -246,6 +246,9 @@ CommonInterruptEntry_al_0000: mov %rdi, %rsp .byte 0x0f, 0x0ae, 0x07 #fxsave [rdi] +#; UEFI calling convention for x64 requires that Direction flag in EFLAGs is clear + cld + #; UINT32 ExceptionData; push qword ptr [%rbp + 16] diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm b/UefiCpuPkg/CpuDxe/X64/CpuAsm.asm index 05d9bca119..6ccc49e125 100755 --- 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]
|