mirror of https://github.com/acidanthera/audk.git
CpuExceptionHandlerLib: Refactored out mSwitchCr3Flag.
This commit is contained in:
parent
93625d5489
commit
1f8f6ddc81
UefiCpuPkg/Library/CpuExceptionHandlerLib
|
@ -34,7 +34,6 @@ EXCEPTION_ADDRESSES mAddresses;
|
|||
|
||||
extern UINTN ExceptionHandlerBase;
|
||||
extern UINTN ExceptionHandlerEnd;
|
||||
extern UINT8 mSwitchCr3Flag;
|
||||
extern UINTN CorePageTable;
|
||||
|
||||
/**
|
||||
|
@ -203,8 +202,6 @@ GetExceptionAddresses (
|
|||
VOID
|
||||
)
|
||||
{
|
||||
mSwitchCr3Flag = 1;
|
||||
|
||||
return &mAddresses;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,6 @@ global ASM_PFX(UserPageTable)
|
|||
ASM_PFX(UserPageTable):
|
||||
resq 1
|
||||
|
||||
global ASM_PFX(mSwitchCr3Flag)
|
||||
ASM_PFX(mSwitchCr3Flag):
|
||||
db 0x0
|
||||
|
||||
ALIGN 4096
|
||||
Padding:
|
||||
db 0x0
|
||||
|
@ -105,7 +101,9 @@ HookAfterStubHeaderEnd:
|
|||
global ASM_PFX(CommonInterruptEntry)
|
||||
ASM_PFX(CommonInterruptEntry):
|
||||
cli
|
||||
cmp byte [ASM_PFX(mSwitchCr3Flag)], 0
|
||||
; Check whether User Space process was interrupted.
|
||||
mov eax, ds
|
||||
and eax, 3
|
||||
jz NoCr3Switch
|
||||
mov eax, cr3
|
||||
mov [ASM_PFX(UserPageTable)], eax
|
||||
|
|
|
@ -63,10 +63,6 @@ global ASM_PFX(UserPageTable)
|
|||
ASM_PFX(UserPageTable):
|
||||
resq 1
|
||||
|
||||
global ASM_PFX(mSwitchCr3Flag)
|
||||
ASM_PFX(mSwitchCr3Flag):
|
||||
db 0x0
|
||||
|
||||
ALIGN 4096
|
||||
Padding:
|
||||
db 0x0
|
||||
|
@ -140,7 +136,9 @@ HookAfterStubHeaderEnd:
|
|||
global ASM_PFX(CommonInterruptEntry)
|
||||
ASM_PFX(CommonInterruptEntry):
|
||||
cli
|
||||
cmp byte [ASM_PFX(mSwitchCr3Flag)], 0
|
||||
; Check whether User Space process was interrupted.
|
||||
mov rax, ds
|
||||
and rax, 3
|
||||
jz NoCr3Switch
|
||||
mov rax, cr3
|
||||
mov [ASM_PFX(UserPageTable)], rax
|
||||
|
|
Loading…
Reference in New Issue