diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-09 09:23:17 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-09 09:23:17 +0000 |
commit | ea99e00d7694f2dc9ece9647b59f296d2f70700f (patch) | |
tree | 106bb62870d2a740a650b50718b7b23cbdb6f0d0 /UefiCpuPkg | |
parent | 9612f0c23c02401ace0a9f02e2bed649f83c97dd (diff) | |
download | edk2-ea99e00d7694f2dc9ece9647b59f296d2f70700f.zip edk2-ea99e00d7694f2dc9ece9647b59f296d2f70700f.tar.gz edk2-ea99e00d7694f2dc9ece9647b59f296d2f70700f.tar.bz2 |
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
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r-- | UefiCpuPkg/CpuDxe/CpuDxe.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index 68579a7..2895da8 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -1014,6 +1014,7 @@ InitInterruptDescriptorTable ( IA32_DESCRIPTOR *IdtPtr;
UINTN Index;
UINTN CurrentHandler;
+ BOOLEAN InterruptState;
SetMem (ExternalVectorTable, sizeof(ExternalVectorTable), 0);
@@ -1040,7 +1041,19 @@ InitInterruptDescriptorTable ( IdtPtr = ALIGN_POINTER (IdtPtrAlignmentBuffer, 16);
IdtPtr->Base = (UINT32)(((UINTN)(VOID*) gIdtTable) & (BASE_4GB-1));
IdtPtr->Limit = sizeof (gIdtTable) - 1;
+
+ //
+ // Disable interrupts and save the current interrupt state
+ //
+ InterruptState = SaveAndDisableInterrupts ();
+
AsmWriteIdtr (IdtPtr);
+
+ //
+ // Restore the interrupt state
+ //
+ SetInterruptState (InterruptState);
+
FreePool (IdtPtrAlignmentBuffer);
//
|