summaryrefslogtreecommitdiff
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
parent6479447102c482444c7586eaec9b69f2377a1af1 (diff)
downloadedk2-f7eb3b463c8d0a0c31a7ae12e93c880863dc781e.zip
edk2-f7eb3b463c8d0a0c31a7ae12e93c880863dc781e.tar.gz
edk2-f7eb3b463c8d0a0c31a7ae12e93c880863dc781e.tar.bz2
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.S5
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.asm5
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.S5
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/X64/AsmFuncs.asm5
-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
8 files changed, 32 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/AsmFuncs.S
index 671c8db..938ea04 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 3cf7502..61e20f7 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 8eeca3e..5a56bbe 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 f254e07..afa0c08 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 fc00f4f..1aa63e9 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 dfcbc0d..5b07561 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 2f84cf0..9782ca0 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 05d9bca..6ccc49e 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]