0x40000,\r
&Granularity\r
);\r
+\r
+ if ((Private->Legacy16Table->TableLength >= OFFSET_OF (EFI_COMPATIBILITY16_TABLE, HiPermanentMemoryAddress)) &&\r
+ ((Private->Legacy16Table->UmaAddress != 0) && (Private->Legacy16Table->UmaSize != 0))) {\r
+ //\r
+ // Here we could reduce UmaAddress down as far as Private->OptionRom, taking into\r
+ // account the granularity of the access control.\r
+ //\r
+ DEBUG((EFI_D_INFO, "Unlocking UMB RAM region 0x%x-0x%x\n", Private->Legacy16Table->UmaAddress,\r
+ Private->Legacy16Table->UmaAddress + Private->Legacy16Table->UmaSize));\r
+\r
+ Private->LegacyRegion->UnLock (\r
+ Private->LegacyRegion,\r
+ Private->Legacy16Table->UmaAddress,\r
+ Private->Legacy16Table->UmaSize,\r
+ &Granularity\r
+ );\r
+ }\r
+\r
//\r
// Lock attributes of the Legacy Region if chipset supports\r
//\r
/** @file\r
\r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
UINT32 LocalTime;\r
UINT32 StartBbsIndex;\r
UINT32 EndBbsIndex;\r
+ UINT32 MaxRomAddr;\r
UINTN TempData;\r
UINTN InitAddress;\r
UINTN RuntimeAddress;\r
Function = 0;\r
VideoMode = 0;\r
PhysicalAddress = 0;\r
+ MaxRomAddr = PcdGet32 (PcdEndOpromShadowAddress);\r
+\r
+ if ((Private->Legacy16Table->TableLength >= OFFSET_OF(EFI_COMPATIBILITY16_TABLE, HiPermanentMemoryAddress)) &&\r
+ (Private->Legacy16Table->UmaAddress != 0) && \r
+ (Private->Legacy16Table->UmaSize != 0) &&\r
+ (MaxRomAddr > (Private->Legacy16Table->UmaAddress))) {\r
+ MaxRomAddr = Private->Legacy16Table->UmaAddress;\r
+ }\r
+\r
\r
PciProgramAllInterruptLineRegisters (Private);\r
\r
// then test if there is enough space for its RT code\r
//\r
RuntimeAddress = Private->OptionRom;\r
- if (RuntimeAddress + *RuntimeImageLength > PcdGet32 (PcdEndOpromShadowAddress)) {\r
+ if (RuntimeAddress + *RuntimeImageLength > MaxRomAddr) {\r
DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
gBS->FreePages (PhysicalAddress, EFI_SIZE_TO_PAGES (ImageSize));\r
//\r
// test if there is enough space for its INIT code\r
//\r
InitAddress = PCI_START_ADDRESS (Private->OptionRom);\r
- if (InitAddress + ImageSize > PcdGet32 (PcdEndOpromShadowAddress)) {\r
+ if (InitAddress + ImageSize > MaxRomAddr) {\r
DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
//\r
// Report Status Code to indicate that there is no enough space for OpROM\r