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