]>
Commit | Line | Data |
---|---|---|
f1004231 LG |
1 | /** @file \r |
2 | UEFI Service Binding Protocol is defined in UEFI specification.\r | |
c311f86b | 3 | \r |
4ca9b6c4 LG |
4 | The file defines the generic Service Binding Protocol functions.\r |
5 | It provides services that are required to create and destroy child \r | |
6 | handles that support a given set of protocols.\r | |
c311f86b | 7 | \r |
4ca9b6c4 | 8 | Copyright (c) 2006 - 2008, Intel Corporation \r |
d1f95000 | 9 | All rights reserved. This program and the accompanying materials \r |
10 | are licensed and made available under the terms and conditions of the BSD License \r | |
11 | which accompanies this distribution. The full text of the license may be found at \r | |
12 | http://opensource.org/licenses/bsd-license.php \r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
16 | \r | |
d1f95000 | 17 | **/\r |
18 | \r | |
19 | #ifndef __EFI_SERVICE_BINDING_H__\r | |
20 | #define __EFI_SERVICE_BINDING_H__\r | |
21 | \r | |
99e8ed21 | 22 | ///\r |
23 | /// Forward reference for pure ANSI compatability\r | |
24 | ///\r | |
d1f95000 | 25 | typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;\r |
26 | \r | |
27 | /**\r | |
f1004231 LG |
28 | Creates a child handle and installs a protocol.\r |
29 | The CreateChild() function installs a protocol on ChildHandle. \r | |
30 | If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r | |
31 | If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r | |
d1f95000 | 32 | \r |
f1004231 LG |
33 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
34 | @param ChildHandle Pointer to the handle of the child to create. If it is NULL,\r | |
35 | then a new handle is created. If it is a pointer to an existing UEFI handle, \r | |
36 | then the protocol is added to the existing UEFI handle.\r | |
d1f95000 | 37 | \r |
f1004231 | 38 | @retval EFI_SUCCES The protocol was added to ChildHandle.\r |
d1f95000 | 39 | @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r |
40 | @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r | |
41 | the child\r | |
42 | @retval other The child handle was not created\r | |
43 | \r | |
44 | **/\r | |
45 | typedef\r | |
46 | EFI_STATUS\r | |
8b13229b | 47 | (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(\r |
d1f95000 | 48 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
49 | IN OUT EFI_HANDLE *ChildHandle\r | |
ed66e1bc | 50 | );\r |
d1f95000 | 51 | \r |
52 | /**\r | |
f1004231 LG |
53 | Destroys a child handle with a protocol installed on it.\r |
54 | The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r | |
55 | that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r | |
56 | last protocol on ChildHandle, then ChildHandle is destroyed.\r | |
d1f95000 | 57 | \r |
f1004231 | 58 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
d1f95000 | 59 | @param ChildHandle Handle of the child to destroy\r |
60 | \r | |
f1004231 LG |
61 | @retval EFI_SUCCES The protocol was removed from ChildHandle.\r |
62 | @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r | |
63 | @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.\r | |
64 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r | |
ee6c452c | 65 | because its services are being used.\r |
d1f95000 | 66 | @retval other The child handle was not destroyed\r |
67 | \r | |
68 | **/\r | |
69 | typedef\r | |
70 | EFI_STATUS\r | |
8b13229b | 71 | (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(\r |
d1f95000 | 72 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
73 | IN EFI_HANDLE ChildHandle\r | |
ed66e1bc | 74 | );\r |
d1f95000 | 75 | \r |
44717a39 | 76 | ///\r |
77 | /// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy \r | |
78 | /// child handles. A driver is responsible for adding protocols to the child handle \r | |
79 | /// in CreateChild() and removing protocols in DestroyChild(). It is also required \r | |
80 | /// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER \r | |
81 | /// to establish the parent-child relationship, and closes the protocol in DestroyChild().\r | |
82 | /// The pseudo code for CreateChild() and DestroyChild() is provided to specify the \r | |
83 | /// required behavior, not to specify the required implementation. Each consumer of \r | |
84 | /// a software protocol is responsible for calling CreateChild() when it requires the \r | |
85 | /// protocol and calling DestroyChild() when it is finished with that protocol.\r | |
86 | ///\r | |
d1f95000 | 87 | struct _EFI_SERVICE_BINDING_PROTOCOL {\r |
88 | EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;\r | |
89 | EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;\r | |
90 | };\r | |
91 | \r | |
92 | #endif\r |