Skip to content

Commit 5c49e0a

Browse files
committed
[efi] Update to current EDK2 headers
Signed-off-by: Michael Brown <[email protected]>
1 parent 82fac51 commit 5c49e0a

File tree

12 files changed

+265
-159
lines changed

12 files changed

+265
-159
lines changed

src/include/ipxe/efi/Base.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -802,12 +802,12 @@ typedef UINTN *BASE_LIST;
802802
@param Message Raised compiler diagnostic message when expression is false.
803803
804804
**/
805-
#ifdef MDE_CPU_EBC
806-
#define STATIC_ASSERT(Expression, Message)
807-
#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus)
805+
#if defined (__cplusplus)
808806
#define STATIC_ASSERT static_assert
809-
#else
807+
#elif defined (__GNUC__) || defined (__clang__)
810808
#define STATIC_ASSERT _Static_assert
809+
#elif defined (_MSC_EXTENSIONS)
810+
#define STATIC_ASSERT static_assert
811811
#endif
812812

813813
//
@@ -890,7 +890,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM
890890
@return A pointer to the structure from one of it's elements.
891891
892892
**/
893-
#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
893+
#define BASE_CR(Record, TYPE, Field) ((TYPE *) (VOID *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
894894

895895
/**
896896
Checks whether a value is a power of two.

src/include/ipxe/efi/Guid/Rng.h

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/** @file
2+
Random Number Generator (RNG) GUIDs and structures shared across RNG interfaces.
3+
4+
Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
5+
Copyright (c) Microsoft Corporation.
6+
SPDX-License-Identifier: BSD-2-Clause-Patent
7+
8+
**/
9+
10+
#ifndef RNG_GUID_H_
11+
#define RNG_GUID_H_
12+
13+
FILE_LICENCE ( BSD2_PATENT );
14+
15+
typedef struct _EFI_RNG_INTERFACE EFI_RNG_INTERFACE;
16+
17+
///
18+
/// A selection of EFI_RNG_PROTOCOL algorithms.
19+
/// The algorithms listed are optional, not meant to be exhaustive and be argmented by
20+
/// vendors or other industry standards.
21+
///
22+
typedef EFI_GUID EFI_RNG_ALGORITHM;
23+
24+
///
25+
/// The algorithms corresponds to SP800-90 as defined in
26+
/// NIST SP 800-90, "Recommendation for Random Number Generation Using Deterministic Random
27+
/// Bit Generators", March 2007.
28+
///
29+
#define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID \
30+
{ \
31+
0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96 } \
32+
}
33+
#define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID \
34+
{ \
35+
0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7 } \
36+
}
37+
#define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID \
38+
{ \
39+
0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e } \
40+
}
41+
42+
///
43+
/// The algorithms correspond to X9.31 as defined in
44+
/// NIST, "Recommended Random Number Generator Based on ANSI X9.31 Appendix A.2.4 Using
45+
/// the 3-Key Triple DES and AES Algorithm", January 2005.
46+
///
47+
#define EFI_RNG_ALGORITHM_X9_31_3DES_GUID \
48+
{ \
49+
0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 } \
50+
}
51+
#define EFI_RNG_ALGORITHM_X9_31_AES_GUID \
52+
{ \
53+
0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 } \
54+
}
55+
56+
///
57+
/// The "raw" algorithm, when supported, is intended to provide entropy directly from
58+
/// the source, without it going through some deterministic random bit generator.
59+
///
60+
#define EFI_RNG_ALGORITHM_RAW \
61+
{ \
62+
0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } \
63+
}
64+
65+
///
66+
/// The Arm Architecture states the RNDR that the DRBG algorithm should be compliant
67+
/// with NIST SP800-90A, while not mandating a particular algorithm, so as to be
68+
/// inclusive of different geographies.
69+
///
70+
#define EFI_RNG_ALGORITHM_ARM_RNDR \
71+
{ \
72+
0x43d2fde3, 0x9d4e, 0x4d79, {0x02, 0x96, 0xa8, 0x9b, 0xca, 0x78, 0x08, 0x41} \
73+
}
74+
75+
/**
76+
Returns information about the random number generation implementation.
77+
78+
@param[in] This A pointer to this interface instance.
79+
@param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList.
80+
On output with a return code of EFI_SUCCESS, the size
81+
in bytes of the data returned in RNGAlgorithmList. On output
82+
with a return code of EFI_BUFFER_TOO_SMALL,
83+
the size of RNGAlgorithmList required to obtain the list.
84+
@param[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver
85+
with one EFI_RNG_ALGORITHM element for each supported
86+
RNG algorithm. The list must not change across multiple
87+
calls to the same driver. The first algorithm in the list
88+
is the default algorithm for the driver.
89+
90+
@retval EFI_SUCCESS The RNG algorithm list was returned successfully.
91+
@retval EFI_UNSUPPORTED The services is not supported by this driver.
92+
@retval EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a
93+
hardware or firmware error.
94+
@retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
95+
@retval EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result.
96+
97+
**/
98+
typedef
99+
EFI_STATUS
100+
(EFIAPI *EFI_RNG_GET_INFO)(
101+
IN EFI_RNG_INTERFACE *This,
102+
IN OUT UINTN *RNGAlgorithmListSize,
103+
OUT EFI_RNG_ALGORITHM *RNGAlgorithmList
104+
);
105+
106+
/**
107+
Produces and returns an RNG value using either the default or specified RNG algorithm.
108+
109+
@param[in] This A pointer to this interface instance.
110+
@param[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG
111+
algorithm to use. May be NULL in which case the function will
112+
use its default RNG algorithm.
113+
@param[in] RNGValueLength The length in bytes of the memory buffer pointed to by
114+
RNGValue. The driver shall return exactly this numbers of bytes.
115+
@param[out] RNGValue A caller-allocated memory buffer filled by the driver with the
116+
resulting RNG value.
117+
118+
@retval EFI_SUCCESS The RNG value was returned successfully.
119+
@retval EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by
120+
this driver.
121+
@retval EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or
122+
firmware error.
123+
@retval EFI_NOT_READY There is not enough random data available to satisfy the length
124+
requested by RNGValueLength.
125+
@retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero.
126+
127+
**/
128+
typedef
129+
EFI_STATUS
130+
(EFIAPI *EFI_RNG_GET_RNG)(
131+
IN EFI_RNG_INTERFACE *This,
132+
IN EFI_RNG_ALGORITHM *RNGAlgorithm OPTIONAL,
133+
IN UINTN RNGValueLength,
134+
OUT UINT8 *RNGValue
135+
);
136+
137+
///
138+
/// The Random Number Generator (RNG) interface provides random bits for use in
139+
/// applications, or entropy for seeding other random number generators.
140+
///
141+
/// This interface is shared between the RNG Protocol defined in the UEFI 2.4 Specification
142+
/// and the RNG PPI defined in the PI 1.9 Specification.
143+
///
144+
struct _EFI_RNG_INTERFACE {
145+
EFI_RNG_GET_INFO GetInfo;
146+
EFI_RNG_GET_RNG GetRNG;
147+
};
148+
149+
extern EFI_GUID gEfiRngAlgorithmSp80090Hash256Guid;
150+
extern EFI_GUID gEfiRngAlgorithmSp80090Hmac256Guid;
151+
extern EFI_GUID gEfiRngAlgorithmSp80090Ctr256Guid;
152+
extern EFI_GUID gEfiRngAlgorithmX9313DesGuid;
153+
extern EFI_GUID gEfiRngAlgorithmX931AesGuid;
154+
extern EFI_GUID gEfiRngAlgorithmRaw;
155+
extern EFI_GUID gEfiRngAlgorithmArmRndr;
156+
157+
#endif // #ifndef RNG_GUID_H_

src/include/ipxe/efi/IndustryStandard/Acpi30.h

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ACPI 3.0 definitions from the ACPI Specification Revision 3.0b October 10, 2006
33
44
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5+
Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
56
SPDX-License-Identifier: BSD-2-Clause-Patent
67
**/
78

@@ -12,6 +13,16 @@ FILE_LICENCE ( BSD2_PATENT );
1213

1314
#include <ipxe/efi/IndustryStandard/Acpi20.h>
1415

16+
///
17+
/// _CSD Revision for ACPI 3.0
18+
///
19+
#define EFI_ACPI_3_0_AML_CSD_REVISION 0
20+
21+
///
22+
/// _CSD NumEntries for ACPI 3.0
23+
///
24+
#define EFI_ACPI_3_0_AML_CSD_NUM_ENTRIES 6
25+
1526
//
1627
// Define for Descriptor
1728
//

src/include/ipxe/efi/IndustryStandard/Acpi40.h

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 2010
33
44
Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.<BR>
5+
Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
56
SPDX-License-Identifier: BSD-2-Clause-Patent
67
**/
78

@@ -12,6 +13,16 @@ FILE_LICENCE ( BSD2_PATENT );
1213

1314
#include <ipxe/efi/IndustryStandard/Acpi30.h>
1415

16+
///
17+
/// _CSD Revision for ACPI 4.0
18+
///
19+
#define EFI_ACPI_4_0_AML_CSD_REVISION 0
20+
21+
///
22+
/// _CSD NumEntries for ACPI 4.0
23+
///
24+
#define EFI_ACPI_4_0_AML_CSD_NUM_ENTRIES 6
25+
1526
///
1627
/// _PSD Revision for ACPI 4.0
1728
///

src/include/ipxe/efi/IndustryStandard/Acpi50.h

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
55
Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
66
Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
7+
Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
78
SPDX-License-Identifier: BSD-2-Clause-Patent
89
**/
910

@@ -14,6 +15,16 @@ FILE_LICENCE ( BSD2_PATENT );
1415

1516
#include <ipxe/efi/IndustryStandard/Acpi40.h>
1617

18+
///
19+
/// _CSD Revision for ACPI 5.0
20+
///
21+
#define EFI_ACPI_5_0_AML_CSD_REVISION 0
22+
23+
///
24+
/// _CSD NumEntries for ACPI 5.0
25+
///
26+
#define EFI_ACPI_5_0_AML_CSD_NUM_ENTRIES 6
27+
1728
//
1829
// Define for Descriptor
1930
//

src/include/ipxe/efi/IndustryStandard/Acpi51.h

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
66
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
77
Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
8+
Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
89
SPDX-License-Identifier: BSD-2-Clause-Patent
910
**/
1011

@@ -15,6 +16,16 @@ FILE_LICENCE ( BSD2_PATENT );
1516

1617
#include <ipxe/efi/IndustryStandard/Acpi50.h>
1718

19+
///
20+
/// _CSD Revision for ACPI 5.1
21+
///
22+
#define EFI_ACPI_5_1_AML_CSD_REVISION 0
23+
24+
///
25+
/// _CSD NumEntries for ACPI 5.1
26+
///
27+
#define EFI_ACPI_5_1_AML_CSD_NUM_ENTRIES 6
28+
1829
///
1930
/// _PSD Revision for ACPI 5.1
2031
///

src/include/ipxe/efi/IndustryStandard/Acpi60.h

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
55
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
66
Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
7+
Copyright (C) 2025, Advanced Micro Devices, Inc. All rights reserved.
78
SPDX-License-Identifier: BSD-2-Clause-Patent
89
**/
910

@@ -14,6 +15,16 @@ FILE_LICENCE ( BSD2_PATENT );
1415

1516
#include <ipxe/efi/IndustryStandard/Acpi51.h>
1617

18+
///
19+
/// _CSD Revision for ACPI 6.0
20+
///
21+
#define EFI_ACPI_6_0_AML_CSD_REVISION 0
22+
23+
///
24+
/// _CSD NumEntries for ACPI 6.0
25+
///
26+
#define EFI_ACPI_6_0_AML_CSD_NUM_ENTRIES 6
27+
1728
///
1829
/// _PSD Revision for ACPI 6.0
1930
///

src/include/ipxe/efi/Pi/PiHob.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
55
SPDX-License-Identifier: BSD-2-Clause-Patent
66
77
@par Revision Reference:
8-
PI Version 1.6
8+
PI Version 1.9
99
1010
**/
1111

@@ -293,6 +293,7 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
293293

294294
#define EFI_RESOURCE_ATTRIBUTE_ENCRYPTED 0x04000000
295295
#define EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE 0x08000000
296+
#define EFI_RESOURCE_ATTRIBUTE_HOT_PLUGGABLE 0x10000000
296297
//
297298
// Physical memory relative reliability attribute. This
298299
// memory provides higher reliability relative to other

src/include/ipxe/efi/Pi/PiStatusCode.h

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
StatusCode related definitions in PI.
33
44
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5+
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
56
SPDX-License-Identifier: BSD-2-Clause-Patent
67
78
@par Revision Reference:
@@ -142,6 +143,7 @@ typedef struct {
142143
#define EFI_COMPUTING_UNIT_CACHE (EFI_COMPUTING_UNIT | 0x00040000)
143144
#define EFI_COMPUTING_UNIT_MEMORY (EFI_COMPUTING_UNIT | 0x00050000)
144145
#define EFI_COMPUTING_UNIT_CHIPSET (EFI_COMPUTING_UNIT | 0x00060000)
146+
#define EFI_COMPUTING_UNIT_MANAGEABILITY (EFI_COMPUTING_UNIT | 0x00070000)
145147
///@}
146148

147149
///
@@ -345,6 +347,16 @@ typedef struct {
345347
#define EFI_CHIPSET_EC_INTRUDER_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000003)
346348
///@}
347349

350+
///
351+
/// Computing Unit Manageability Subclass Error Code definitions.
352+
/// The detail information is reported by REPORT_STATUS_CODE_WITH_EXTENDED_DATA
353+
// with ASCII string in EFI_STATUS_CODE_STRING_DATA.
354+
///@{
355+
#define EFI_MANAGEABILITY_EC_REDFISH_COMMUNICATION_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000000)
356+
#define EFI_MANAGEABILITY_EC_REDFISH_HOST_INTERFACE_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000001)
357+
#define EFI_MANAGEABILITY_EC_REDFISH_BOOTSTRAP_CREDENTIAL_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)
358+
///@}
359+
348360
///
349361
/// Peripheral Subclass definitions.
350362
/// Values of 12-127 are reserved for future use by this specification.

src/include/ipxe/efi/Protocol/PxeBaseCode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
3636
///
3737
/// Default IP TTL and ToS.
3838
///
39-
#define DEFAULT_TTL 16
39+
#define DEFAULT_TTL 64
4040
#define DEFAULT_ToS 0
4141

4242
///

0 commit comments

Comments
 (0)