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@9965 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2010-02-10 06:48:34 +00:00
parent 852081fc68
commit 0cf27ce078
1 changed files with 31 additions and 19 deletions

View File

@ -1,7 +1,7 @@
/** @file
Ia32-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
Copyright (c) 2006 - 2010, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -70,6 +70,8 @@ HandOffToDxeCore (
VOID *TemplateBase;
EFI_PHYSICAL_ADDRESS VectorAddress;
UINT32 Index;
BOOLEAN InterruptState;
Status = PeiServicesAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (STACK_SIZE), &BaseOfStack);
ASSERT_EFI_ERROR (Status);
@ -141,8 +143,18 @@ HandOffToDxeCore (
}
gLidtDescriptor.Base = (UINTN) IdtTable;
//
// Disable interrupts and save the current interrupt state
//
InterruptState = SaveAndDisableInterrupts ();
AsmWriteIdtr (&gLidtDescriptor);
//
// Restore the interrupt state
//
SetInterruptState (InterruptState);
//
// Go to Long Mode and transfer control to DxeCore.