diff options
author | Star Zeng <star.zeng@intel.com> | 2014-08-27 08:31:44 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-08-27 08:31:44 +0000 |
commit | eb1cace292ff0c66ca11eff4703c9fa16219c2a1 (patch) | |
tree | 83d468a07e859d38d11fe74e8c1edacd634352fb /MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c | |
parent | 436296125b1b013b211d7cfa80df5ea9421bfebd (diff) | |
download | edk2-platforms-eb1cace292ff0c66ca11eff4703c9fa16219c2a1.tar.xz |
MdeModulePkg DxeCore: Don't cache memory mapped IO FV.
Previous DxeCore FwVol code will cache whole FvMain FV from flash that may be
uncached if platform reports FvMain FVB, it will impact DXE performance.
The code already has file level cache, so don’t need to cache memory mapped IO FV.
It can also reduce memory consumption of caching memory mapped IO FVs.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15916 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c')
-rw-r--r-- | MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index 981744c4d3..3c4f3f58db 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -440,7 +440,7 @@ OpenSectionStream ( return OpenSectionStreamEx (
SectionStreamLength,
SectionStream,
- TRUE,
+ FALSE,
0,
SectionStreamHandle
);
@@ -1344,7 +1344,7 @@ FreeChildNode ( // If it's an encapsulating section, we close the resulting section stream.
// CloseSectionStream will free all memory associated with the stream.
//
- CloseSectionStream (ChildNode->EncapsulatedStreamHandle);
+ CloseSectionStream (ChildNode->EncapsulatedStreamHandle, TRUE);
}
if (ChildNode->Event != NULL) {
@@ -1362,6 +1362,8 @@ FreeChildNode ( SEP member function. Deletes an existing section stream
@param StreamHandleToClose Indicates the stream to close
+ @param FreeStreamBuffer TRUE - Need to free stream buffer;
+ FALSE - No need to free stream buffer.
@retval EFI_SUCCESS The section stream is closed sucessfully.
@retval EFI_OUT_OF_RESOURCES Memory allocation failed.
@@ -1372,7 +1374,8 @@ FreeChildNode ( EFI_STATUS
EFIAPI
CloseSectionStream (
- IN UINTN StreamHandleToClose
+ IN UINTN StreamHandleToClose,
+ IN BOOLEAN FreeStreamBuffer
)
{
CORE_SECTION_STREAM_NODE *StreamNode;
@@ -1397,7 +1400,9 @@ CloseSectionStream ( ChildNode = CHILD_SECTION_NODE_FROM_LINK (Link);
FreeChildNode (ChildNode);
}
- CoreFreePool (StreamNode->StreamBuffer);
+ if (FreeStreamBuffer) {
+ CoreFreePool (StreamNode->StreamBuffer);
+ }
CoreFreePool (StreamNode);
Status = EFI_SUCCESS;
} else {
|