Path: blob/main/stand/efi/include/Protocol/ServiceBinding.h
34884 views
/** @file1UEFI Service Binding Protocol is defined in UEFI specification.23The file defines the generic Service Binding Protocol functions.4It provides services that are required to create and destroy child5handles that support a given set of protocols.67Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>8This program and the accompanying materials9are licensed and made available under the terms and conditions of the BSD License10which accompanies this distribution. The full text of the license may be found at11http://opensource.org/licenses/bsd-license.php1213THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.1516**/1718#ifndef __EFI_SERVICE_BINDING_H__19#define __EFI_SERVICE_BINDING_H__2021///22/// Forward reference for pure ANSI compatibility23///24typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;2526/**27Creates a child handle and installs a protocol.2829The CreateChild() function installs a protocol on ChildHandle.30If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.31If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.3233@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.34@param ChildHandle Pointer to the handle of the child to create. If it is NULL,35then a new handle is created. If it is a pointer to an existing UEFI handle,36then the protocol is added to the existing UEFI handle.3738@retval EFI_SUCCES The protocol was added to ChildHandle.39@retval EFI_INVALID_PARAMETER ChildHandle is NULL.40@retval EFI_OUT_OF_RESOURCES There are not enough resources available to create41the child42@retval other The child handle was not created4344**/45typedef46EFI_STATUS47(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(48IN EFI_SERVICE_BINDING_PROTOCOL *This,49IN OUT EFI_HANDLE *ChildHandle50);5152/**53Destroys a child handle with a protocol installed on it.5455The DestroyChild() function does the opposite of CreateChild(). It removes a protocol56that was installed by CreateChild() from ChildHandle. If the removed protocol is the57last protocol on ChildHandle, then ChildHandle is destroyed.5859@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.60@param ChildHandle Handle of the child to destroy6162@retval EFI_SUCCES The protocol was removed from ChildHandle.63@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.64@retval EFI_INVALID_PARAMETER Child handle is NULL.65@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle66because its services are being used.67@retval other The child handle was not destroyed6869**/70typedef71EFI_STATUS72(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(73IN EFI_SERVICE_BINDING_PROTOCOL *This,74IN EFI_HANDLE ChildHandle75);7677///78/// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy79/// child handles. A driver is responsible for adding protocols to the child handle80/// in CreateChild() and removing protocols in DestroyChild(). It is also required81/// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER82/// to establish the parent-child relationship, and closes the protocol in DestroyChild().83/// The pseudo code for CreateChild() and DestroyChild() is provided to specify the84/// required behavior, not to specify the required implementation. Each consumer of85/// a software protocol is responsible for calling CreateChild() when it requires the86/// protocol and calling DestroyChild() when it is finished with that protocol.87///88struct _EFI_SERVICE_BINDING_PROTOCOL {89EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;90EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;91};9293#endif949596