X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=UefiCpuPkg%2FCpuDxe%2FCpuDxe.c;h=66955c3f199a7d7591c1c0868cc8888229e06fa3;hp=424bc312ea6b96e403f78573796e7c2d3821dbe2;hb=01a1c0fc9e60dfd6b26bd6d9aa9c3a6242bbb608;hpb=6640eb366c5cc3df1d1c174ad95d9d1ec3f768cc diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index 424bc312ea..66955c3f19 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -1,8 +1,8 @@ /** @file CPU DXE Module. - Copyright (c) 2008 - 2010, Intel Corporation - All rights reserved. This program and the accompanying materials + Copyright (c) 2008 - 2010, Intel Corporation. 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 http://opensource.org/licenses/bsd-license.php @@ -590,6 +590,10 @@ CpuSetMemoryAttributes ( RETURN_STATUS Status; MTRR_MEMORY_CACHE_TYPE CacheType; + if (!IsMtrrSupported ()) { + return EFI_UNSUPPORTED; + } + DEBUG((EFI_D_ERROR, "CpuAp: SetMemorySpaceAttributes(BA=%08x, Len=%08x, Attr=%08x)\n", BaseAddress, Length, Attributes)); // @@ -856,7 +860,12 @@ RefreshGcdMemoryAttributes ( MTRR_FIXED_SETTINGS MtrrFixedSettings; UINT32 FirmwareVariableMtrrCount; + if (!IsMtrrSupported ()) { + return; + } + FirmwareVariableMtrrCount = GetFirmwareVariableMtrrCount (); + ASSERT (FirmwareVariableMtrrCount <= MTRR_NUMBER_OF_VARIABLE_MTRR); // mIsFlushingGCD = TRUE; mIsFlushingGCD = FALSE; @@ -1011,7 +1020,6 @@ InitInterruptDescriptorTable ( IA32_DESCRIPTOR *IdtPtr; UINTN Index; UINTN CurrentHandler; - BOOLEAN InterruptState; SetMem (ExternalVectorTable, sizeof(ExternalVectorTable), 0); @@ -1039,18 +1047,8 @@ InitInterruptDescriptorTable ( 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); //