mirror of https://github.com/acidanthera/audk.git
a)Save and disable CPU interrupt before calling AsmWriteIdtr().
b)Restore CPU interrupt status after callng AsmWriteIdtr(). git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9956 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9612f0c23c
commit
ea99e00d76
|
@ -1014,6 +1014,7 @@ InitInterruptDescriptorTable (
|
||||||
IA32_DESCRIPTOR *IdtPtr;
|
IA32_DESCRIPTOR *IdtPtr;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN CurrentHandler;
|
UINTN CurrentHandler;
|
||||||
|
BOOLEAN InterruptState;
|
||||||
|
|
||||||
SetMem (ExternalVectorTable, sizeof(ExternalVectorTable), 0);
|
SetMem (ExternalVectorTable, sizeof(ExternalVectorTable), 0);
|
||||||
|
|
||||||
|
@ -1040,7 +1041,19 @@ InitInterruptDescriptorTable (
|
||||||
IdtPtr = ALIGN_POINTER (IdtPtrAlignmentBuffer, 16);
|
IdtPtr = ALIGN_POINTER (IdtPtrAlignmentBuffer, 16);
|
||||||
IdtPtr->Base = (UINT32)(((UINTN)(VOID*) gIdtTable) & (BASE_4GB-1));
|
IdtPtr->Base = (UINT32)(((UINTN)(VOID*) gIdtTable) & (BASE_4GB-1));
|
||||||
IdtPtr->Limit = sizeof (gIdtTable) - 1;
|
IdtPtr->Limit = sizeof (gIdtTable) - 1;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Disable interrupts and save the current interrupt state
|
||||||
|
//
|
||||||
|
InterruptState = SaveAndDisableInterrupts ();
|
||||||
|
|
||||||
AsmWriteIdtr (IdtPtr);
|
AsmWriteIdtr (IdtPtr);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Restore the interrupt state
|
||||||
|
//
|
||||||
|
SetInterruptState (InterruptState);
|
||||||
|
|
||||||
FreePool (IdtPtrAlignmentBuffer);
|
FreePool (IdtPtrAlignmentBuffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue