44 if ((This ==
NULL) || (ChildHandle ==
NULL)) {
45 return EFI_INVALID_PARAMETER;
48 Hash2ServiceData = HASH2_SERVICE_DATA_FROM_THIS (This);
54 if (Instance ==
NULL) {
55 return EFI_OUT_OF_RESOURCES;
61 Instance->Signature = HASH2_INSTANCE_DATA_SIGNATURE;
62 CopyMem (&Instance->Hash2Protocol, &mHash2Protocol, sizeof (Instance->Hash2Protocol));
63 Instance->Hash2ServiceData = Hash2ServiceData;
65 Status =
gBS->InstallMultipleProtocolInterfaces (
67 &gEfiHash2ProtocolGuid,
68 &Instance->Hash2Protocol,
71 if (EFI_ERROR (Status)) {
76 Instance->Handle = *ChildHandle;
81 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
83 InsertTailList (&Hash2ServiceData->ChildrenList, &Instance->InstEntry);
85 gBS->RestoreTPL (OldTpl);
125 if ((This ==
NULL) || (ChildHandle ==
NULL)) {
126 return EFI_INVALID_PARAMETER;
129 Hash2ServiceData = HASH2_SERVICE_DATA_FROM_THIS (This);
135 for (Entry = (&Hash2ServiceData->ChildrenList)->ForwardLink; Entry != (&Hash2ServiceData->ChildrenList); Entry = Entry->ForwardLink) {
136 Instance = HASH2_INSTANCE_DATA_FROM_LINK (Entry);
137 if (Instance->Handle == ChildHandle) {
144 if (Instance ==
NULL) {
145 DEBUG ((DEBUG_ERROR,
"Hash2ServiceBindingDestroyChild - Invalid handle\n"));
146 return EFI_UNSUPPORTED;
152 Status =
gBS->HandleProtocol (
154 &gEfiHash2ProtocolGuid,
155 (VOID **)&Hash2Protocol
157 if (EFI_ERROR (Status)) {
161 ASSERT (Hash2Protocol == &Instance->Hash2Protocol);
166 Status =
gBS->UninstallMultipleProtocolInterfaces (
168 &gEfiHash2ProtocolGuid,
169 &Instance->Hash2Protocol,
172 if (EFI_ERROR (Status)) {
176 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
183 gBS->RestoreTPL (OldTpl);
214 if (Hash2ServiceData ==
NULL) {
215 return EFI_OUT_OF_RESOURCES;
218 Hash2ServiceData->Signature = HASH2_SERVICE_DATA_SIGNATURE;
225 Status =
gBS->InstallMultipleProtocolInterfaces (
226 &Hash2ServiceData->ServiceHandle,
227 &gEfiHash2ServiceBindingProtocolGuid,
228 &Hash2ServiceData->ServiceBinding,
231 if (EFI_ERROR (Status)) {
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define DEBUG(Expression)
EFI_STATUS EFIAPI Hash2ServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI Hash2DriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI Hash2ServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)