1. DebugAgentLib will install reserved vector table to persist vectors.
2. Update PeCoffExtraActionLib to detect if debug agent initialized or not by checking each IDT entry instead of whole IDT table. Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14886 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -28,6 +28,10 @@ ASM_GLOBAL ASM_PFX(ExceptionStubHeaderSize)
|
||||
ASM_GLOBAL ASM_PFX(TimerInterruptHandle)
|
||||
ASM_GLOBAL ASM_PFX(CommonEntry)
|
||||
|
||||
.macro AGENT_HANDLER_SIGNATURE
|
||||
.byte 0x41, 0x47, 0x54, 0x48 # AGENT_HANDLER_SIGNATURE SIGNATURE_32('A','G','T','H')
|
||||
.endm
|
||||
|
||||
.data
|
||||
|
||||
ASM_PFX(ExceptionStubHeaderSize): .word ASM_PFX(Exception1Handle) - ASM_PFX(Exception0Handle)
|
||||
@@ -35,108 +39,127 @@ ASM_PFX(ExceptionStubHeaderSize): .word ASM_PFX(Exception1Handle) - ASM_PFX
|
||||
|
||||
.text
|
||||
|
||||
.byte 0x41, 0x47, 0x54, 0x48 # AGENT_HANDLER_SIGNATURE SIGNATURE_32('A','G','T','H')
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception0Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $0, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception1Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $1, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception2Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $2, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception3Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $3, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception4Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $4, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception5Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $5, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception6Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $6, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception7Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $7, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception8Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $8, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception9Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $9, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception10Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $10, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception11Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $11, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception12Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $12, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception13Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $13, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception14Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $14, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception15Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $15, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception16Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $16, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception17Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $17, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception18Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $18, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(Exception19Handle):
|
||||
cli
|
||||
pushq %rcx
|
||||
mov $19, %rcx
|
||||
jmp ASM_PFX(CommonEntry)
|
||||
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
ASM_PFX(TimerInterruptHandle):
|
||||
cli
|
||||
pushq %rcx
|
||||
|
@@ -28,113 +28,136 @@ data SEGMENT
|
||||
|
||||
public Exception0Handle, TimerInterruptHandle, ExceptionStubHeaderSize
|
||||
|
||||
AGENT_HANDLER_SIGNATURE MACRO
|
||||
db 41h, 47h, 54h, 48h ; SIGNATURE_32('A','G','T','H')
|
||||
ENDM
|
||||
|
||||
ExceptionStubHeaderSize dw Exception1Handle - Exception0Handle ;
|
||||
CommonEntryAddr dq CommonEntry ;
|
||||
|
||||
.code
|
||||
|
||||
db 41h, 47h, 54h, 48h ; AGENT_HANDLER_SIGNATURE SIGNATURE_32('A','G','T','H')
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception0Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 0
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception1Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 1
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception2Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 2
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception3Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 3
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception4Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 4
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception5Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 5
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception6Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 6
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception7Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 7
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception8Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 8
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception9Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 9
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception10Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 10
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception11Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 11
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception12Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 12
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception13Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 13
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception14Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 14
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception15Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 15
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception16Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 16
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception17Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 17
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception18Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 18
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
Exception19Handle:
|
||||
cli
|
||||
push rcx
|
||||
mov rcx, 19
|
||||
jmp qword ptr [CommonEntryAddr]
|
||||
|
||||
AGENT_HANDLER_SIGNATURE
|
||||
TimerInterruptHandle:
|
||||
cli
|
||||
push rcx
|
||||
|
Reference in New Issue
Block a user