]>
Commit | Line | Data |
---|---|---|
1 | /** @file \r | |
2 | UEFI Service Binding Protocol is defined in UEFI specification.\r | |
3 | \r | |
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 | |
7 | \r | |
8 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
9 | 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 | |
17 | **/\r | |
18 | \r | |
19 | #ifndef __EFI_SERVICE_BINDING_H__\r | |
20 | #define __EFI_SERVICE_BINDING_H__\r | |
21 | \r | |
22 | ///\r | |
23 | /// Forward reference for pure ANSI compatability\r | |
24 | ///\r | |
25 | typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;\r | |
26 | \r | |
27 | /**\r | |
28 | Creates a child handle and installs a protocol.\r | |
29 | \r | |
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 | |
33 | \r | |
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 | |
38 | \r | |
39 | @retval EFI_SUCCES The protocol was added to ChildHandle.\r | |
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 | |
48 | (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(\r | |
49 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r | |
50 | IN OUT EFI_HANDLE *ChildHandle\r | |
51 | );\r | |
52 | \r | |
53 | /**\r | |
54 | Destroys a child handle with a protocol installed on it.\r | |
55 | \r | |
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 | |
59 | \r | |
60 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r | |
61 | @param ChildHandle Handle of the child to destroy\r | |
62 | \r | |
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 NULL.\r | |
66 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r | |
67 | because its services are being used.\r | |
68 | @retval other The child handle was not destroyed\r | |
69 | \r | |
70 | **/\r | |
71 | typedef\r | |
72 | EFI_STATUS\r | |
73 | (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(\r | |
74 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r | |
75 | IN EFI_HANDLE ChildHandle\r | |
76 | );\r | |
77 | \r | |
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 | |
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 |