summaryrefslogtreecommitdiffstats
path: root/DuetPkg/DxeIpl
diff options
context:
space:
mode:
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-30 05:47:12 +0000
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-30 05:47:12 +0000
commitd569cbb0d1ebf786f4daa7ed6c4533b927335174 (patch)
tree62bb98a6680c1b82894f9b0083a2a5ffc7d9bf1a /DuetPkg/DxeIpl
parent5540f4aa180a122bc4cce664390b9b8f5222521b (diff)
downloadedk2-d569cbb0d1ebf786f4daa7ed6c4533b927335174.tar.gz
edk2-d569cbb0d1ebf786f4daa7ed6c4533b927335174.tar.bz2
edk2-d569cbb0d1ebf786f4daa7ed6c4533b927335174.zip
Fix system memory map issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8685 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/DxeIpl')
-rw-r--r--DuetPkg/DxeIpl/DxeInit.c49
-rw-r--r--DuetPkg/DxeIpl/HobGeneration.c46
-rw-r--r--DuetPkg/DxeIpl/HobGeneration.h6
3 files changed, 90 insertions, 11 deletions
diff --git a/DuetPkg/DxeIpl/DxeInit.c b/DuetPkg/DxeIpl/DxeInit.c
index dff64b4856..bee7f11307 100644
--- a/DuetPkg/DxeIpl/DxeInit.c
+++ b/DuetPkg/DxeIpl/DxeInit.c
@@ -78,14 +78,16 @@ MemoryAbove1MB.PhysicalStart <--------------------------------------------------
<------------------------------+ | |
Permament Stack (0x20 Pages = 128K) | |
<- Phit.EfiMemoryTop ----------+-----------+---------------+
- DxeCore |
- DxeCore
- DxeIpl |
- <----------------------------------------------------------+
- NvFV + FtwFV |
+ NvFV (64K) |
MMIO
- BFV |
- <- Top of Free Memory reported by E820 --------------------+
+ FtwFV (128K) |
+ <----------------------------------------------------------+<---------+
+ DxeCore | |
+ DxeCore |
+ DxeIpl | Allocated in EfiLdr
+ <----------------------------------------------------------+ |
+ BFV MMIO |
+ <- Top of Free Memory reported by E820 --------------------+<---------+
ACPINVS or
ACPIReclaim or
Reserved
@@ -267,11 +269,44 @@ Returns:
PrintString(" Length = ");
PrintValue64(gHob->NvFtwFvb.FvbInfo.Entries[0].Length);
PrintString("\n");
+ PrintString("BfvResource = ");
+ PrintValue64(gHob->BfvResource.PhysicalStart);
+ PrintString(" Length = ");
+ PrintValue64(gHob->BfvResource.ResourceLength);
+ PrintString("\n");
+ PrintString("NvStorageFvResource = ");
+ PrintValue64(gHob->NvStorageFvResource.PhysicalStart);
+ PrintString(" Length = ");
+ PrintValue64(gHob->NvStorageFvResource.ResourceLength);
+ PrintString("\n");
+ PrintString("NvStorage = ");
+ PrintValue64(gHob->NvStorage.FvbInfo.Entries[0].Base);
+ PrintString(" Length = ");
+ PrintValue64(gHob->NvStorage.FvbInfo.Entries[0].Length);
+ PrintString("\n");
+ PrintString("NvFtwFvResource = ");
+ PrintValue64(gHob->NvFtwFvResource.PhysicalStart);
+ PrintString(" Length = ");
+ PrintValue64(gHob->NvFtwFvResource.ResourceLength);
+ PrintString("\n");
+ PrintString("NvFtwWorking = ");
+ PrintValue64(gHob->NvFtwWorking.FvbInfo.Entries[0].Base);
+ PrintString(" Length = ");
+ PrintValue64(gHob->NvFtwWorking.FvbInfo.Entries[0].Length);
+ PrintString("\n");
+ PrintString("NvFtwSpare = ");
+ PrintValue64(gHob->NvFtwSpare.FvbInfo.Entries[0].Base);
+ PrintString(" Length = ");
+ PrintValue64(gHob->NvFtwSpare.FvbInfo.Entries[0].Length);
+ PrintString("\n");
PrintString("Stack = ");
PrintValue64(gHob->Stack.AllocDescriptor.MemoryBaseAddress);
PrintString(" StackLength = ");
PrintValue64(gHob->Stack.AllocDescriptor.MemoryLength);
PrintString("\n");
+ PrintString("PageTable = ");
+ PrintValue64((UINTN)PageTableBase);
+ PrintString("\n");
PrintString("MemoryFreeUnder1MB = ");
PrintValue64(gHob->MemoryFreeUnder1MB.PhysicalStart);
PrintString(" MemoryFreeUnder1MBLength = ");
diff --git a/DuetPkg/DxeIpl/HobGeneration.c b/DuetPkg/DxeIpl/HobGeneration.c
index ebe6788877..224d6a710e 100644
--- a/DuetPkg/DxeIpl/HobGeneration.c
+++ b/DuetPkg/DxeIpl/HobGeneration.c
@@ -190,6 +190,26 @@ HOB_TEMPLATE gHobTemplate = {
EFI_DXE_FILE_GUID,
0x0 // EFI_PHYSICAL_ADDRESS of EntryPoint;
},
+ { // MemoryDxeCore
+ {
+ EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, // HobType
+ sizeof (EFI_HOB_RESOURCE_DESCRIPTOR), // HobLength
+ 0 // Reserved
+ },
+ {
+ 0 // Owner Guid
+ },
+ EFI_RESOURCE_SYSTEM_MEMORY, // ResourceType
+ (EFI_RESOURCE_ATTRIBUTE_PRESENT |
+// EFI_RESOURCE_ATTRIBUTE_TESTED | // Do not mark as TESTED, or DxeCore will find it and use it before check Allocation
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE),
+ 0x0, // PhysicalStart
+ 0 // ResourceLength
+ },
{ // Memory Map Hints to reduce fragmentation in the memory map
{
{
@@ -453,6 +473,23 @@ HOB_TEMPLATE gHobTemplate = {
0
}
},
+ { // NV Ftw FV Resource
+ {
+ EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, // HobType
+ sizeof (EFI_HOB_RESOURCE_DESCRIPTOR), // HobLength
+ 0 // Reserved
+ },
+ {
+ 0 // Owner Guid
+ },
+ EFI_RESOURCE_FIRMWARE_DEVICE, // ResourceType
+ (EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ EFI_RESOURCE_ATTRIBUTE_TESTED |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE), // ResourceAttribute
+ 0, // PhysicalStart (Fixed later)
+ NV_FTW_FVB_SIZE // ResourceLength
+ },
{ // FVB holding FTW spaces including Working & Spare space
{
{
@@ -703,9 +740,13 @@ PrepareHobDxeCore (
UINT64 DxeCoreLength
)
{
- gHob->DxeCore.MemoryAllocationHeader.MemoryBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)DxeCoreImageBase;
+ gHob->DxeCore.MemoryAllocationHeader.MemoryBaseAddress = DxeCoreImageBase;
gHob->DxeCore.MemoryAllocationHeader.MemoryLength = DxeCoreLength;
gHob->DxeCore.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)DxeCoreEntryPoint;
+
+
+ gHob->MemoryDxeCore.PhysicalStart = DxeCoreImageBase;
+ gHob->MemoryDxeCore.ResourceLength = DxeCoreLength;
}
VOID *
@@ -878,7 +919,8 @@ PrepareHobNvStorage (
// Create the FVB holding FTW spaces
//
FtwFvbBase = (EFI_PHYSICAL_ADDRESS)((UINTN) StorageFvbBase + NV_STORAGE_FVB_SIZE);
- gHob->NvFtwFvb.FvbInfo.Entries[0].Base = FtwFvbBase;
+ gHob->NvFtwFvResource.PhysicalStart =
+ gHob->NvFtwFvb.FvbInfo.Entries[0].Base = FtwFvbBase;
//
// Put FTW Working in front
//
diff --git a/DuetPkg/DxeIpl/HobGeneration.h b/DuetPkg/DxeIpl/HobGeneration.h
index 61d2e9966f..021b3ed501 100644
--- a/DuetPkg/DxeIpl/HobGeneration.h
+++ b/DuetPkg/DxeIpl/HobGeneration.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2009, 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
@@ -84,6 +84,7 @@ typedef struct {
EFI_HOB_RESOURCE_DESCRIPTOR MemoryAbove1MB;
EFI_HOB_RESOURCE_DESCRIPTOR MemoryAbove4GB;
EFI_HOB_MEMORY_ALLOCATION_MODULE DxeCore;
+ EFI_HOB_RESOURCE_DESCRIPTOR MemoryDxeCore;
MEMORY_TYPE_INFORMATION_HOB MemoryTypeInfo;
TABLE_HOB Acpi;
TABLE_HOB Acpi20;
@@ -105,7 +106,8 @@ typedef struct {
FVB_HOB NvStorageFvb;
FVB_HOB NvStorage;
-
+
+ EFI_HOB_RESOURCE_DESCRIPTOR NvFtwFvResource;
FVB_HOB NvFtwFvb;
FVB_HOB NvFtwWorking;
FVB_HOB NvFtwSpare;