]>
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 | 28 | Creates a child handle and installs a protocol.\r |
be973ff7 | 29 | \r |
f1004231 LG |
30 | The CreateChild() function installs a protocol on ChildHandle. \r |
31 | If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r | |
32 | If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r | |
d1f95000 | 33 | \r |
f1004231 LG |
34 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
35 | @param ChildHandle Pointer to the handle of the child to create. If it is NULL,\r | |
36 | then a new handle is created. If it is a pointer to an existing UEFI handle, \r | |
37 | then the protocol is added to the existing UEFI handle.\r | |
d1f95000 | 38 | \r |
f1004231 | 39 | @retval EFI_SUCCES The protocol was added to ChildHandle.\r |
d1f95000 | 40 | @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r |
41 | @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create\r | |
42 | the child\r | |
43 | @retval other The child handle was not created\r | |
44 | \r | |
45 | **/\r | |
46 | typedef\r | |
47 | EFI_STATUS\r | |
8b13229b | 48 | (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(\r |
d1f95000 | 49 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
50 | IN OUT EFI_HANDLE *ChildHandle\r | |
ed66e1bc | 51 | );\r |
d1f95000 | 52 | \r |
53 | /**\r | |
f1004231 | 54 | Destroys a child handle with a protocol installed on it.\r |
be973ff7 | 55 | \r |
f1004231 LG |
56 | The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r |
57 | that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r | |
58 | last protocol on ChildHandle, then ChildHandle is destroyed.\r | |
d1f95000 | 59 | \r |
f1004231 | 60 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
d1f95000 | 61 | @param ChildHandle Handle of the child to destroy\r |
62 | \r | |
f1004231 LG |
63 | @retval EFI_SUCCES The protocol was removed from ChildHandle.\r |
64 | @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r | |
65 | @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.\r | |
66 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r | |
ee6c452c | 67 | because its services are being used.\r |
d1f95000 | 68 | @retval other The child handle was not destroyed\r |
69 | \r | |
70 | **/\r | |
71 | typedef\r | |
72 | EFI_STATUS\r | |
8b13229b | 73 | (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(\r |
d1f95000 | 74 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
75 | IN EFI_HANDLE ChildHandle\r | |
ed66e1bc | 76 | );\r |
d1f95000 | 77 | \r |
44717a39 | 78 | ///\r |
79 | /// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy \r | |
80 | /// child handles. A driver is responsible for adding protocols to the child handle \r | |
81 | /// in CreateChild() and removing protocols in DestroyChild(). It is also required \r | |
82 | /// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER \r | |
83 | /// to establish the parent-child relationship, and closes the protocol in DestroyChild().\r | |
84 | /// The pseudo code for CreateChild() and DestroyChild() is provided to specify the \r | |
85 | /// required behavior, not to specify the required implementation. Each consumer of \r | |
86 | /// a software protocol is responsible for calling CreateChild() when it requires the \r | |
87 | /// protocol and calling DestroyChild() when it is finished with that protocol.\r | |
88 | ///\r | |
d1f95000 | 89 | struct _EFI_SERVICE_BINDING_PROTOCOL {\r |
90 | EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;\r | |
91 | EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;\r | |
92 | };\r | |
93 | \r | |
94 | #endif\r |