summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/CpuDxe/Ia32
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-11 03:22:15 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2010-06-11 03:22:15 +0000
commit61ece967cb59509608aa747fc9424c619646fc9d (patch)
tree6cee43d096781130afa236717fb2838acc4952e1 /UefiCpuPkg/CpuDxe/Ia32
parent35a171541199329108aa8c5417386d7afce9ddbf (diff)
downloadedk2-61ece967cb59509608aa747fc9424c619646fc9d.zip
edk2-61ece967cb59509608aa747fc9424c619646fc9d.tar.gz
edk2-61ece967cb59509608aa747fc9424c619646fc9d.tar.bz2
Skip restoration of DRx registers to support in-circuit emualators or debuggers set breakpoint in interrupt/exception context.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10573 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/CpuDxe/Ia32')
-rw-r--r--UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S25
-rw-r--r--UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm25
2 files changed, 8 insertions, 42 deletions
diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
index 0489657..d3e1dee 100644
--- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
+++ b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#*
-#* Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+#* Copyright (c) 2006 - 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
@@ -258,16 +258,8 @@ ErrorCodeAndVectorOnStack:
#; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
movl %dr7, %eax
pushl %eax
-#; clear Dr7 while executing debugger itself
- xorl %eax, %eax
- movl %eax, %dr7
-
movl %dr6, %eax
pushl %eax
-#; insure all status bits in dr6 are clear...
- xorl %eax, %eax
- movl %eax, %dr6
-
movl %dr3, %eax
pushl %eax
movl %dr2, %eax
@@ -319,18 +311,9 @@ nullExternalExceptionHandler:
addl $512, %esp
#; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
- popl %eax
- movl %eax, %dr0
- popl %eax
- movl %eax, %dr1
- popl %eax
- movl %eax, %dr2
- popl %eax
- movl %eax, %dr3
-#; skip restore of dr6. We cleared dr6 during the context save.
- addl $4, %esp
- popl %eax
- movl %eax, %dr7
+#; Skip restoration of DRx registers to support in-circuit emualators
+#; or debuggers set breakpoint in interrupt/exception context
+ addl $24, %esp
#; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
popl %eax
diff --git a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
index f54fb29..68454bd 100644
--- a/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
+++ b/UefiCpuPkg/CpuDxe/Ia32/CpuAsm.asm
@@ -1,7 +1,7 @@
TITLE CpuAsm.asm:
;------------------------------------------------------------------------------
;*
-;* Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+;* Copyright (c) 2006 - 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
@@ -256,16 +256,8 @@ ErrorCodeAndVectorOnStack:
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
mov eax, dr7
push eax
-;; clear Dr7 while executing debugger itself
- xor eax, eax
- mov dr7, eax
-
mov eax, dr6
push eax
-;; insure all status bits in dr6 are clear...
- xor eax, eax
- mov dr6, eax
-
mov eax, dr3
push eax
mov eax, dr2
@@ -317,18 +309,9 @@ nullExternalExceptionHandler:
add esp, 512
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
- pop eax
- mov dr0, eax
- pop eax
- mov dr1, eax
- pop eax
- mov dr2, eax
- pop eax
- mov dr3, eax
-;; skip restore of dr6. We cleared dr6 during the context save.
- add esp, 4
- pop eax
- mov dr7, eax
+;; Skip restoration of DRx registers to support in-circuit emualators
+;; or debuggers set breakpoint in interrupt/exception context
+ add esp, 4 * 6
;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
pop eax