iPXE
ServiceBinding.h
Go to the documentation of this file.
1 /** @file
2  UEFI Service Binding Protocol is defined in UEFI specification.
3 
4  The file defines the generic Service Binding Protocol functions.
5  It provides services that are required to create and destroy child
6  handles that support a given set of protocols.
7 
8  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9  SPDX-License-Identifier: BSD-2-Clause-Patent
10 
11 **/
12 
13 #ifndef __EFI_SERVICE_BINDING_H__
14 #define __EFI_SERVICE_BINDING_H__
15 
16 FILE_LICENCE ( BSD2_PATENT );
17 FILE_SECBOOT ( PERMITTED );
18 
19 ///
20 /// Forward reference for pure ANSI compatability
21 ///
23 
24 /**
25  Creates a child handle and installs a protocol.
26 
27  The CreateChild() function installs a protocol on ChildHandle.
28  If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
29  If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
30 
31  @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
32  @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
33  then a new handle is created. If it is a pointer to an existing UEFI handle,
34  then the protocol is added to the existing UEFI handle.
35 
36  @retval EFI_SUCCES The protocol was added to ChildHandle.
37  @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
38  @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
39  the child
40  @retval other The child handle was not created
41 
42 **/
43 typedef
47  IN OUT EFI_HANDLE *ChildHandle
48  );
49 
50 /**
51  Destroys a child handle with a protocol installed on it.
52 
53  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
54  that was installed by CreateChild() from ChildHandle. If the removed protocol is the
55  last protocol on ChildHandle, then ChildHandle is destroyed.
56 
57  @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
58  @param ChildHandle Handle of the child to destroy
59 
60  @retval EFI_SUCCES The protocol was removed from ChildHandle.
61  @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
62  @retval EFI_INVALID_PARAMETER Child handle is NULL.
63  @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
64  because its services are being used.
65  @retval other The child handle was not destroyed
66 
67 **/
68 typedef
72  IN EFI_HANDLE ChildHandle
73  );
74 
75 ///
76 /// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
77 /// child handles. A driver is responsible for adding protocols to the child handle
78 /// in CreateChild() and removing protocols in DestroyChild(). It is also required
79 /// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
80 /// to establish the parent-child relationship, and closes the protocol in DestroyChild().
81 /// The pseudo code for CreateChild() and DestroyChild() is provided to specify the
82 /// required behavior, not to specify the required implementation. Each consumer of
83 /// a software protocol is responsible for calling CreateChild() when it requires the
84 /// protocol and calling DestroyChild() when it is finished with that protocol.
85 ///
89 };
90 
91 #endif
EFI_SERVICE_BINDING_CREATE_CHILD CreateChild
#define OUT
Definition: mlx_utils.h:29
EFI_STATUS(EFIAPI * EFI_SERVICE_BINDING_DESTROY_CHILD)(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
Destroys a child handle with a protocol installed on it.
EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild
#define EFIAPI
The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy child handles.
#define IN
Definition: mlx_utils.h:28
FILE_SECBOOT(PERMITTED)
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
FILE_LICENCE(BSD2_PATENT)
EFI_STATUS(EFIAPI * EFI_SERVICE_BINDING_CREATE_CHILD)(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
Creates a child handle and installs a protocol.
Definition: efi.h:62