summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-07-27 02:35:24 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-07-27 02:35:24 +0000
commit805c2dd1198760778d6460280f5cc5e93a04d612 (patch)
tree8332525a90ed065afc8190b989f071e063732f8f /IntelFrameworkModulePkg
parentb90aefa9e46c2c2628bfbf62e43b366678b9af07 (diff)
downloadedk2-platforms-805c2dd1198760778d6460280f5cc5e93a04d612.tar.xz
Close the corresponding GUIDed section extraction protocol notify event in CloseSectionStream.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13563 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c b/IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c
index 9300f4dfe0..86bf2be632 100644
--- a/IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c
+++ b/IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtraction.c
@@ -75,6 +75,11 @@ typedef struct {
//
UINTN EncapsulatedStreamHandle;
EFI_GUID *EncapsulationGuid;
+ //
+ // If the section REQUIRES an extraction protocol, register for RPN
+ // when the required GUIDed extraction protocol becomes available.
+ //
+ EFI_EVENT Event;
} FRAMEWORK_SECTION_CHILD_NODE;
#define FRAMEWORK_SECTION_STREAM_SIGNATURE SIGNATURE_32('S','X','S','S')
@@ -100,7 +105,6 @@ typedef struct {
FRAMEWORK_SECTION_CHILD_NODE *ChildNode;
FRAMEWORK_SECTION_STREAM_NODE *ParentStream;
VOID *Registration;
- EFI_EVENT Event;
} RPN_EVENT_CONTEXT;
/**
@@ -602,12 +606,13 @@ NotifyGuidedExtraction (
}
//
- // If above, the stream did not close successfully, it indicates it's
- // alread been closed by someone, so just destroy the event and be done with
+ // If above, the stream did not close successfully, it indicates it's
+ // already been closed by someone, so just destroy the event and be done with
// it.
//
gBS->CloseEvent (Event);
+ Context->ChildNode->Event = NULL;
FreePool (Context);
}
@@ -636,14 +641,14 @@ CreateGuidedExtractionRpnEvent (
Context->ChildNode = ChildNode;
Context->ParentStream = ParentStream;
- Context->Event = CreateProtocolNotifyEvent (
- Context->ChildNode->EncapsulationGuid,
- TPL_NOTIFY,
- NotifyGuidedExtraction,
- Context,
- &Context->Registration,
- FALSE
- );
+ Context->ChildNode->Event = CreateProtocolNotifyEvent (
+ Context->ChildNode->EncapsulationGuid,
+ TPL_NOTIFY,
+ NotifyGuidedExtraction,
+ Context,
+ &Context->Registration,
+ FALSE
+ );
}
/**
@@ -695,7 +700,7 @@ CreateChildNode (
//
// Allocate a new node
//
- *ChildNode = AllocatePool (sizeof (FRAMEWORK_SECTION_CHILD_NODE));
+ *ChildNode = AllocateZeroPool (sizeof (FRAMEWORK_SECTION_CHILD_NODE));
Node = *ChildNode;
if (Node == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -1045,6 +1050,7 @@ FindChildNode (
CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));
for (;;) {
+ ASSERT (CurrentChildNode != NULL);
if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {
//
// The type matches, so check the instance count to see if it's the one we want
@@ -1061,7 +1067,6 @@ FindChildNode (
}
}
- ASSERT (CurrentChildNode != NULL);
if (CurrentChildNode->EncapsulatedStreamHandle != NULL_STREAM_HANDLE) {
//
// If the current node is an encapsulating node, recurse into it...
@@ -1339,6 +1344,11 @@ FreeChildNode (
//
CloseSectionStream (&mSectionExtraction, ChildNode->EncapsulatedStreamHandle);
}
+
+ if (ChildNode->Event != NULL) {
+ gBS->CloseEvent (ChildNode->Event);
+ }
+
//
// Last, free the child node itself
//