]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/EsrtManagement.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / EsrtManagement.h
1 /** @file
2 The Esrt Management Protocol used to register/set/update an updatable firmware resource .
3
4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _ESRT_MANAGEMENT_H_
10 #define _ESRT_MANAGEMENT_H_
11
12 #include <Guid/SystemResourceTable.h>
13
14 ///
15 /// Global ID for the ESRT_MANAGEMENT_PROTOCOL.
16 ///
17 #define ESRT_MANAGEMENT_PROTOCOL_GUID \
18 { \
19 0xa340c064, 0x723c, 0x4a9c, { 0xa4, 0xdd, 0xd5, 0xb4, 0x7a, 0x26, 0xfb, 0xb0 } \
20 }
21
22 ///
23 /// Forward declaration for the _ESRT_MANAGEMENT_PROTOCOL.
24 ///
25 typedef struct _ESRT_MANAGEMENT_PROTOCOL ESRT_MANAGEMENT_PROTOCOL;
26
27 /**
28 Get Variable name and data by Esrt Entry FwClass
29
30 @param[in] FwClass FwClass of Esrt entry to get
31 @param[in out] Entry Esrt entry returned
32
33 @retval EFI_SUCCESS The variable saving this Esrt Entry exists.
34 @retval EF_NOT_FOUND No correct variable found.
35
36 **/
37 typedef
38 EFI_STATUS
39 (EFIAPI *GET_ESRT_ENTRY)(
40 IN EFI_GUID *FwClass,
41 IN OUT EFI_SYSTEM_RESOURCE_ENTRY *Entry
42 );
43
44
45 /**
46 Update one ESRT entry in ESRT Cache.
47
48 @param[in] Entry Esrt entry to be updated
49
50 @retval EFI_SUCCESS Successfully update an ESRT entry in cache.
51 @retval EFI_INVALID_PARAMETER Entry does't exist in ESRT Cache
52 @retval EFI_WRITE_PROTECTED ESRT Cache repositoy is locked
53
54 **/
55 typedef
56 EFI_STATUS
57 (EFIAPI *UPDATE_ESRT_ENTRY)(
58 IN EFI_SYSTEM_RESOURCE_ENTRY *Entry
59 );
60
61
62 /**
63 Non-FMP instance to unregister Esrt Entry from ESRT Cache.
64
65 @param[in] FwClass FwClass of Esrt entry to Unregister
66
67 @retval EFI_SUCCESS Insert all entries Successfully
68 @retval EFI_NOT_FOUND FwClass does not exsit
69
70 **/
71 typedef
72 EFI_STATUS
73 (EFIAPI *UNREGISTER_ESRT_ENTRY)(
74 IN EFI_GUID *FwClass
75 );
76
77
78 /**
79 Non-FMP instance to register one ESRT entry into ESRT Cache.
80
81 @param[in] Entry Esrt entry to be set
82
83 @retval EFI_SUCCESS Successfully set a variable.
84 @retval EFI_INVALID_PARAMETER ESRT Entry is already exist
85 @retval EFI_OUT_OF_RESOURCES Non-FMP ESRT repository is full
86
87 **/
88 typedef
89 EFI_STATUS
90 (EFIAPI *REGISTER_ESRT_ENTRY)(
91 IN EFI_SYSTEM_RESOURCE_ENTRY *Entry
92 );
93
94
95 /**
96 This function syn up Cached ESRT with data from FMP instances
97 Function should be called after Connect All in order to locate all FMP protocols
98 installed
99
100 @retval EFI_SUCCESS Successfully sync cache repository from FMP instances
101 @retval EFI_NOT_FOUND No FMP Instance are found
102 @retval EFI_OUT_OF_RESOURCES Resource allocaton fail
103
104 **/
105 typedef
106 EFI_STATUS
107 (EFIAPI *SYNC_ESRT_FMP)(
108 VOID
109 );
110
111
112 /**
113 This function locks up Esrt repository to be readonly. It should be called
114 before gEfiEndOfDxeEventGroupGuid event signaled
115
116 @retval EFI_SUCCESS Locks up FMP Non-FMP repository successfully
117
118 **/
119 typedef
120 EFI_STATUS
121 (EFIAPI *LOCK_ESRT_REPOSITORY)(
122 VOID
123 );
124
125
126 struct _ESRT_MANAGEMENT_PROTOCOL {
127 GET_ESRT_ENTRY GetEsrtEntry;
128 UPDATE_ESRT_ENTRY UpdateEsrtEntry;
129 REGISTER_ESRT_ENTRY RegisterEsrtEntry;
130 UNREGISTER_ESRT_ENTRY UnRegisterEsrtEntry;
131 SYNC_ESRT_FMP SyncEsrtFmp;
132 LOCK_ESRT_REPOSITORY LockEsrtRepository;
133 };
134
135 extern EFI_GUID gEsrtManagementProtocolGuid;
136
137 #endif // #ifndef _ESRT_MANAGEMENT_H_
138