mirror of https://github.com/acidanthera/audk.git
Merge EDK899: fixed bug to support EFI_HOB_TYPE_MEMORY_ALLOCATION to allocate resource in PEI
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4289 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a3a15d2108
commit
f942f10760
|
@ -2415,18 +2415,18 @@ Returns:
|
||||||
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
|
if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
|
||||||
MemoryHob = Hob.MemoryAllocation;
|
MemoryHob = Hob.MemoryAllocation;
|
||||||
BaseAddress = MemoryHob->AllocDescriptor.MemoryBaseAddress;
|
BaseAddress = MemoryHob->AllocDescriptor.MemoryBaseAddress;
|
||||||
Status = CoreAllocateMemorySpace (
|
Status = CoreGetMemorySpaceDescriptor (BaseAddress, &Descriptor);
|
||||||
EfiGcdAllocateAddress,
|
|
||||||
EfiGcdMemoryTypeSystemMemory,
|
|
||||||
0,
|
|
||||||
MemoryHob->AllocDescriptor.MemoryLength,
|
|
||||||
&BaseAddress,
|
|
||||||
gDxeCoreImageHandle,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Status = CoreGetMemorySpaceDescriptor (MemoryHob->AllocDescriptor.MemoryBaseAddress, &Descriptor);
|
Status = CoreAllocateMemorySpace (
|
||||||
if (!EFI_ERROR (Status)) {
|
EfiGcdAllocateAddress,
|
||||||
|
Descriptor.GcdMemoryType,
|
||||||
|
0,
|
||||||
|
MemoryHob->AllocDescriptor.MemoryLength,
|
||||||
|
&BaseAddress,
|
||||||
|
gDxeCoreImageHandle,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status) && Descriptor.GcdMemoryType == EfiGcdMemoryTypeSystemMemory) {
|
||||||
CoreAddMemoryDescriptor (
|
CoreAddMemoryDescriptor (
|
||||||
MemoryHob->AllocDescriptor.MemoryType,
|
MemoryHob->AllocDescriptor.MemoryType,
|
||||||
MemoryHob->AllocDescriptor.MemoryBaseAddress,
|
MemoryHob->AllocDescriptor.MemoryBaseAddress,
|
||||||
|
|
Loading…
Reference in New Issue