diff options
author | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-27 02:35:24 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-07-27 02:35:24 +0000 |
commit | 805c2dd1198760778d6460280f5cc5e93a04d612 (patch) | |
tree | 8332525a90ed065afc8190b989f071e063732f8f /MdeModulePkg/Core/Dxe | |
parent | b90aefa9e46c2c2628bfbf62e43b366678b9af07 (diff) | |
download | edk2-805c2dd1198760778d6460280f5cc5e93a04d612.zip edk2-805c2dd1198760778d6460280f5cc5e93a04d612.tar.gz edk2-805c2dd1198760778d6460280f5cc5e93a04d612.tar.bz2 |
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 'MdeModulePkg/Core/Dxe')
-rw-r--r-- | MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c index 8d8f9c8..40304b9 100644 --- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c +++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c @@ -66,6 +66,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;
} CORE_SECTION_CHILD_NODE;
#define CORE_SECTION_STREAM_SIGNATURE SIGNATURE_32('S','X','S','S')
@@ -91,7 +96,6 @@ typedef struct { CORE_SECTION_CHILD_NODE *ChildNode;
CORE_SECTION_STREAM_NODE *ParentStream;
VOID *Registration;
- EFI_EVENT Event;
} RPN_EVENT_CONTEXT;
@@ -558,6 +562,7 @@ NotifyGuidedExtraction ( // Close the event when done.
//
gBS->CloseEvent (Event);
+ Context->ChildNode->Event = NULL;
FreePool (Context);
}
@@ -585,13 +590,13 @@ CreateGuidedExtractionRpnEvent ( Context->ChildNode = ChildNode;
Context->ParentStream = ParentStream;
- Context->Event = EfiCreateProtocolNotifyEvent (
- Context->ChildNode->EncapsulationGuid,
- TPL_NOTIFY,
- NotifyGuidedExtraction,
- Context,
- &Context->Registration
- );
+ Context->ChildNode->Event = EfiCreateProtocolNotifyEvent (
+ Context->ChildNode->EncapsulationGuid,
+ TPL_NOTIFY,
+ NotifyGuidedExtraction,
+ Context,
+ &Context->Registration
+ );
}
/**
@@ -646,7 +651,7 @@ CreateChildNode ( //
// Allocate a new node
//
- *ChildNode = AllocatePool (sizeof (CORE_SECTION_CHILD_NODE));
+ *ChildNode = AllocateZeroPool (sizeof (CORE_SECTION_CHILD_NODE));
Node = *ChildNode;
if (Node == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -1289,6 +1294,11 @@ FreeChildNode ( //
CloseSectionStream (ChildNode->EncapsulatedStreamHandle);
}
+
+ if (ChildNode->Event != NULL) {
+ gBS->CloseEvent (ChildNode->Event);
+ }
+
//
// Last, free the child node itself
//
|