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