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