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#pragma once
14
15FILE_LICENCE ( BSD2_PATENT );
16FILE_SECBOOT ( PERMITTED );
17
18///
19/// Forward reference for pure ANSI compatability
20///
22
23/**
24 Creates a child handle and installs a protocol.
25
26 The CreateChild() function installs a protocol on ChildHandle.
27 If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
28 If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
29
30 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
31 @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
32 then a new handle is created. If it is a pointer to an existing UEFI handle,
33 then the protocol is added to the existing UEFI handle.
34
35 @retval EFI_SUCCES The protocol was added to ChildHandle.
36 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
37 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create
38 the child
39 @retval other The child handle was not created
40
41**/
42typedef
46 IN OUT EFI_HANDLE *ChildHandle
47 );
48
49/**
50 Destroys a child handle with a protocol installed on it.
51
52 The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
53 that was installed by CreateChild() from ChildHandle. If the removed protocol is the
54 last protocol on ChildHandle, then ChildHandle is destroyed.
55
56 @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
57 @param ChildHandle Handle of the child to destroy
58
59 @retval EFI_SUCCES The protocol was removed from ChildHandle.
60 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
61 @retval EFI_INVALID_PARAMETER Child handle is NULL.
62 @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
63 because its services are being used.
64 @retval other The child handle was not destroyed
65
66**/
67typedef
71 IN EFI_HANDLE ChildHandle
72 );
73
74///
75/// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
76/// child handles. A driver is responsible for adding protocols to the child handle
77/// in CreateChild() and removing protocols in DestroyChild(). It is also required
78/// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
79/// to establish the parent-child relationship, and closes the protocol in DestroyChild().
80/// The pseudo code for CreateChild() and DestroyChild() is provided to specify the
81/// required behavior, not to specify the required implementation. Each consumer of
82/// a software protocol is responsible for calling CreateChild() when it requires the
83/// protocol and calling DestroyChild() when it is finished with that protocol.
84///
#define EFIAPI
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_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.
struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL
Forward reference for pure ANSI compatability.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define EFI_HANDLE
Definition efi.h:53
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy child handles.
EFI_SERVICE_BINDING_CREATE_CHILD CreateChild
EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild