]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Guid/SystemResourceTable.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Guid / SystemResourceTable.h
CommitLineData
2ca32f8d
HW
1/** @file\r
2 Guid & data structure used for EFI System Resource Table (ESRT)\r
3\r
48997fe4 4 Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>\r
da29cc0e 5 Copyright (c) Microsoft Corporation.<BR>\r
9344f092 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
2ca32f8d
HW
7\r
8 @par Revision Reference:\r
9 GUIDs defined in UEFI 2.5 spec.\r
10\r
11**/\r
12\r
2ca32f8d
HW
13#ifndef _SYSTEM_RESOURCE_TABLE_H__\r
14#define _SYSTEM_RESOURCE_TABLE_H__\r
15\r
16#define EFI_SYSTEM_RESOURCE_TABLE_GUID \\r
17 { \\r
18 0xb122a263, 0x3661, 0x4f68, {0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } \\r
19 }\r
20\r
21///\r
22/// Current Entry Version\r
23///\r
24#define EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION 1\r
25\r
26///\r
27/// Firmware Type Definitions\r
28///\r
29#define ESRT_FW_TYPE_UNKNOWN 0x00000000\r
30#define ESRT_FW_TYPE_SYSTEMFIRMWARE 0x00000001\r
31#define ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002\r
32#define ESRT_FW_TYPE_UEFIDRIVER 0x00000003\r
33\r
34///\r
35/// Last Attempt Status Values\r
36///\r
48997fe4
WX
37#define LAST_ATTEMPT_STATUS_SUCCESS 0x00000000\r
38#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL 0x00000001\r
39#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES 0x00000002\r
40#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION 0x00000003\r
41#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT 0x00000004\r
42#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR 0x00000005\r
43#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC 0x00000006\r
44#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT 0x00000007\r
45#define LAST_ATTEMPT_STATUS_ERROR_UNSATISFIED_DEPENDENCIES 0x00000008\r
2ca32f8d 46\r
da29cc0e
MK
47///\r
48/// LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MAX is defined as\r
49/// 0x4000 as of UEFI Specification 2.8B. This will be modified in the\r
50/// future to the correct value 0x3FFF. To ensure correct implementation,\r
51/// this change is preemptively made in the value defined below.\r
52///\r
53/// When the UEFI Specification is updated, this comment block can be\r
54/// removed.\r
55///\r
2f88bd3a
MK
56#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MIN 0x00001000\r
57#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MAX 0x00003FFF\r
da29cc0e 58\r
2ca32f8d
HW
59typedef struct {\r
60 ///\r
61 /// The firmware class field contains a GUID that identifies a firmware component\r
62 /// that can be updated via UpdateCapsule(). This GUID must be unique within all\r
63 /// entries of the ESRT.\r
64 ///\r
2f88bd3a 65 EFI_GUID FwClass;\r
2ca32f8d
HW
66 ///\r
67 /// Identifies the type of firmware resource.\r
68 ///\r
2f88bd3a 69 UINT32 FwType;\r
2ca32f8d
HW
70 ///\r
71 /// The firmware version field represents the current version of the firmware\r
72 /// resource, value must always increase as a larger number represents a newer\r
73 /// version.\r
74 ///\r
2f88bd3a 75 UINT32 FwVersion;\r
2ca32f8d
HW
76 ///\r
77 /// The lowest firmware resource version to which a firmware resource can be\r
78 /// rolled back for the given system/device. Generally this is used to protect\r
79 /// against known and fixed security issues.\r
80 ///\r
2f88bd3a 81 UINT32 LowestSupportedFwVersion;\r
2ca32f8d
HW
82 ///\r
83 /// The capsule flags field contains the CapsuleGuid flags (bits 0- 15) as defined\r
84 /// in the EFI_CAPSULE_HEADER that will be set in the capsule header.\r
85 ///\r
2f88bd3a 86 UINT32 CapsuleFlags;\r
2ca32f8d
HW
87 ///\r
88 /// The last attempt version field describes the last firmware version for which\r
89 /// an update was attempted (uses the same format as Firmware Version).\r
90 /// Last Attempt Version is updated each time an UpdateCapsule() is attempted for\r
91 /// an ESRT entry and is preserved across reboots (non-volatile). However, in\r
92 /// cases where the attempt version is not recorded due to limitations in the\r
93 /// update process, the field shall set to zero after a failed update. Similarly,\r
94 /// in the case of a removable device, this value is set to 0 in cases where the\r
95 /// device has not been updated since being added to the system.\r
96 ///\r
2f88bd3a 97 UINT32 LastAttemptVersion;\r
2ca32f8d
HW
98 ///\r
99 /// The last attempt status field describes the result of the last firmware update\r
100 /// attempt for the firmware resource entry.\r
101 /// LastAttemptStatus is updated each time an UpdateCapsule() is attempted for an\r
102 /// ESRT entry and is preserved across reboots (non-volatile).\r
103 /// If a firmware update has never been attempted or is unknown, for example after\r
104 /// fresh insertion of a removable device, LastAttemptStatus must be set to Success.\r
105 ///\r
2f88bd3a 106 UINT32 LastAttemptStatus;\r
2ca32f8d
HW
107} EFI_SYSTEM_RESOURCE_ENTRY;\r
108\r
109typedef struct {\r
110 ///\r
111 /// The number of firmware resources in the table, must not be zero.\r
112 ///\r
2f88bd3a 113 UINT32 FwResourceCount;\r
2ca32f8d
HW
114 ///\r
115 /// The maximum number of resource array entries that can be within the table\r
116 /// without reallocating the table, must not be zero.\r
117 ///\r
2f88bd3a 118 UINT32 FwResourceCountMax;\r
2ca32f8d
HW
119 ///\r
120 /// The version of the EFI_SYSTEM_RESOURCE_ENTRY entities used in this table.\r
121 /// This field should be set to 1.\r
122 ///\r
2f88bd3a 123 UINT64 FwResourceVersion;\r
2ca32f8d
HW
124 ///\r
125 /// Array of EFI_SYSTEM_RESOURCE_ENTRY\r
126 ///\r
2f88bd3a 127 // EFI_SYSTEM_RESOURCE_ENTRY Entries[];\r
2ca32f8d
HW
128} EFI_SYSTEM_RESOURCE_TABLE;\r
129\r
2f88bd3a 130extern EFI_GUID gEfiSystemResourceTableGuid;\r
2ca32f8d
HW
131\r
132#endif\r