mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
35a1715411
commit
61ece967cb
|
@ -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
|
#* This program and the accompanying materials
|
||||||
#* are licensed and made available under the terms and conditions of the BSD License
|
#* 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
|
#* 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;
|
#; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
movl %dr7, %eax
|
movl %dr7, %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
#; clear Dr7 while executing debugger itself
|
|
||||||
xorl %eax, %eax
|
|
||||||
movl %eax, %dr7
|
|
||||||
|
|
||||||
movl %dr6, %eax
|
movl %dr6, %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
#; insure all status bits in dr6 are clear...
|
|
||||||
xorl %eax, %eax
|
|
||||||
movl %eax, %dr6
|
|
||||||
|
|
||||||
movl %dr3, %eax
|
movl %dr3, %eax
|
||||||
pushl %eax
|
pushl %eax
|
||||||
movl %dr2, %eax
|
movl %dr2, %eax
|
||||||
|
@ -319,18 +311,9 @@ nullExternalExceptionHandler:
|
||||||
addl $512, %esp
|
addl $512, %esp
|
||||||
|
|
||||||
#; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
#; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
popl %eax
|
#; Skip restoration of DRx registers to support in-circuit emualators
|
||||||
movl %eax, %dr0
|
#; or debuggers set breakpoint in interrupt/exception context
|
||||||
popl %eax
|
addl $24, %esp
|
||||||
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
|
|
||||||
|
|
||||||
#; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
|
#; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
|
||||||
popl %eax
|
popl %eax
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
TITLE CpuAsm.asm:
|
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
|
;* This program and the accompanying materials
|
||||||
;* are licensed and made available under the terms and conditions of the BSD License
|
;* 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
|
;* 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;
|
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
mov eax, dr7
|
mov eax, dr7
|
||||||
push eax
|
push eax
|
||||||
;; clear Dr7 while executing debugger itself
|
|
||||||
xor eax, eax
|
|
||||||
mov dr7, eax
|
|
||||||
|
|
||||||
mov eax, dr6
|
mov eax, dr6
|
||||||
push eax
|
push eax
|
||||||
;; insure all status bits in dr6 are clear...
|
|
||||||
xor eax, eax
|
|
||||||
mov dr6, eax
|
|
||||||
|
|
||||||
mov eax, dr3
|
mov eax, dr3
|
||||||
push eax
|
push eax
|
||||||
mov eax, dr2
|
mov eax, dr2
|
||||||
|
@ -317,18 +309,9 @@ nullExternalExceptionHandler:
|
||||||
add esp, 512
|
add esp, 512
|
||||||
|
|
||||||
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
;; UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
pop eax
|
;; Skip restoration of DRx registers to support in-circuit emualators
|
||||||
mov dr0, eax
|
;; or debuggers set breakpoint in interrupt/exception context
|
||||||
pop eax
|
add esp, 4 * 6
|
||||||
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
|
|
||||||
|
|
||||||
;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
|
;; UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
|
||||||
pop eax
|
pop eax
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#*
|
#*
|
||||||
#* Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
|
#* Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||||
#* This program and the accompanying materials
|
#* This program and the accompanying materials
|
||||||
#* are licensed and made available under the terms and conditions of the BSD License
|
#* 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
|
#* which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -218,16 +218,8 @@ CommonInterruptEntry_al_0000:
|
||||||
#; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
#; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
movq %dr7, %rax
|
movq %dr7, %rax
|
||||||
pushq %rax
|
pushq %rax
|
||||||
#; clear Dr7 while executing debugger itself
|
|
||||||
xorq %rax, %rax
|
|
||||||
movq %rax, %dr7
|
|
||||||
|
|
||||||
movq %dr6, %rax
|
movq %dr6, %rax
|
||||||
pushq %rax
|
pushq %rax
|
||||||
#; insure all status bits in dr6 are clear...
|
|
||||||
xorq %rax, %rax
|
|
||||||
movq %rax, %dr6
|
|
||||||
|
|
||||||
movq %dr3, %rax
|
movq %dr3, %rax
|
||||||
pushq %rax
|
pushq %rax
|
||||||
movq %dr2, %rax
|
movq %dr2, %rax
|
||||||
|
@ -277,18 +269,9 @@ nonNullValue:
|
||||||
addq $512, %rsp
|
addq $512, %rsp
|
||||||
|
|
||||||
#; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
#; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
popq %rax
|
#; Skip restoration of DRx registers to support in-circuit emualators
|
||||||
movq %rax, %dr0
|
#; or debuggers set breakpoint in interrupt/exception context
|
||||||
popq %rax
|
addq $48, %rsp
|
||||||
movq %rax, %dr1
|
|
||||||
popq %rax
|
|
||||||
movq %rax, %dr2
|
|
||||||
popq %rax
|
|
||||||
movq %rax, %dr3
|
|
||||||
#; skip restore of dr6. We cleared dr6 during the context save.
|
|
||||||
addq $8, %rsp
|
|
||||||
popq %rax
|
|
||||||
movq %rax, %dr7
|
|
||||||
|
|
||||||
#; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;
|
#; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;
|
||||||
popq %rax
|
popq %rax
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
TITLE CpuAsm.asm:
|
TITLE CpuAsm.asm:
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
;*
|
;*
|
||||||
;* Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
|
;* Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||||
;* This program and the accompanying materials
|
;* This program and the accompanying materials
|
||||||
;* are licensed and made available under the terms and conditions of the BSD License
|
;* 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
|
;* which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -207,16 +207,8 @@ NoErrorCode:
|
||||||
;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
mov rax, dr7
|
mov rax, dr7
|
||||||
push rax
|
push rax
|
||||||
;; clear Dr7 while executing debugger itself
|
|
||||||
xor rax, rax
|
|
||||||
mov dr7, rax
|
|
||||||
|
|
||||||
mov rax, dr6
|
mov rax, dr6
|
||||||
push rax
|
push rax
|
||||||
;; insure all status bits in dr6 are clear...
|
|
||||||
xor rax, rax
|
|
||||||
mov dr6, rax
|
|
||||||
|
|
||||||
mov rax, dr3
|
mov rax, dr3
|
||||||
push rax
|
push rax
|
||||||
mov rax, dr2
|
mov rax, dr2
|
||||||
|
@ -265,18 +257,9 @@ nonNullValue:
|
||||||
add rsp, 512
|
add rsp, 512
|
||||||
|
|
||||||
;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
;; UINT64 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
|
||||||
pop rax
|
;; Skip restoration of DRx registers to support in-circuit emualators
|
||||||
mov dr0, rax
|
;; or debuggers set breakpoint in interrupt/exception context
|
||||||
pop rax
|
add rsp, 8 * 6
|
||||||
mov dr1, rax
|
|
||||||
pop rax
|
|
||||||
mov dr2, rax
|
|
||||||
pop rax
|
|
||||||
mov dr3, rax
|
|
||||||
;; skip restore of dr6. We cleared dr6 during the context save.
|
|
||||||
add rsp, 8
|
|
||||||
pop rax
|
|
||||||
mov dr7, rax
|
|
||||||
|
|
||||||
;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;
|
;; UINT64 Cr0, Cr1, Cr2, Cr3, Cr4, Cr8;
|
||||||
pop rax
|
pop rax
|
||||||
|
|
Loading…
Reference in New Issue