]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/ServiceBinding.h
Code have been checked with spec
[mirror_edk2.git] / MdePkg / Include / Protocol / ServiceBinding.h
... / ...
CommitLineData
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 - 2008, Intel Corporation \r
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
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
25typedef 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 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
32\r
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
37\r
38 @retval EFI_SUCCES The protocol was added to ChildHandle.\r
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
45typedef\r
46EFI_STATUS\r
47(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(\r
48 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
49 IN OUT EFI_HANDLE *ChildHandle\r
50 );\r
51\r
52/**\r
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
57\r
58 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
59 @param ChildHandle Handle of the child to destroy\r
60\r
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
65 because its services are being used.\r
66 @retval other The child handle was not destroyed\r
67\r
68**/\r
69typedef\r
70EFI_STATUS\r
71(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(\r
72 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
73 IN EFI_HANDLE ChildHandle\r
74 );\r
75\r
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
87struct _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