View | Details | Raw Unified | Return to bug 283037
Collapse All | Expand All

(-)b/sys/contrib/edk2/FREEBSD-upgrade (-5 / +4 lines)
Lines 3-9 set of files from MdePkg is quite large (10MB at the time of writing). To do Link Here
3
this when performing an upgrade, execute the following:
3
this when performing an upgrade, execute the following:
4
4
5
# Generate list of the headers needed to build
5
# Generate list of the headers needed to build
6
cp -r ../vendor/edk2/dist/MdePkg/Include sys/contrib/edk2
6
cp -r ..../MdePkg/Include sys/contrib/edk2
7
cp ..../MdePkg/MdePkg.dec sys/contrib/edk2/MdePkg.dec
7
cd lib/libefivar
8
cd lib/libefivar
8
make
9
make
9
pushd `make -V .OBJDIR`
10
pushd `make -V .OBJDIR`
Lines 13-21 popd Link Here
13
14
14
# Merge the needed files
15
# Merge the needed files
15
cd ../../sys/contrib/edk2
16
cd ../../sys/contrib/edk2
16
svn revert -R .
17
for i in `cat /tmp/xxx`; do
17
for i in `cat /tmp/xxx`; do
18
    svn merge -c VendorRevision svn+ssh://repo.freebsd.org/base/vendor/edk2/dist/MdePkg/$i $i
18
    git add $i
19
done
19
done
20
svn merge -c VendorRevision \
20
git clean -df
21
    svn+ssh://repo.freebsd.org/base/vendor/edk2/dist/MdePkg/MdePkg.dec MdePkg.dec
(-)b/sys/contrib/edk2/Include/Base.h (-315 / +393 lines)
Lines 6-18 Link Here
6
  environment. There are a set of base libraries in the Mde Package that can
6
  environment. There are a set of base libraries in the Mde Package that can
7
  be used to implement base modules.
7
  be used to implement base modules.
8
8
9
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
10
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
10
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
11
SPDX-License-Identifier: BSD-2-Clause-Patent
11
SPDX-License-Identifier: BSD-2-Clause-Patent
12
12
13
**/
13
**/
14
14
15
16
#ifndef __BASE_H__
15
#ifndef __BASE_H__
17
#define __BASE_H__
16
#define __BASE_H__
18
17
Lines 21-31 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
21
//
20
//
22
#include <ProcessorBind.h>
21
#include <ProcessorBind.h>
23
22
24
#if defined(_MSC_EXTENSIONS)
23
#if defined (_MSC_EXTENSIONS)
25
//
24
//
26
// Disable warning when last field of data structure is a zero sized array.
25
// Disable warning when last field of data structure is a zero sized array.
27
//
26
//
28
#pragma warning ( disable : 4200 )
27
  #pragma warning ( disable : 4200 )
29
#endif
28
#endif
30
29
31
//
30
//
Lines 33-52 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
33
//  if the /OPT:REF linker option is used. We defined a macro as this is a
32
//  if the /OPT:REF linker option is used. We defined a macro as this is a
34
//  a non standard extension
33
//  a non standard extension
35
//
34
//
36
#if defined(_MSC_VER) && _MSC_VER < 1800 && !defined (MDE_CPU_EBC)
35
#if defined (_MSC_VER) && _MSC_VER < 1800 && !defined (MDE_CPU_EBC)
37
  ///
36
///
38
  /// Remove global variable from the linked image if there are no references to
37
/// Remove global variable from the linked image if there are no references to
39
  /// it after all compiler and linker optimizations have been performed.
38
/// it after all compiler and linker optimizations have been performed.
40
  ///
39
///
41
  ///
40
///
42
  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
41
#define GLOBAL_REMOVE_IF_UNREFERENCED  __declspec(selectany)
43
#else
42
#else
44
  ///
43
///
45
  /// Remove the global variable from the linked image if there are no references
44
/// Remove the global variable from the linked image if there are no references
46
  ///  to it after all compiler and linker optimizations have been performed.
45
///  to it after all compiler and linker optimizations have been performed.
47
  ///
46
///
48
  ///
47
///
49
  #define GLOBAL_REMOVE_IF_UNREFERENCED
48
#define GLOBAL_REMOVE_IF_UNREFERENCED
50
#endif
49
#endif
51
50
52
//
51
//
Lines 55-81 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
55
//
54
//
56
#ifndef UNREACHABLE
55
#ifndef UNREACHABLE
57
  #ifdef __GNUC__
56
  #ifdef __GNUC__
58
    ///
57
///
59
    /// Signal compilers and analyzers that this call is not reachable.  It is
58
/// Signal compilers and analyzers that this call is not reachable.  It is
60
    /// up to the compiler to remove any code past that point.
59
/// up to the compiler to remove any code past that point.
61
    ///
60
///
62
    #define UNREACHABLE()  __builtin_unreachable ()
61
#define UNREACHABLE()  __builtin_unreachable ()
63
  #elif defined (__has_feature)
62
  #elif defined (__has_feature)
64
    #if __has_builtin (__builtin_unreachable)
63
    #if __has_builtin (__builtin_unreachable)
65
      ///
64
///
66
      /// Signal compilers and analyzers that this call is not reachable.  It is
65
/// Signal compilers and analyzers that this call is not reachable.  It is
67
      /// up to the compiler to remove any code past that point.
66
/// up to the compiler to remove any code past that point.
68
      ///
67
///
69
      #define UNREACHABLE()  __builtin_unreachable ()
68
#define UNREACHABLE()  __builtin_unreachable ()
70
    #endif
69
    #endif
71
  #endif
70
  #endif
72
71
73
  #ifndef UNREACHABLE
72
  #ifndef UNREACHABLE
74
    ///
73
///
75
    /// Signal compilers and analyzers that this call is not reachable.  It is
74
/// Signal compilers and analyzers that this call is not reachable.  It is
76
    /// up to the compiler to remove any code past that point.
75
/// up to the compiler to remove any code past that point.
77
    ///
76
///
78
    #define UNREACHABLE()
77
#define UNREACHABLE()
79
  #endif
78
  #endif
80
#endif
79
#endif
81
80
Lines 86-111 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
86
//
85
//
87
#ifndef NORETURN
86
#ifndef NORETURN
88
  #if defined (__GNUC__) || defined (__clang__)
87
  #if defined (__GNUC__) || defined (__clang__)
89
    ///
88
///
90
    /// Signal compilers and analyzers that the function cannot return.
89
/// Signal compilers and analyzers that the function cannot return.
91
    /// It is up to the compiler to remove any code past a call to functions
90
/// It is up to the compiler to remove any code past a call to functions
92
    /// flagged with this attribute.
91
/// flagged with this attribute.
93
    ///
92
///
94
    #define NORETURN  __attribute__((noreturn))
93
#define NORETURN  __attribute__((noreturn))
95
  #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC)
94
  #elif defined (_MSC_EXTENSIONS) && !defined (MDE_CPU_EBC)
96
    ///
95
///
97
    /// Signal compilers and analyzers that the function cannot return.
96
/// Signal compilers and analyzers that the function cannot return.
98
    /// It is up to the compiler to remove any code past a call to functions
97
/// It is up to the compiler to remove any code past a call to functions
99
    /// flagged with this attribute.
98
/// flagged with this attribute.
100
    ///
99
///
101
    #define NORETURN  __declspec(noreturn)
100
#define NORETURN  __declspec(noreturn)
102
  #else
101
  #else
103
    ///
102
///
104
    /// Signal compilers and analyzers that the function cannot return.
103
/// Signal compilers and analyzers that the function cannot return.
105
    /// It is up to the compiler to remove any code past a call to functions
104
/// It is up to the compiler to remove any code past a call to functions
106
    /// flagged with this attribute.
105
/// flagged with this attribute.
107
    ///
106
///
108
    #define NORETURN
107
#define NORETURN
109
  #endif
108
  #endif
110
#endif
109
#endif
111
110
Lines 116-135 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
116
#ifndef ANALYZER_UNREACHABLE
115
#ifndef ANALYZER_UNREACHABLE
117
  #ifdef __clang_analyzer__
116
  #ifdef __clang_analyzer__
118
    #if __has_builtin (__builtin_unreachable)
117
    #if __has_builtin (__builtin_unreachable)
119
      ///
118
///
120
      /// Signal the analyzer that this call is not reachable.
119
/// Signal the analyzer that this call is not reachable.
121
      /// This excludes compilers.
120
/// This excludes compilers.
122
      ///
121
///
123
      #define ANALYZER_UNREACHABLE()  __builtin_unreachable ()
122
#define ANALYZER_UNREACHABLE()  __builtin_unreachable ()
124
    #endif
123
    #endif
125
  #endif
124
  #endif
126
125
127
  #ifndef ANALYZER_UNREACHABLE
126
  #ifndef ANALYZER_UNREACHABLE
128
    ///
127
///
129
    /// Signal the analyzer that this call is not reachable.
128
/// Signal the analyzer that this call is not reachable.
130
    /// This excludes compilers.
129
/// This excludes compilers.
131
    ///
130
///
132
    #define ANALYZER_UNREACHABLE()
131
#define ANALYZER_UNREACHABLE()
133
  #endif
132
  #endif
134
#endif
133
#endif
135
134
Lines 142-161 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
142
#ifndef ANALYZER_NORETURN
141
#ifndef ANALYZER_NORETURN
143
  #ifdef __has_feature
142
  #ifdef __has_feature
144
    #if __has_feature (attribute_analyzer_noreturn)
143
    #if __has_feature (attribute_analyzer_noreturn)
145
      ///
144
///
146
      /// Signal analyzers that the function cannot return.
145
/// Signal analyzers that the function cannot return.
147
      /// This excludes compilers.
146
/// This excludes compilers.
148
      ///
147
///
149
      #define ANALYZER_NORETURN  __attribute__((analyzer_noreturn))
148
#define ANALYZER_NORETURN  __attribute__((analyzer_noreturn))
150
    #endif
149
    #endif
151
  #endif
150
  #endif
152
151
153
  #ifndef ANALYZER_NORETURN
152
  #ifndef ANALYZER_NORETURN
154
    ///
153
///
155
    /// Signal the analyzer that the function cannot return.
154
/// Signal the analyzer that the function cannot return.
156
    /// This excludes compilers.
155
/// This excludes compilers.
157
    ///
156
///
158
    #define ANALYZER_NORETURN
157
#define ANALYZER_NORETURN
159
  #endif
158
  #endif
160
#endif
159
#endif
161
160
Lines 165-181 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
165
///
164
///
166
#ifndef RETURNS_TWICE
165
#ifndef RETURNS_TWICE
167
  #if defined (__GNUC__) || defined (__clang__)
166
  #if defined (__GNUC__) || defined (__clang__)
168
    ///
167
///
169
    /// Tell the code optimizer that the function will return twice.
168
/// Tell the code optimizer that the function will return twice.
170
    /// This prevents wrong optimizations which can cause bugs.
169
/// This prevents wrong optimizations which can cause bugs.
171
    ///
170
///
172
    #define RETURNS_TWICE  __attribute__((returns_twice))
171
#define RETURNS_TWICE  __attribute__((returns_twice))
173
  #else
172
  #else
174
    ///
173
///
175
    /// Tell the code optimizer that the function will return twice.
174
/// Tell the code optimizer that the function will return twice.
176
    /// This prevents wrong optimizations which can cause bugs.
175
/// This prevents wrong optimizations which can cause bugs.
177
    ///
176
///
178
    #define RETURNS_TWICE
177
#define RETURNS_TWICE
179
  #endif
178
  #endif
180
#endif
179
#endif
181
180
Lines 186-243 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
186
///
185
///
187
/// Private worker functions for ASM_PFX()
186
/// Private worker functions for ASM_PFX()
188
///
187
///
189
#define _CONCATENATE(a, b)  __CONCATENATE(a, b)
188
#define _CONCATENATE(a, b)   __CONCATENATE(a, b)
190
#define __CONCATENATE(a, b) a ## b
189
#define __CONCATENATE(a, b)  a ## b
191
190
192
///
191
///
193
/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
192
/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
194
/// on symbols in assembly language.
193
/// on symbols in assembly language.
195
///
194
///
196
#define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
195
#define ASM_PFX(name)  _CONCATENATE (__USER_LABEL_PREFIX__, name)
197
196
198
#ifdef __APPLE__
197
#ifdef __APPLE__
199
  //
198
//
200
  // Apple extension that is used by the linker to optimize code size
199
// Apple extension that is used by the linker to optimize code size
201
  // with assembly functions. Put at the end of your .S files
200
// with assembly functions. Put at the end of your .S files
202
  //
201
//
203
  #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED  .subsections_via_symbols
202
#define ASM_FUNCTION_REMOVE_IF_UNREFERENCED  .subsections_via_symbols
204
#else
203
#else
205
  #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED
204
#define ASM_FUNCTION_REMOVE_IF_UNREFERENCED
206
#endif
205
#endif
207
206
208
#ifdef __CC_ARM
207
#define PACKED
209
  //
210
  // Older RVCT ARM compilers don't fully support #pragma pack and require __packed
211
  // as a prefix for the structure.
212
  //
213
  #define PACKED  __packed
214
#else
215
  #define PACKED
216
#endif
217
208
218
///
209
///
219
/// 128 bit buffer containing a unique identifier value.
210
/// 128 bit buffer containing a unique identifier value.
220
/// Unless otherwise specified, aligned on a 64 bit boundary.
211
/// Unless otherwise specified, aligned on a 64 bit boundary.
221
///
212
///
222
typedef struct {
213
typedef struct {
223
  UINT32  Data1;
214
  UINT32    Data1;
224
  UINT16  Data2;
215
  UINT16    Data2;
225
  UINT16  Data3;
216
  UINT16    Data3;
226
  UINT8   Data4[8];
217
  UINT8     Data4[8];
227
} GUID;
218
} GUID;
228
219
229
///
220
///
230
/// 4-byte buffer. An IPv4 internet protocol address.
221
/// 4-byte buffer. An IPv4 internet protocol address.
231
///
222
///
232
typedef struct {
223
typedef struct {
233
  UINT8 Addr[4];
224
  UINT8    Addr[4];
234
} IPv4_ADDRESS;
225
} IPv4_ADDRESS;
235
226
236
///
227
///
237
/// 16-byte buffer. An IPv6 internet protocol address.
228
/// 16-byte buffer. An IPv6 internet protocol address.
238
///
229
///
239
typedef struct {
230
typedef struct {
240
  UINT8 Addr[16];
231
  UINT8    Addr[16];
241
} IPv6_ADDRESS;
232
} IPv6_ADDRESS;
242
233
243
//
234
//
Lines 254-261 typedef struct _LIST_ENTRY LIST_ENTRY; Link Here
254
/// _LIST_ENTRY structure definition.
245
/// _LIST_ENTRY structure definition.
255
///
246
///
256
struct _LIST_ENTRY {
247
struct _LIST_ENTRY {
257
  LIST_ENTRY  *ForwardLink;
248
  LIST_ENTRY    *ForwardLink;
258
  LIST_ENTRY  *BackLink;
249
  LIST_ENTRY    *BackLink;
259
};
250
};
260
251
261
//
252
//
Lines 265-281 struct _LIST_ENTRY { Link Here
265
///
256
///
266
/// Datum is read-only.
257
/// Datum is read-only.
267
///
258
///
268
#define CONST     const
259
#define CONST  const
269
260
270
///
261
///
271
/// Datum is scoped to the current file or function.
262
/// Datum is scoped to the current file or function.
272
///
263
///
273
#define STATIC    static
264
#define STATIC  static
274
265
275
///
266
///
276
/// Undeclared type.
267
/// Undeclared type.
277
///
268
///
278
#define VOID      void
269
#define VOID  void
279
270
280
//
271
//
281
// Modifiers for Data Types used to self document code.
272
// Modifiers for Data Types used to self document code.
Lines 313-329 struct _LIST_ENTRY { Link Here
313
/// Boolean false value.  UEFI Specification defines this value to be 0,
304
/// Boolean false value.  UEFI Specification defines this value to be 0,
314
/// but this form is more portable.
305
/// but this form is more portable.
315
///
306
///
316
#define FALSE ((BOOLEAN)(0==1))
307
#define FALSE  ((BOOLEAN)(0==1))
317
308
318
///
309
///
319
/// NULL pointer (VOID *)
310
/// NULL pointer (VOID *)
320
///
311
///
312
#if defined (__cplusplus)
313
  #if defined (_MSC_EXTENSIONS)
314
#define NULL  nullptr
315
  #else
316
#define NULL  __null
317
  #endif
318
#else
321
#define NULL  ((VOID *) 0)
319
#define NULL  ((VOID *) 0)
320
#endif
322
321
323
//
322
//
324
// Null character
323
// Null character
325
//
324
//
326
#define CHAR_NULL             0x0000
325
#define CHAR_NULL  0x0000
327
326
328
///
327
///
329
/// Maximum values for common UEFI Data Types
328
/// Maximum values for common UEFI Data Types
Lines 345-414 struct _LIST_ENTRY { Link Here
345
#define MIN_INT32  (((INT32) -2147483647) - 1)
344
#define MIN_INT32  (((INT32) -2147483647) - 1)
346
#define MIN_INT64  (((INT64) -9223372036854775807LL) - 1)
345
#define MIN_INT64  (((INT64) -9223372036854775807LL) - 1)
347
346
348
#define  BIT0     0x00000001
347
#define  BIT0   0x00000001
349
#define  BIT1     0x00000002
348
#define  BIT1   0x00000002
350
#define  BIT2     0x00000004
349
#define  BIT2   0x00000004
351
#define  BIT3     0x00000008
350
#define  BIT3   0x00000008
352
#define  BIT4     0x00000010
351
#define  BIT4   0x00000010
353
#define  BIT5     0x00000020
352
#define  BIT5   0x00000020
354
#define  BIT6     0x00000040
353
#define  BIT6   0x00000040
355
#define  BIT7     0x00000080
354
#define  BIT7   0x00000080
356
#define  BIT8     0x00000100
355
#define  BIT8   0x00000100
357
#define  BIT9     0x00000200
356
#define  BIT9   0x00000200
358
#define  BIT10    0x00000400
357
#define  BIT10  0x00000400
359
#define  BIT11    0x00000800
358
#define  BIT11  0x00000800
360
#define  BIT12    0x00001000
359
#define  BIT12  0x00001000
361
#define  BIT13    0x00002000
360
#define  BIT13  0x00002000
362
#define  BIT14    0x00004000
361
#define  BIT14  0x00004000
363
#define  BIT15    0x00008000
362
#define  BIT15  0x00008000
364
#define  BIT16    0x00010000
363
#define  BIT16  0x00010000
365
#define  BIT17    0x00020000
364
#define  BIT17  0x00020000
366
#define  BIT18    0x00040000
365
#define  BIT18  0x00040000
367
#define  BIT19    0x00080000
366
#define  BIT19  0x00080000
368
#define  BIT20    0x00100000
367
#define  BIT20  0x00100000
369
#define  BIT21    0x00200000
368
#define  BIT21  0x00200000
370
#define  BIT22    0x00400000
369
#define  BIT22  0x00400000
371
#define  BIT23    0x00800000
370
#define  BIT23  0x00800000
372
#define  BIT24    0x01000000
371
#define  BIT24  0x01000000
373
#define  BIT25    0x02000000
372
#define  BIT25  0x02000000
374
#define  BIT26    0x04000000
373
#define  BIT26  0x04000000
375
#define  BIT27    0x08000000
374
#define  BIT27  0x08000000
376
#define  BIT28    0x10000000
375
#define  BIT28  0x10000000
377
#define  BIT29    0x20000000
376
#define  BIT29  0x20000000
378
#define  BIT30    0x40000000
377
#define  BIT30  0x40000000
379
#define  BIT31    0x80000000
378
#define  BIT31  0x80000000
380
#define  BIT32    0x0000000100000000ULL
379
#define  BIT32  0x0000000100000000ULL
381
#define  BIT33    0x0000000200000000ULL
380
#define  BIT33  0x0000000200000000ULL
382
#define  BIT34    0x0000000400000000ULL
381
#define  BIT34  0x0000000400000000ULL
383
#define  BIT35    0x0000000800000000ULL
382
#define  BIT35  0x0000000800000000ULL
384
#define  BIT36    0x0000001000000000ULL
383
#define  BIT36  0x0000001000000000ULL
385
#define  BIT37    0x0000002000000000ULL
384
#define  BIT37  0x0000002000000000ULL
386
#define  BIT38    0x0000004000000000ULL
385
#define  BIT38  0x0000004000000000ULL
387
#define  BIT39    0x0000008000000000ULL
386
#define  BIT39  0x0000008000000000ULL
388
#define  BIT40    0x0000010000000000ULL
387
#define  BIT40  0x0000010000000000ULL
389
#define  BIT41    0x0000020000000000ULL
388
#define  BIT41  0x0000020000000000ULL
390
#define  BIT42    0x0000040000000000ULL
389
#define  BIT42  0x0000040000000000ULL
391
#define  BIT43    0x0000080000000000ULL
390
#define  BIT43  0x0000080000000000ULL
392
#define  BIT44    0x0000100000000000ULL
391
#define  BIT44  0x0000100000000000ULL
393
#define  BIT45    0x0000200000000000ULL
392
#define  BIT45  0x0000200000000000ULL
394
#define  BIT46    0x0000400000000000ULL
393
#define  BIT46  0x0000400000000000ULL
395
#define  BIT47    0x0000800000000000ULL
394
#define  BIT47  0x0000800000000000ULL
396
#define  BIT48    0x0001000000000000ULL
395
#define  BIT48  0x0001000000000000ULL
397
#define  BIT49    0x0002000000000000ULL
396
#define  BIT49  0x0002000000000000ULL
398
#define  BIT50    0x0004000000000000ULL
397
#define  BIT50  0x0004000000000000ULL
399
#define  BIT51    0x0008000000000000ULL
398
#define  BIT51  0x0008000000000000ULL
400
#define  BIT52    0x0010000000000000ULL
399
#define  BIT52  0x0010000000000000ULL
401
#define  BIT53    0x0020000000000000ULL
400
#define  BIT53  0x0020000000000000ULL
402
#define  BIT54    0x0040000000000000ULL
401
#define  BIT54  0x0040000000000000ULL
403
#define  BIT55    0x0080000000000000ULL
402
#define  BIT55  0x0080000000000000ULL
404
#define  BIT56    0x0100000000000000ULL
403
#define  BIT56  0x0100000000000000ULL
405
#define  BIT57    0x0200000000000000ULL
404
#define  BIT57  0x0200000000000000ULL
406
#define  BIT58    0x0400000000000000ULL
405
#define  BIT58  0x0400000000000000ULL
407
#define  BIT59    0x0800000000000000ULL
406
#define  BIT59  0x0800000000000000ULL
408
#define  BIT60    0x1000000000000000ULL
407
#define  BIT60  0x1000000000000000ULL
409
#define  BIT61    0x2000000000000000ULL
408
#define  BIT61  0x2000000000000000ULL
410
#define  BIT62    0x4000000000000000ULL
409
#define  BIT62  0x4000000000000000ULL
411
#define  BIT63    0x8000000000000000ULL
410
#define  BIT63  0x8000000000000000ULL
412
411
413
#define  SIZE_1KB    0x00000400
412
#define  SIZE_1KB    0x00000400
414
#define  SIZE_2KB    0x00000800
413
#define  SIZE_2KB    0x00000800
Lines 577-629 struct _LIST_ENTRY { Link Here
577
576
578
  @return The aligned size.
577
  @return The aligned size.
579
**/
578
**/
580
#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
579
#define _INT_SIZE_OF(n)  ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
581
582
#if defined(__CC_ARM)
583
//
584
// RVCT ARM variable argument list support.
585
//
586
587
///
588
/// Variable used to traverse the list of arguments. This type can vary by
589
/// implementation and could be an array or structure.
590
///
591
#ifdef __APCS_ADSABI
592
  typedef int         *va_list[1];
593
  #define VA_LIST     va_list
594
#else
595
  typedef struct __va_list { void *__ap; } va_list;
596
  #define VA_LIST                          va_list
597
#endif
598
580
599
#define VA_START(Marker, Parameter)   __va_start(Marker, Parameter)
581
#if defined (_M_ARM) || defined (_M_ARM64)
600
601
#define VA_ARG(Marker, TYPE)          __va_arg(Marker, TYPE)
602
603
#define VA_END(Marker)                ((void)0)
604
605
// For some ARM RVCT compilers, __va_copy is not defined
606
#ifndef __va_copy
607
  #define __va_copy(dest, src) ((void)((dest) = (src)))
608
#endif
609
610
#define VA_COPY(Dest, Start)          __va_copy (Dest, Start)
611
612
#elif defined(_M_ARM) || defined(_M_ARM64)
613
//
582
//
614
// MSFT ARM variable argument list support.
583
// MSFT ARM variable argument list support.
615
//
584
//
616
585
617
typedef char* VA_LIST;
586
typedef char *VA_LIST;
618
587
619
#define VA_START(Marker, Parameter)     __va_start (&Marker, &Parameter, _INT_SIZE_OF (Parameter), __alignof(Parameter), &Parameter)
588
#define VA_START(Marker, Parameter)  __va_start (&Marker, &Parameter, _INT_SIZE_OF (Parameter), __alignof(Parameter), &Parameter)
620
#define VA_ARG(Marker, TYPE)            (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE)))
589
#define VA_ARG(Marker, TYPE)         (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE) + ((-(INTN)Marker) & (sizeof(TYPE) - 1))) - _INT_SIZE_OF (TYPE)))
621
#define VA_END(Marker)                  (Marker = (VA_LIST) 0)
590
#define VA_END(Marker)               (Marker = (VA_LIST) 0)
622
#define VA_COPY(Dest, Start)            ((void)((Dest) = (Start)))
591
#define VA_COPY(Dest, Start)         ((void)((Dest) = (Start)))
623
592
624
#elif defined(__GNUC__) || defined(__clang__)
593
#elif defined (__GNUC__) || defined (__clang__)
625
594
626
#if defined(MDE_CPU_X64) && !defined(NO_MSABI_VA_FUNCS)
595
  #if defined (MDE_CPU_X64) && !defined (NO_MSABI_VA_FUNCS)
627
//
596
//
628
// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists.
597
// X64 only. Use MS ABI version of GCC built-in macros for variable argument lists.
629
//
598
//
Lines 639-651 typedef __builtin_ms_va_list VA_LIST; Link Here
639
608
640
#define VA_START(Marker, Parameter)  __builtin_ms_va_start (Marker, Parameter)
609
#define VA_START(Marker, Parameter)  __builtin_ms_va_start (Marker, Parameter)
641
610
642
#define VA_ARG(Marker, TYPE)         ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
611
#define VA_ARG(Marker, TYPE)  ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
643
612
644
#define VA_END(Marker)               __builtin_ms_va_end (Marker)
613
#define VA_END(Marker)  __builtin_ms_va_end (Marker)
645
614
646
#define VA_COPY(Dest, Start)         __builtin_ms_va_copy (Dest, Start)
615
#define VA_COPY(Dest, Start)  __builtin_ms_va_copy (Dest, Start)
647
616
648
#else
617
  #else
649
//
618
//
650
// Use GCC built-in macros for variable argument lists.
619
// Use GCC built-in macros for variable argument lists.
651
//
620
//
Lines 658-670 typedef __builtin_va_list VA_LIST; Link Here
658
627
659
#define VA_START(Marker, Parameter)  __builtin_va_start (Marker, Parameter)
628
#define VA_START(Marker, Parameter)  __builtin_va_start (Marker, Parameter)
660
629
661
#define VA_ARG(Marker, TYPE)         ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
630
#define VA_ARG(Marker, TYPE)  ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
662
631
663
#define VA_END(Marker)               __builtin_va_end (Marker)
632
#define VA_END(Marker)  __builtin_va_end (Marker)
664
633
665
#define VA_COPY(Dest, Start)         __builtin_va_copy (Dest, Start)
634
#define VA_COPY(Dest, Start)  __builtin_va_copy (Dest, Start)
666
635
667
#endif
636
  #endif
668
637
669
#else
638
#else
670
///
639
///
Lines 689-695 typedef CHAR8 *VA_LIST; Link Here
689
  @return  A pointer to the beginning of a variable argument list.
658
  @return  A pointer to the beginning of a variable argument list.
690
659
691
**/
660
**/
692
#define VA_START(Marker, Parameter) (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF (Parameter)))
661
#define VA_START(Marker, Parameter)  (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF (Parameter)))
693
662
694
/**
663
/**
695
  Returns an argument of a specified type from a variable argument list and updates
664
  Returns an argument of a specified type from a variable argument list and updates
Lines 707-713 typedef CHAR8 *VA_LIST; Link Here
707
  @return  An argument of the type specified by TYPE.
676
  @return  An argument of the type specified by TYPE.
708
677
709
**/
678
**/
710
#define VA_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE)) - _INT_SIZE_OF (TYPE)))
679
#define VA_ARG(Marker, TYPE)  (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE)) - _INT_SIZE_OF (TYPE)))
711
680
712
/**
681
/**
713
  Terminates the use of a variable argument list.
682
  Terminates the use of a variable argument list.
Lines 719-725 typedef CHAR8 *VA_LIST; Link Here
719
  @param   Marker   VA_LIST used to traverse the list of arguments.
688
  @param   Marker   VA_LIST used to traverse the list of arguments.
720
689
721
**/
690
**/
722
#define VA_END(Marker)      (Marker = (VA_LIST) 0)
691
#define VA_END(Marker)  (Marker = (VA_LIST) 0)
723
692
724
/**
693
/**
725
  Initializes a VA_LIST as a copy of an existing VA_LIST.
694
  Initializes a VA_LIST as a copy of an existing VA_LIST.
Lines 739-745 typedef CHAR8 *VA_LIST; Link Here
739
///
708
///
740
/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *.
709
/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *.
741
///
710
///
742
typedef UINTN  *BASE_LIST;
711
typedef UINTN *BASE_LIST;
743
712
744
/**
713
/**
745
  Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary.
714
  Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary.
Lines 748-754 typedef UINTN *BASE_LIST; Link Here
748
717
749
  @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary.
718
  @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary.
750
**/
719
**/
751
#define _BASE_INT_SIZE_OF(TYPE) ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN))
720
#define _BASE_INT_SIZE_OF(TYPE)  ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN))
752
721
753
/**
722
/**
754
  Returns an argument of a specified type from a variable argument list and updates
723
  Returns an argument of a specified type from a variable argument list and updates
Lines 766-772 typedef UINTN *BASE_LIST; Link Here
766
  @return  An argument of the type specified by TYPE.
735
  @return  An argument of the type specified by TYPE.
767
736
768
**/
737
**/
769
#define BASE_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE)))
738
#define BASE_ARG(Marker, TYPE)  (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE)))
770
739
771
/**
740
/**
772
  The macro that returns the byte offset of a field in a data structure.
741
  The macro that returns the byte offset of a field in a data structure.
Lines 781-792 typedef UINTN *BASE_LIST; Link Here
781
  @return  Offset, in bytes, of field.
750
  @return  Offset, in bytes, of field.
782
751
783
**/
752
**/
784
#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)
753
#if (defined (__GNUC__) && __GNUC__ >= 4) || defined (__clang__)
785
#define OFFSET_OF(TYPE, Field) ((UINTN) __builtin_offsetof(TYPE, Field))
754
#define OFFSET_OF(TYPE, Field)  ((UINTN) __builtin_offsetof(TYPE, Field))
786
#endif
755
#endif
787
756
788
#ifndef OFFSET_OF
757
#ifndef OFFSET_OF
789
#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
758
#define OFFSET_OF(TYPE, Field)  ((UINTN) &(((TYPE *)0)->Field))
759
#endif
760
761
/**
762
  Returns the alignment requirement of a type.
763
764
  @param   TYPE  The name of the type to retrieve the alignment requirement of.
765
766
  @return  Alignment requirement, in Bytes, of TYPE.
767
**/
768
#if defined (__cplusplus)
769
//
770
// Standard C++ operator.
771
//
772
#define ALIGNOF(TYPE)  alignof (TYPE)
773
#elif defined (__GNUC__) || defined (__clang__) || (defined (_MSC_VER) && _MSC_VER >= 1900)
774
//
775
// All supported versions of GCC and Clang, as well as MSVC 2015 and later,
776
// support the standard operator _Alignof.
777
//
778
#define ALIGNOF(TYPE)  _Alignof (TYPE)
779
#elif defined (_MSC_EXTENSIONS)
780
//
781
// Earlier versions of MSVC, at least MSVC 2008 and later, support the vendor
782
// extension __alignof.
783
//
784
#define ALIGNOF(TYPE)  __alignof (TYPE)
785
#else
786
//
787
// For compilers that do not support inbuilt alignof operators, use OFFSET_OF.
788
// CHAR8 is known to have both a size and an alignment requirement of 1 Byte.
789
// As such, A must be located exactly at the offset equal to its alignment
790
// requirement.
791
//
792
#define ALIGNOF(TYPE)  OFFSET_OF (struct { CHAR8 C; TYPE A; }, A)
790
#endif
793
#endif
791
794
792
/**
795
/**
Lines 798-808 typedef UINTN *BASE_LIST; Link Here
798
801
799
**/
802
**/
800
#ifdef MDE_CPU_EBC
803
#ifdef MDE_CPU_EBC
801
  #define STATIC_ASSERT(Expression, Message)
804
#define STATIC_ASSERT(Expression, Message)
802
#elif defined(_MSC_EXTENSIONS)
805
#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus)
803
  #define STATIC_ASSERT static_assert
806
#define STATIC_ASSERT  static_assert
804
#else
807
#else
805
  #define STATIC_ASSERT _Static_assert
808
#define STATIC_ASSERT  _Static_assert
806
#endif
809
#endif
807
810
808
//
811
//
Lines 822-833 STATIC_ASSERT (sizeof (UINT64) == 8, "sizeof (UINT64) does not meet UEFI Specif Link Here
822
STATIC_ASSERT (sizeof (CHAR8)   == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements");
825
STATIC_ASSERT (sizeof (CHAR8)   == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements");
823
STATIC_ASSERT (sizeof (CHAR16)  == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements");
826
STATIC_ASSERT (sizeof (CHAR16)  == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements");
824
827
828
STATIC_ASSERT (ALIGNOF (BOOLEAN) == sizeof (BOOLEAN), "Alignment of BOOLEAN does not meet UEFI Specification Data Type requirements");
829
STATIC_ASSERT (ALIGNOF (INT8)    == sizeof (INT8), "Alignment of INT8 does not meet UEFI Specification Data Type requirements");
830
STATIC_ASSERT (ALIGNOF (UINT8)   == sizeof (UINT8), "Alignment of INT16 does not meet UEFI Specification Data Type requirements");
831
STATIC_ASSERT (ALIGNOF (INT16)   == sizeof (INT16), "Alignment of INT16 does not meet UEFI Specification Data Type requirements");
832
STATIC_ASSERT (ALIGNOF (UINT16)  == sizeof (UINT16), "Alignment of UINT16 does not meet UEFI Specification Data Type requirements");
833
STATIC_ASSERT (ALIGNOF (INT32)   == sizeof (INT32), "Alignment of INT32 does not meet UEFI Specification Data Type requirements");
834
STATIC_ASSERT (ALIGNOF (UINT32)  == sizeof (UINT32), "Alignment of UINT32 does not meet UEFI Specification Data Type requirements");
835
STATIC_ASSERT (ALIGNOF (INT64)   == sizeof (INT64), "Alignment of INT64 does not meet UEFI Specification Data Type requirements");
836
STATIC_ASSERT (ALIGNOF (UINT64)  == sizeof (UINT64), "Alignment of UINT64 does not meet UEFI Specification Data Type requirements");
837
STATIC_ASSERT (ALIGNOF (CHAR8)   == sizeof (CHAR8), "Alignment of CHAR8 does not meet UEFI Specification Data Type requirements");
838
STATIC_ASSERT (ALIGNOF (CHAR16)  == sizeof (CHAR16), "Alignment of CHAR16 does not meet UEFI Specification Data Type requirements");
839
STATIC_ASSERT (ALIGNOF (INTN)    == sizeof (INTN), "Alignment of INTN does not meet UEFI Specification Data Type requirements");
840
STATIC_ASSERT (ALIGNOF (UINTN)   == sizeof (UINTN), "Alignment of UINTN does not meet UEFI Specification Data Type requirements");
841
STATIC_ASSERT (ALIGNOF (VOID *)  == sizeof (VOID *), "Alignment of VOID * does not meet UEFI Specification Data Type requirements");
842
825
//
843
//
826
// The following three enum types are used to verify that the compiler
844
// The following three enum types are used to verify that the compiler
827
// configuration for enum types is compliant with Section 2.3.1 of the
845
// configuration for enum types is compliant with Section 2.3.1 of the
828
// UEFI 2.3 Specification. These enum types and enum values are not
846
// UEFI 2.3.1 Errata C Specification. These enum types and enum values
829
// intended to be used. A prefix of '__' is used avoid conflicts with
847
// are not intended to be used. A prefix of '__' is used avoid
830
// other types.
848
// conflicts with other types.
831
//
849
//
832
typedef enum {
850
typedef enum {
833
  __VerifyUint8EnumValue = 0xff
851
  __VerifyUint8EnumValue = 0xff
Lines 838-849 typedef enum { Link Here
838
} __VERIFY_UINT16_ENUM_SIZE;
856
} __VERIFY_UINT16_ENUM_SIZE;
839
857
840
typedef enum {
858
typedef enum {
841
  __VerifyUint32EnumValue = 0xffffffff
859
  __VerifyInt32EnumValue = 0x7fffffff
842
} __VERIFY_UINT32_ENUM_SIZE;
860
} __VERIFY_INT32_ENUM_SIZE;
843
861
844
STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
862
STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
845
STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
863
STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
846
STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
864
STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
865
866
STATIC_ASSERT (ALIGNOF (__VERIFY_UINT8_ENUM_SIZE)  == sizeof (__VERIFY_UINT8_ENUM_SIZE), "Alignment of enum does not meet UEFI Specification Data Type requirements");
867
STATIC_ASSERT (ALIGNOF (__VERIFY_UINT16_ENUM_SIZE) == sizeof (__VERIFY_UINT16_ENUM_SIZE), "Alignment of enum does not meet UEFI Specification Data Type requirements");
868
STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM_SIZE), "Alignment of enum does not meet UEFI Specification Data Type requirements");
847
869
848
/**
870
/**
849
  Macro that returns a pointer to the data structure that contains a specified field of
871
  Macro that returns a pointer to the data structure that contains a specified field of
Lines 866-871 STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not m Link Here
866
**/
888
**/
867
#define BASE_CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
889
#define BASE_CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
868
890
891
/**
892
  Checks whether a value is a power of two.
893
894
  @param   Value  The value to check.
895
896
  @retval TRUE   Value is a power of two.
897
  @retval FALSE  Value is not a power of two.
898
**/
899
#define IS_POW2(Value)  ((Value) != 0U && ((Value) & ((Value) - 1U)) == 0U)
900
901
/**
902
  Checks whether a value is aligned by a specified alignment.
903
904
  @param   Value      The value to check.
905
  @param   Alignment  The alignment boundary used to check against.
906
907
  @retval TRUE   Value is aligned by Alignment.
908
  @retval FALSE  Value is not aligned by Alignment.
909
**/
910
#define IS_ALIGNED(Value, Alignment)  (((Value) & ((Alignment) - 1U)) == 0U)
911
912
/**
913
  Checks whether a pointer or address is aligned by a specified alignment.
914
915
  @param   Address    The pointer or address to check.
916
  @param   Alignment  The alignment boundary used to check against.
917
918
  @retval TRUE   Address is aligned by Alignment.
919
  @retval FALSE  Address is not aligned by Alignment.
920
**/
921
#define ADDRESS_IS_ALIGNED(Address, Alignment)  IS_ALIGNED ((UINTN) (Address), Alignment)
922
923
/**
924
  Determines the addend to add to a value to round it up to the next boundary of
925
  a specified alignment.
926
927
  @param   Value      The value to round up.
928
  @param   Alignment  The alignment boundary used to return the addend.
929
930
  @return  Addend to round Value up to alignment boundary Alignment.
931
**/
932
#define ALIGN_VALUE_ADDEND(Value, Alignment)  (((Alignment) - (Value)) & ((Alignment) - 1U))
933
869
/**
934
/**
870
  Rounds a value up to the next boundary using a specified alignment.
935
  Rounds a value up to the next boundary using a specified alignment.
871
936
Lines 878-884 STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not m Link Here
878
  @return  A value up to the next boundary.
943
  @return  A value up to the next boundary.
879
944
880
**/
945
**/
881
#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1)))
946
#define ALIGN_VALUE(Value, Alignment)  ((Value) + ALIGN_VALUE_ADDEND (Value, Alignment))
882
947
883
/**
948
/**
884
  Adjust a pointer by adding the minimum offset required for it to be aligned on
949
  Adjust a pointer by adding the minimum offset required for it to be aligned on
Lines 893-899 STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not m Link Here
893
  @return  Pointer to the aligned address.
958
  @return  Pointer to the aligned address.
894
959
895
**/
960
**/
896
#define ALIGN_POINTER(Pointer, Alignment) ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment))))
961
#define ALIGN_POINTER(Pointer, Alignment)  ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment))))
897
962
898
/**
963
/**
899
  Rounds a value up to the next natural boundary for the current CPU.
964
  Rounds a value up to the next natural boundary for the current CPU.
Lines 909-915 STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not m Link Here
909
**/
974
**/
910
#define ALIGN_VARIABLE(Value)  ALIGN_VALUE ((Value), sizeof (UINTN))
975
#define ALIGN_VARIABLE(Value)  ALIGN_VALUE ((Value), sizeof (UINTN))
911
976
912
913
/**
977
/**
914
  Return the maximum of two operands.
978
  Return the maximum of two operands.
915
979
Lines 968-974 typedef UINTN RETURN_STATUS; Link Here
968
  @return The value specified by StatusCode with the highest bit set.
1032
  @return The value specified by StatusCode with the highest bit set.
969
1033
970
**/
1034
**/
971
#define ENCODE_ERROR(StatusCode)     ((RETURN_STATUS)(MAX_BIT | (StatusCode)))
1035
#define ENCODE_ERROR(StatusCode)  ((RETURN_STATUS)(MAX_BIT | (StatusCode)))
972
1036
973
/**
1037
/**
974
  Produces a RETURN_STATUS code with the highest bit clear.
1038
  Produces a RETURN_STATUS code with the highest bit clear.
Lines 979-985 typedef UINTN RETURN_STATUS; Link Here
979
  @return The value specified by StatusCode with the highest bit clear.
1043
  @return The value specified by StatusCode with the highest bit clear.
980
1044
981
**/
1045
**/
982
#define ENCODE_WARNING(StatusCode)   ((RETURN_STATUS)(StatusCode))
1046
#define ENCODE_WARNING(StatusCode)  ((RETURN_STATUS)(StatusCode))
983
1047
984
/**
1048
/**
985
  Returns TRUE if a specified RETURN_STATUS code is an error code.
1049
  Returns TRUE if a specified RETURN_STATUS code is an error code.
Lines 992-1129 typedef UINTN RETURN_STATUS; Link Here
992
  @retval FALSE         The high bit of StatusCode is clear.
1056
  @retval FALSE         The high bit of StatusCode is clear.
993
1057
994
**/
1058
**/
995
#define RETURN_ERROR(StatusCode)     (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
1059
#define RETURN_ERROR(StatusCode)  (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
996
1060
997
///
1061
///
998
/// The operation completed successfully.
1062
/// The operation completed successfully.
999
///
1063
///
1000
#define RETURN_SUCCESS               0
1064
#define RETURN_SUCCESS  (RETURN_STATUS)(0)
1001
1065
1002
///
1066
///
1003
/// The image failed to load.
1067
/// The image failed to load.
1004
///
1068
///
1005
#define RETURN_LOAD_ERROR            ENCODE_ERROR (1)
1069
#define RETURN_LOAD_ERROR  ENCODE_ERROR (1)
1006
1070
1007
///
1071
///
1008
/// The parameter was incorrect.
1072
/// The parameter was incorrect.
1009
///
1073
///
1010
#define RETURN_INVALID_PARAMETER     ENCODE_ERROR (2)
1074
#define RETURN_INVALID_PARAMETER  ENCODE_ERROR (2)
1011
1075
1012
///
1076
///
1013
/// The operation is not supported.
1077
/// The operation is not supported.
1014
///
1078
///
1015
#define RETURN_UNSUPPORTED           ENCODE_ERROR (3)
1079
#define RETURN_UNSUPPORTED  ENCODE_ERROR (3)
1016
1080
1017
///
1081
///
1018
/// The buffer was not the proper size for the request.
1082
/// The buffer was not the proper size for the request.
1019
///
1083
///
1020
#define RETURN_BAD_BUFFER_SIZE       ENCODE_ERROR (4)
1084
#define RETURN_BAD_BUFFER_SIZE  ENCODE_ERROR (4)
1021
1085
1022
///
1086
///
1023
/// The buffer was not large enough to hold the requested data.
1087
/// The buffer was not large enough to hold the requested data.
1024
/// The required buffer size is returned in the appropriate
1088
/// The required buffer size is returned in the appropriate
1025
/// parameter when this error occurs.
1089
/// parameter when this error occurs.
1026
///
1090
///
1027
#define RETURN_BUFFER_TOO_SMALL      ENCODE_ERROR (5)
1091
#define RETURN_BUFFER_TOO_SMALL  ENCODE_ERROR (5)
1028
1092
1029
///
1093
///
1030
/// There is no data pending upon return.
1094
/// There is no data pending upon return.
1031
///
1095
///
1032
#define RETURN_NOT_READY             ENCODE_ERROR (6)
1096
#define RETURN_NOT_READY  ENCODE_ERROR (6)
1033
1097
1034
///
1098
///
1035
/// The physical device reported an error while attempting the
1099
/// The physical device reported an error while attempting the
1036
/// operation.
1100
/// operation.
1037
///
1101
///
1038
#define RETURN_DEVICE_ERROR          ENCODE_ERROR (7)
1102
#define RETURN_DEVICE_ERROR  ENCODE_ERROR (7)
1039
1103
1040
///
1104
///
1041
/// The device can not be written to.
1105
/// The device can not be written to.
1042
///
1106
///
1043
#define RETURN_WRITE_PROTECTED       ENCODE_ERROR (8)
1107
#define RETURN_WRITE_PROTECTED  ENCODE_ERROR (8)
1044
1108
1045
///
1109
///
1046
/// The resource has run out.
1110
/// The resource has run out.
1047
///
1111
///
1048
#define RETURN_OUT_OF_RESOURCES      ENCODE_ERROR (9)
1112
#define RETURN_OUT_OF_RESOURCES  ENCODE_ERROR (9)
1049
1113
1050
///
1114
///
1051
/// An inconsistency was detected on the file system causing the
1115
/// An inconsistency was detected on the file system causing the
1052
/// operation to fail.
1116
/// operation to fail.
1053
///
1117
///
1054
#define RETURN_VOLUME_CORRUPTED      ENCODE_ERROR (10)
1118
#define RETURN_VOLUME_CORRUPTED  ENCODE_ERROR (10)
1055
1119
1056
///
1120
///
1057
/// There is no more space on the file system.
1121
/// There is no more space on the file system.
1058
///
1122
///
1059
#define RETURN_VOLUME_FULL           ENCODE_ERROR (11)
1123
#define RETURN_VOLUME_FULL  ENCODE_ERROR (11)
1060
1124
1061
///
1125
///
1062
/// The device does not contain any medium to perform the
1126
/// The device does not contain any medium to perform the
1063
/// operation.
1127
/// operation.
1064
///
1128
///
1065
#define RETURN_NO_MEDIA              ENCODE_ERROR (12)
1129
#define RETURN_NO_MEDIA  ENCODE_ERROR (12)
1066
1130
1067
///
1131
///
1068
/// The medium in the device has changed since the last
1132
/// The medium in the device has changed since the last
1069
/// access.
1133
/// access.
1070
///
1134
///
1071
#define RETURN_MEDIA_CHANGED         ENCODE_ERROR (13)
1135
#define RETURN_MEDIA_CHANGED  ENCODE_ERROR (13)
1072
1136
1073
///
1137
///
1074
/// The item was not found.
1138
/// The item was not found.
1075
///
1139
///
1076
#define RETURN_NOT_FOUND             ENCODE_ERROR (14)
1140
#define RETURN_NOT_FOUND  ENCODE_ERROR (14)
1077
1141
1078
///
1142
///
1079
/// Access was denied.
1143
/// Access was denied.
1080
///
1144
///
1081
#define RETURN_ACCESS_DENIED         ENCODE_ERROR (15)
1145
#define RETURN_ACCESS_DENIED  ENCODE_ERROR (15)
1082
1146
1083
///
1147
///
1084
/// The server was not found or did not respond to the request.
1148
/// The server was not found or did not respond to the request.
1085
///
1149
///
1086
#define RETURN_NO_RESPONSE           ENCODE_ERROR (16)
1150
#define RETURN_NO_RESPONSE  ENCODE_ERROR (16)
1087
1151
1088
///
1152
///
1089
/// A mapping to the device does not exist.
1153
/// A mapping to the device does not exist.
1090
///
1154
///
1091
#define RETURN_NO_MAPPING            ENCODE_ERROR (17)
1155
#define RETURN_NO_MAPPING  ENCODE_ERROR (17)
1092
1156
1093
///
1157
///
1094
/// A timeout time expired.
1158
/// A timeout time expired.
1095
///
1159
///
1096
#define RETURN_TIMEOUT               ENCODE_ERROR (18)
1160
#define RETURN_TIMEOUT  ENCODE_ERROR (18)
1097
1161
1098
///
1162
///
1099
/// The protocol has not been started.
1163
/// The protocol has not been started.
1100
///
1164
///
1101
#define RETURN_NOT_STARTED           ENCODE_ERROR (19)
1165
#define RETURN_NOT_STARTED  ENCODE_ERROR (19)
1102
1166
1103
///
1167
///
1104
/// The protocol has already been started.
1168
/// The protocol has already been started.
1105
///
1169
///
1106
#define RETURN_ALREADY_STARTED       ENCODE_ERROR (20)
1170
#define RETURN_ALREADY_STARTED  ENCODE_ERROR (20)
1107
1171
1108
///
1172
///
1109
/// The operation was aborted.
1173
/// The operation was aborted.
1110
///
1174
///
1111
#define RETURN_ABORTED               ENCODE_ERROR (21)
1175
#define RETURN_ABORTED  ENCODE_ERROR (21)
1112
1176
1113
///
1177
///
1114
/// An ICMP error occurred during the network operation.
1178
/// An ICMP error occurred during the network operation.
1115
///
1179
///
1116
#define RETURN_ICMP_ERROR            ENCODE_ERROR (22)
1180
#define RETURN_ICMP_ERROR  ENCODE_ERROR (22)
1117
1181
1118
///
1182
///
1119
/// A TFTP error occurred during the network operation.
1183
/// A TFTP error occurred during the network operation.
1120
///
1184
///
1121
#define RETURN_TFTP_ERROR            ENCODE_ERROR (23)
1185
#define RETURN_TFTP_ERROR  ENCODE_ERROR (23)
1122
1186
1123
///
1187
///
1124
/// A protocol error occurred during the network operation.
1188
/// A protocol error occurred during the network operation.
1125
///
1189
///
1126
#define RETURN_PROTOCOL_ERROR        ENCODE_ERROR (24)
1190
#define RETURN_PROTOCOL_ERROR  ENCODE_ERROR (24)
1127
1191
1128
///
1192
///
1129
/// A function encountered an internal version that was
1193
/// A function encountered an internal version that was
Lines 1134-1207 typedef UINTN RETURN_STATUS; Link Here
1134
///
1198
///
1135
/// The function was not performed due to a security violation.
1199
/// The function was not performed due to a security violation.
1136
///
1200
///
1137
#define RETURN_SECURITY_VIOLATION    ENCODE_ERROR (26)
1201
#define RETURN_SECURITY_VIOLATION  ENCODE_ERROR (26)
1138
1202
1139
///
1203
///
1140
/// A CRC error was detected.
1204
/// A CRC error was detected.
1141
///
1205
///
1142
#define RETURN_CRC_ERROR             ENCODE_ERROR (27)
1206
#define RETURN_CRC_ERROR  ENCODE_ERROR (27)
1143
1207
1144
///
1208
///
1145
/// The beginning or end of media was reached.
1209
/// The beginning or end of media was reached.
1146
///
1210
///
1147
#define RETURN_END_OF_MEDIA          ENCODE_ERROR (28)
1211
#define RETURN_END_OF_MEDIA  ENCODE_ERROR (28)
1148
1212
1149
///
1213
///
1150
/// The end of the file was reached.
1214
/// The end of the file was reached.
1151
///
1215
///
1152
#define RETURN_END_OF_FILE           ENCODE_ERROR (31)
1216
#define RETURN_END_OF_FILE  ENCODE_ERROR (31)
1153
1217
1154
///
1218
///
1155
/// The language specified was invalid.
1219
/// The language specified was invalid.
1156
///
1220
///
1157
#define RETURN_INVALID_LANGUAGE      ENCODE_ERROR (32)
1221
#define RETURN_INVALID_LANGUAGE  ENCODE_ERROR (32)
1158
1222
1159
///
1223
///
1160
/// The security status of the data is unknown or compromised
1224
/// The security status of the data is unknown or compromised
1161
/// and the data must be updated or replaced to restore a valid
1225
/// and the data must be updated or replaced to restore a valid
1162
/// security status.
1226
/// security status.
1163
///
1227
///
1164
#define RETURN_COMPROMISED_DATA      ENCODE_ERROR (33)
1228
#define RETURN_COMPROMISED_DATA  ENCODE_ERROR (33)
1229
1230
///
1231
/// There is an address conflict address allocation.
1232
///
1233
#define RETURN_IP_ADDRESS_CONFLICT  ENCODE_ERROR (34)
1165
1234
1166
///
1235
///
1167
/// A HTTP error occurred during the network operation.
1236
/// A HTTP error occurred during the network operation.
1168
///
1237
///
1169
#define RETURN_HTTP_ERROR            ENCODE_ERROR (35)
1238
#define RETURN_HTTP_ERROR  ENCODE_ERROR (35)
1170
1239
1171
///
1240
///
1172
/// The string contained one or more characters that
1241
/// The string contained one or more characters that
1173
/// the device could not render and were skipped.
1242
/// the device could not render and were skipped.
1174
///
1243
///
1175
#define RETURN_WARN_UNKNOWN_GLYPH    ENCODE_WARNING (1)
1244
#define RETURN_WARN_UNKNOWN_GLYPH  ENCODE_WARNING (1)
1176
1245
1177
///
1246
///
1178
/// The handle was closed, but the file was not deleted.
1247
/// The handle was closed, but the file was not deleted.
1179
///
1248
///
1180
#define RETURN_WARN_DELETE_FAILURE   ENCODE_WARNING (2)
1249
#define RETURN_WARN_DELETE_FAILURE  ENCODE_WARNING (2)
1181
1250
1182
///
1251
///
1183
/// The handle was closed, but the data to the file was not
1252
/// The handle was closed, but the data to the file was not
1184
/// flushed properly.
1253
/// flushed properly.
1185
///
1254
///
1186
#define RETURN_WARN_WRITE_FAILURE    ENCODE_WARNING (3)
1255
#define RETURN_WARN_WRITE_FAILURE  ENCODE_WARNING (3)
1187
1256
1188
///
1257
///
1189
/// The resulting buffer was too small, and the data was
1258
/// The resulting buffer was too small, and the data was
1190
/// truncated to the buffer size.
1259
/// truncated to the buffer size.
1191
///
1260
///
1192
#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
1261
#define RETURN_WARN_BUFFER_TOO_SMALL  ENCODE_WARNING (4)
1193
1262
1194
///
1263
///
1195
/// The data has not been updated within the timeframe set by
1264
/// The data has not been updated within the timeframe set by
1196
/// local policy for this type of data.
1265
/// local policy for this type of data.
1197
///
1266
///
1198
#define RETURN_WARN_STALE_DATA       ENCODE_WARNING (5)
1267
#define RETURN_WARN_STALE_DATA  ENCODE_WARNING (5)
1199
1268
1200
///
1269
///
1201
/// The resulting buffer contains UEFI-compliant file system.
1270
/// The resulting buffer contains UEFI-compliant file system.
1202
///
1271
///
1203
#define RETURN_WARN_FILE_SYSTEM      ENCODE_WARNING (6)
1272
#define RETURN_WARN_FILE_SYSTEM  ENCODE_WARNING (6)
1204
1273
1274
///
1275
/// The operation will be processed across a system reset.
1276
///
1277
#define RETURN_WARN_RESET_REQUIRED  ENCODE_WARNING (7)
1205
1278
1206
/**
1279
/**
1207
  Returns a 16-bit signature built from 2 ASCII characters.
1280
  Returns a 16-bit signature built from 2 ASCII characters.
Lines 1215-1221 typedef UINTN RETURN_STATUS; Link Here
1215
  @return A 16-bit value built from the two ASCII characters specified by A and B.
1288
  @return A 16-bit value built from the two ASCII characters specified by A and B.
1216
1289
1217
**/
1290
**/
1218
#define SIGNATURE_16(A, B)        ((A) | (B << 8))
1291
#define SIGNATURE_16(A, B)  ((A) | (B << 8))
1219
1292
1220
/**
1293
/**
1221
  Returns a 32-bit signature built from 4 ASCII characters.
1294
  Returns a 32-bit signature built from 4 ASCII characters.
Lines 1256-1301 typedef UINTN RETURN_STATUS; Link Here
1256
#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
1329
#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
1257
    (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
1330
    (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
1258
1331
1259
#if defined(_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_EBC)
1332
#if defined (_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_EBC)
1260
  void * _ReturnAddress(void);
1333
void *
1334
_ReturnAddress (
1335
  void
1336
  );
1337
1261
  #pragma intrinsic(_ReturnAddress)
1338
  #pragma intrinsic(_ReturnAddress)
1262
  /**
1263
    Get the return address of the calling function.
1264
1339
1265
    Based on intrinsic function _ReturnAddress that provides the address of
1340
/**
1266
    the instruction in the calling function that will be executed after
1341
  Get the return address of the calling function.
1267
    control returns to the caller.
1342
1343
  Based on intrinsic function _ReturnAddress that provides the address of
1344
  the instruction in the calling function that will be executed after
1345
  control returns to the caller.
1268
1346
1269
    @param L    Return Level.
1347
  @param L    Return Level.
1270
1348
1271
    @return The return address of the calling function or 0 if L != 0.
1349
  @return The return address of the calling function or 0 if L != 0.
1272
1350
1273
  **/
1351
**/
1274
  #define RETURN_ADDRESS(L)     ((L == 0) ? _ReturnAddress() : (VOID *) 0)
1352
#define RETURN_ADDRESS(L)  ((L == 0) ? _ReturnAddress() : (VOID *) 0)
1275
#elif defined (__GNUC__) || defined (__clang__)
1353
#elif defined (__GNUC__) || defined (__clang__)
1276
  void * __builtin_return_address (unsigned int level);
1277
  /**
1278
    Get the return address of the calling function.
1279
1354
1280
    Based on built-in Function __builtin_return_address that returns
1355
/**
1281
    the return address of the current function, or of one of its callers.
1356
  Get the return address of the calling function.
1357
1358
  Based on built-in Function __builtin_return_address that returns
1359
  the return address of the current function, or of one of its callers.
1282
1360
1283
    @param L    Return Level.
1361
  @param L    Return Level.
1284
1362
1285
    @return The return address of the calling function.
1363
  @return The return address of the calling function.
1286
1364
1287
  **/
1365
**/
1288
  #define RETURN_ADDRESS(L)     __builtin_return_address (L)
1366
#define RETURN_ADDRESS(L)  __builtin_return_address (L)
1289
#else
1367
#else
1290
  /**
1291
    Get the return address of the calling function.
1292
1368
1293
    @param L    Return Level.
1369
/**
1370
  Get the return address of the calling function.
1294
1371
1295
    @return 0 as compilers don't support this feature.
1372
  @param L    Return Level.
1296
1373
1297
  **/
1374
  @return 0 as compilers don't support this feature.
1298
  #define RETURN_ADDRESS(L)     ((VOID *) 0)
1375
1376
**/
1377
#define RETURN_ADDRESS(L)  ((VOID *) 0)
1299
#endif
1378
#endif
1300
1379
1301
/**
1380
/**
Lines 1309-1315 typedef UINTN RETURN_STATUS; Link Here
1309
  @return The number of elements in Array. The result has type UINTN.
1388
  @return The number of elements in Array. The result has type UINTN.
1310
1389
1311
**/
1390
**/
1312
#define ARRAY_SIZE(Array) (sizeof (Array) / sizeof ((Array)[0]))
1391
#define ARRAY_SIZE(Array)  (sizeof (Array) / sizeof ((Array)[0]))
1313
1392
1314
#endif
1393
#endif
1315
(-)b/sys/contrib/edk2/Include/Guid/HiiFormMapMethodGuid.h (-1 / +1 lines)
Lines 14-19 Link Here
14
#define EFI_HII_STANDARD_FORM_GUID \
14
#define EFI_HII_STANDARD_FORM_GUID \
15
  { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } }
15
  { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } }
16
16
17
extern EFI_GUID gEfiHiiStandardFormGuid;
17
extern EFI_GUID  gEfiHiiStandardFormGuid;
18
18
19
#endif
19
#endif
(-)b/sys/contrib/edk2/Include/Guid/PcAnsi.h (-6 / +6 lines)
Lines 42-52 Link Here
42
    0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
42
    0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
43
  }
43
  }
44
44
45
extern EFI_GUID gEfiPcAnsiGuid;
45
extern EFI_GUID  gEfiPcAnsiGuid;
46
extern EFI_GUID gEfiVT100Guid;
46
extern EFI_GUID  gEfiVT100Guid;
47
extern EFI_GUID gEfiVT100PlusGuid;
47
extern EFI_GUID  gEfiVT100PlusGuid;
48
extern EFI_GUID gEfiVTUTF8Guid;
48
extern EFI_GUID  gEfiVTUTF8Guid;
49
extern EFI_GUID gEfiUartDevicePathGuid;
49
extern EFI_GUID  gEfiUartDevicePathGuid;
50
extern EFI_GUID gEfiSasDevicePathGuid;
50
extern EFI_GUID  gEfiSasDevicePathGuid;
51
51
52
#endif
52
#endif
(-)b/sys/contrib/edk2/Include/Guid/WinCertificate.h (-17 / +15 lines)
Lines 14-22 Link Here
14
//
14
//
15
// _WIN_CERTIFICATE.wCertificateType
15
// _WIN_CERTIFICATE.wCertificateType
16
//
16
//
17
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
17
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA  0x0002
18
#define WIN_CERT_TYPE_EFI_PKCS115      0x0EF0
18
#define WIN_CERT_TYPE_EFI_PKCS115       0x0EF0
19
#define WIN_CERT_TYPE_EFI_GUID         0x0EF1
19
#define WIN_CERT_TYPE_EFI_GUID          0x0EF1
20
20
21
///
21
///
22
/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
22
/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
Lines 26-43 typedef struct { Link Here
26
  /// The length of the entire certificate,
26
  /// The length of the entire certificate,
27
  /// including the length of the header, in bytes.
27
  /// including the length of the header, in bytes.
28
  ///
28
  ///
29
  UINT32  dwLength;
29
  UINT32    dwLength;
30
  ///
30
  ///
31
  /// The revision level of the WIN_CERTIFICATE
31
  /// The revision level of the WIN_CERTIFICATE
32
  /// structure. The current revision level is 0x0200.
32
  /// structure. The current revision level is 0x0200.
33
  ///
33
  ///
34
  UINT16  wRevision;
34
  UINT16    wRevision;
35
  ///
35
  ///
36
  /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
36
  /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
37
  /// certificate types. The UEFI specification reserves the range of
37
  /// certificate types. The UEFI specification reserves the range of
38
  /// certificate type values from 0x0EF0 to 0x0EFF.
38
  /// certificate type values from 0x0EF0 to 0x0EFF.
39
  ///
39
  ///
40
  UINT16  wCertificateType;
40
  UINT16    wCertificateType;
41
  ///
41
  ///
42
  /// The following is the actual certificate. The format of
42
  /// The following is the actual certificate. The format of
43
  /// the certificate depends on wCertificateType.
43
  /// the certificate depends on wCertificateType.
Lines 56-67 typedef struct { Link Here
56
/// WIN_CERTIFICATE_UEFI_GUID.CertData
56
/// WIN_CERTIFICATE_UEFI_GUID.CertData
57
///
57
///
58
typedef struct {
58
typedef struct {
59
  EFI_GUID  HashType;
59
  EFI_GUID    HashType;
60
  UINT8     PublicKey[256];
60
  UINT8       PublicKey[256];
61
  UINT8     Signature[256];
61
  UINT8       Signature[256];
62
} EFI_CERT_BLOCK_RSA_2048_SHA256;
62
} EFI_CERT_BLOCK_RSA_2048_SHA256;
63
63
64
65
///
64
///
66
/// Certificate which encapsulates a GUID-specific digital signature
65
/// Certificate which encapsulates a GUID-specific digital signature
67
///
66
///
Lines 70-91 typedef struct { Link Here
70
  /// This is the standard WIN_CERTIFICATE header, where
69
  /// This is the standard WIN_CERTIFICATE header, where
71
  /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
70
  /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID.
72
  ///
71
  ///
73
  WIN_CERTIFICATE   Hdr;
72
  WIN_CERTIFICATE    Hdr;
74
  ///
73
  ///
75
  /// This is the unique id which determines the
74
  /// This is the unique id which determines the
76
  /// format of the CertData. .
75
  /// format of the CertData. .
77
  ///
76
  ///
78
  EFI_GUID          CertType;
77
  EFI_GUID           CertType;
79
  ///
78
  ///
80
  /// The following is the certificate data. The format of
79
  /// The following is the certificate data. The format of
81
  /// the data is determined by the CertType.
80
  /// the data is determined by the CertType.
82
  /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
81
  /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
83
  /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
82
  /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
84
  ///
83
  ///
85
  UINT8            CertData[1];
84
  UINT8              CertData[1];
86
} WIN_CERTIFICATE_UEFI_GUID;
85
} WIN_CERTIFICATE_UEFI_GUID;
87
86
88
89
///
87
///
90
/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
88
/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
91
///
89
///
Lines 99-110 typedef struct { Link Here
99
  /// This is the standard WIN_CERTIFICATE header, where
97
  /// This is the standard WIN_CERTIFICATE header, where
100
  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
98
  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
101
  ///
99
  ///
102
  WIN_CERTIFICATE Hdr;
100
  WIN_CERTIFICATE    Hdr;
103
  ///
101
  ///
104
  /// This is the hashing algorithm which was performed on the
102
  /// This is the hashing algorithm which was performed on the
105
  /// UEFI executable when creating the digital signature.
103
  /// UEFI executable when creating the digital signature.
106
  ///
104
  ///
107
  EFI_GUID        HashAlgorithm;
105
  EFI_GUID           HashAlgorithm;
108
  ///
106
  ///
109
  /// The following is the actual digital signature. The
107
  /// The following is the actual digital signature. The
110
  /// size of the signature is the same size as the key
108
  /// size of the signature is the same size as the key
Lines 117-122 typedef struct { Link Here
117
  ///
115
  ///
118
} WIN_CERTIFICATE_EFI_PKCS1_15;
116
} WIN_CERTIFICATE_EFI_PKCS1_15;
119
117
120
extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid;
118
extern EFI_GUID  gEfiCertTypeRsa2048Sha256Guid;
121
119
122
#endif
120
#endif
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi10.h (-231 / +242 lines)
Lines 2-7 Link Here
2
  ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
2
  ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3
3
4
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
4
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5
Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
5
SPDX-License-Identifier: BSD-2-Clause-Patent
6
SPDX-License-Identifier: BSD-2-Clause-Patent
6
**/
7
**/
7
8
Lines 15-22 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
15
/// excluding the RSD PTR structure.
16
/// excluding the RSD PTR structure.
16
///
17
///
17
typedef struct {
18
typedef struct {
18
  UINT32  Signature;
19
  UINT32    Signature;
19
  UINT32  Length;
20
  UINT32    Length;
20
} EFI_ACPI_COMMON_HEADER;
21
} EFI_ACPI_COMMON_HEADER;
21
22
22
#pragma pack(1)
23
#pragma pack(1)
Lines 24-107 typedef struct { Link Here
24
/// The common ACPI description table header.  This structure prefaces most ACPI tables.
25
/// The common ACPI description table header.  This structure prefaces most ACPI tables.
25
///
26
///
26
typedef struct {
27
typedef struct {
27
  UINT32  Signature;
28
  UINT32    Signature;
28
  UINT32  Length;
29
  UINT32    Length;
29
  UINT8   Revision;
30
  UINT8     Revision;
30
  UINT8   Checksum;
31
  UINT8     Checksum;
31
  UINT8   OemId[6];
32
  UINT8     OemId[6];
32
  UINT64  OemTableId;
33
  UINT64    OemTableId;
33
  UINT32  OemRevision;
34
  UINT32    OemRevision;
34
  UINT32  CreatorId;
35
  UINT32    CreatorId;
35
  UINT32  CreatorRevision;
36
  UINT32    CreatorRevision;
36
} EFI_ACPI_DESCRIPTION_HEADER;
37
} EFI_ACPI_DESCRIPTION_HEADER;
37
#pragma pack()
38
#pragma pack()
38
39
39
//
40
//
40
// Define for Descriptor
41
// Define for Descriptor
41
//
42
//
42
#define ACPI_SMALL_ITEM_FLAG                   0x00
43
#define ACPI_SMALL_ITEM_FLAG  0x00
43
#define ACPI_LARGE_ITEM_FLAG                   0x01
44
#define ACPI_LARGE_ITEM_FLAG  0x01
44
45
45
//
46
//
46
// Small Item Descriptor Name
47
// Small Item Descriptor Name
47
//
48
//
48
#define ACPI_SMALL_IRQ_DESCRIPTOR_NAME                       0x04
49
#define ACPI_SMALL_IRQ_DESCRIPTOR_NAME              0x04
49
#define ACPI_SMALL_DMA_DESCRIPTOR_NAME                       0x05
50
#define ACPI_SMALL_DMA_DESCRIPTOR_NAME              0x05
50
#define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME           0x06
51
#define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME  0x06
51
#define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME             0x07
52
#define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME    0x07
52
#define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME                   0x08
53
#define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME          0x08
53
#define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME             0x09
54
#define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME    0x09
54
#define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME            0x0E
55
#define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME   0x0E
55
#define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME                   0x0F
56
#define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME          0x0F
56
57
57
//
58
//
58
// Large Item Descriptor Name
59
// Large Item Descriptor Name
59
//
60
//
60
#define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME       0x01
61
#define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME        0x01
61
#define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME            0x04
62
#define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME             0x04
62
#define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME       0x05
63
#define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME        0x05
63
#define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
64
#define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME  0x06
64
#define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME       0x07
65
#define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME        0x07
65
#define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME        0x08
66
#define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME         0x08
66
#define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME              0x09
67
#define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME               0x09
67
#define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME       0x0A
68
#define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME        0x0A
68
69
69
//
70
//
70
// Small Item Descriptor Value
71
// Small Item Descriptor Value
71
//
72
//
72
#define ACPI_IRQ_NOFLAG_DESCRIPTOR                0x22
73
#define ACPI_IRQ_NOFLAG_DESCRIPTOR              0x22
73
#define ACPI_IRQ_DESCRIPTOR                       0x23
74
#define ACPI_IRQ_DESCRIPTOR                     0x23
74
#define ACPI_DMA_DESCRIPTOR                       0x2A
75
#define ACPI_DMA_DESCRIPTOR                     0x2A
75
#define ACPI_START_DEPENDENT_DESCRIPTOR           0x30
76
#define ACPI_START_DEPENDENT_DESCRIPTOR         0x30
76
#define ACPI_START_DEPENDENT_EX_DESCRIPTOR        0x31
77
#define ACPI_START_DEPENDENT_EX_DESCRIPTOR      0x31
77
#define ACPI_END_DEPENDENT_DESCRIPTOR             0x38
78
#define ACPI_END_DEPENDENT_DESCRIPTOR           0x38
78
#define ACPI_IO_PORT_DESCRIPTOR                   0x47
79
#define ACPI_IO_PORT_DESCRIPTOR                 0x47
79
#define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR    0x4B
80
#define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR  0x4B
80
#define ACPI_END_TAG_DESCRIPTOR                   0x79
81
#define ACPI_END_TAG_DESCRIPTOR                 0x79
81
82
82
//
83
//
83
// Large Item Descriptor Value
84
// Large Item Descriptor Value
84
//
85
//
85
#define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR       0x81
86
#define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR        0x81
86
#define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR       0x85
87
#define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR        0x85
87
#define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
88
#define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR  0x86
88
#define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR       0x87
89
#define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR        0x87
89
#define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR        0x88
90
#define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR         0x88
90
#define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR        0x89
91
#define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR         0x89
91
#define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR       0x8A
92
#define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR        0x8A
92
#define ACPI_ADDRESS_SPACE_DESCRIPTOR             0x8A
93
#define ACPI_ADDRESS_SPACE_DESCRIPTOR              0x8A
93
94
94
//
95
//
95
// Resource Type
96
// Resource Type
96
//
97
//
97
#define ACPI_ADDRESS_SPACE_TYPE_MEM   0x00
98
#define ACPI_ADDRESS_SPACE_TYPE_MEM  0x00
98
#define ACPI_ADDRESS_SPACE_TYPE_IO    0x01
99
#define ACPI_ADDRESS_SPACE_TYPE_IO   0x01
99
#define ACPI_ADDRESS_SPACE_TYPE_BUS   0x02
100
#define ACPI_ADDRESS_SPACE_TYPE_BUS  0x02
100
101
101
///
102
///
102
/// Power Management Timer frequency is fixed at 3.579545MHz.
103
/// Power Management Timer frequency is fixed at 3.579545MHz.
103
///
104
///
104
#define ACPI_TIMER_FREQUENCY       3579545
105
#define ACPI_TIMER_FREQUENCY  3579545
105
106
106
//
107
//
107
// Ensure proper structure formats
108
// Ensure proper structure formats
Lines 113-195 typedef struct { Link Here
113
/// Address Space Descriptors.
114
/// Address Space Descriptors.
114
///
115
///
115
typedef PACKED struct {
116
typedef PACKED struct {
116
  UINT8   Desc;
117
  UINT8     Desc;
117
  UINT16  Len;
118
  UINT16    Len;
118
  UINT8   ResType;
119
  UINT8     ResType;
119
  UINT8   GenFlag;
120
  UINT8     GenFlag;
120
  UINT8   SpecificFlag;
121
  UINT8     SpecificFlag;
121
  UINT64  AddrSpaceGranularity;
122
  UINT64    AddrSpaceGranularity;
122
  UINT64  AddrRangeMin;
123
  UINT64    AddrRangeMin;
123
  UINT64  AddrRangeMax;
124
  UINT64    AddrRangeMax;
124
  UINT64  AddrTranslationOffset;
125
  UINT64    AddrTranslationOffset;
125
  UINT64  AddrLen;
126
  UINT64    AddrLen;
126
} EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
127
} EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
127
128
128
typedef PACKED union {
129
typedef PACKED union {
129
  UINT8     Byte;
130
  UINT8    Byte;
130
  PACKED struct {
131
  PACKED struct {
131
    UINT8 Length : 3;
132
    UINT8    Length : 3;
132
    UINT8 Name : 4;
133
    UINT8    Name   : 4;
133
    UINT8 Type : 1;
134
    UINT8    Type   : 1;
134
  } Bits;
135
  } Bits;
135
} ACPI_SMALL_RESOURCE_HEADER;
136
} ACPI_SMALL_RESOURCE_HEADER;
136
137
137
typedef PACKED struct {
138
typedef PACKED struct {
138
  PACKED union {
139
  PACKED union {
139
    UINT8 Byte;
140
    UINT8    Byte;
140
    PACKED struct {
141
    PACKED struct {
141
      UINT8 Name : 7;
142
      UINT8    Name : 7;
142
      UINT8 Type : 1;
143
      UINT8    Type : 1;
143
    }Bits;
144
    } Bits;
144
  } Header;
145
  } Header;
145
  UINT16 Length;
146
  UINT16    Length;
146
} ACPI_LARGE_RESOURCE_HEADER;
147
} ACPI_LARGE_RESOURCE_HEADER;
147
148
148
///
149
///
149
/// IRQ Descriptor.
150
/// IRQ Descriptor.
150
///
151
///
151
typedef PACKED struct {
152
typedef PACKED struct {
152
  ACPI_SMALL_RESOURCE_HEADER   Header;
153
  ACPI_SMALL_RESOURCE_HEADER    Header;
153
  UINT16                       Mask;
154
  UINT16                        Mask;
154
} EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR;
155
} EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR;
155
156
156
///
157
///
157
/// IRQ Descriptor.
158
/// IRQ Descriptor.
158
///
159
///
159
typedef PACKED struct {
160
typedef PACKED struct {
160
  ACPI_SMALL_RESOURCE_HEADER   Header;
161
  ACPI_SMALL_RESOURCE_HEADER    Header;
161
  UINT16                       Mask;
162
  UINT16                        Mask;
162
  UINT8                        Information;
163
  UINT8                         Information;
163
} EFI_ACPI_IRQ_DESCRIPTOR;
164
} EFI_ACPI_IRQ_DESCRIPTOR;
164
165
165
///
166
///
166
/// DMA Descriptor.
167
/// DMA Descriptor.
167
///
168
///
168
typedef PACKED struct {
169
typedef PACKED struct {
169
  ACPI_SMALL_RESOURCE_HEADER   Header;
170
  ACPI_SMALL_RESOURCE_HEADER    Header;
170
  UINT8                        ChannelMask;
171
  UINT8                         ChannelMask;
171
  UINT8                        Information;
172
  UINT8                         Information;
172
} EFI_ACPI_DMA_DESCRIPTOR;
173
} EFI_ACPI_DMA_DESCRIPTOR;
173
174
174
///
175
///
175
/// I/O Port Descriptor
176
/// I/O Port Descriptor
176
///
177
///
177
typedef PACKED struct {
178
typedef PACKED struct {
178
  ACPI_SMALL_RESOURCE_HEADER   Header;
179
  ACPI_SMALL_RESOURCE_HEADER    Header;
179
  UINT8                        Information;
180
  UINT8                         Information;
180
  UINT16                       BaseAddressMin;
181
  UINT16                        BaseAddressMin;
181
  UINT16                       BaseAddressMax;
182
  UINT16                        BaseAddressMax;
182
  UINT8                        Alignment;
183
  UINT8                         Alignment;
183
  UINT8                        Length;
184
  UINT8                         Length;
184
} EFI_ACPI_IO_PORT_DESCRIPTOR;
185
} EFI_ACPI_IO_PORT_DESCRIPTOR;
185
186
186
///
187
///
187
/// Fixed Location I/O Port Descriptor.
188
/// Fixed Location I/O Port Descriptor.
188
///
189
///
189
typedef PACKED struct {
190
typedef PACKED struct {
190
  ACPI_SMALL_RESOURCE_HEADER   Header;
191
  ACPI_SMALL_RESOURCE_HEADER    Header;
191
  UINT16                       BaseAddress;
192
  UINT16                        BaseAddress;
192
  UINT8                        Length;
193
  UINT8                         Length;
193
} EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR;
194
} EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR;
194
195
195
///
196
///
Lines 287-303 typedef PACKED struct { Link Here
287
/// The End tag identifies an end of resource data.
288
/// The End tag identifies an end of resource data.
288
///
289
///
289
typedef struct {
290
typedef struct {
290
  UINT8 Desc;
291
  UINT8    Desc;
291
  UINT8 Checksum;
292
  UINT8    Checksum;
292
} EFI_ACPI_END_TAG_DESCRIPTOR;
293
} EFI_ACPI_END_TAG_DESCRIPTOR;
293
294
294
//
295
//
295
// General use definitions
296
// General use definitions
296
//
297
//
297
#define EFI_ACPI_RESERVED_BYTE  0x00
298
#define EFI_ACPI_RESERVED_BYTE   0x00
298
#define EFI_ACPI_RESERVED_WORD  0x0000
299
#define EFI_ACPI_RESERVED_WORD   0x0000
299
#define EFI_ACPI_RESERVED_DWORD 0x00000000
300
#define EFI_ACPI_RESERVED_DWORD  0x00000000
300
#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
301
#define EFI_ACPI_RESERVED_QWORD  0x0000000000000000
301
302
302
//
303
//
303
// Resource Type Specific Flags
304
// Resource Type Specific Flags
Lines 305-380 typedef struct { Link Here
305
//
306
//
306
// Bit [0]    : Write Status, _RW
307
// Bit [0]    : Write Status, _RW
307
//
308
//
308
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE                (1 << 0)
309
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE  (1 << 0)
309
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY                 (0 << 0)
310
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY   (0 << 0)
310
//
311
//
311
// Bit [2:1]  : Memory Attributes, _MEM
312
// Bit [2:1]  : Memory Attributes, _MEM
312
//
313
//
313
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE             (0 << 1)
314
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE              (0 << 1)
314
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE                 (1 << 1)
315
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE                  (1 << 1)
315
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
316
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING  (2 << 1)
316
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE    (3 << 1)
317
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE     (3 << 1)
317
//
318
//
318
// Bit [4:3]  : Memory Attributes, _MTP
319
// Bit [4:3]  : Memory Attributes, _MTP
319
//
320
//
320
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY      (0 << 3)
321
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY    (0 << 3)
321
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED    (1 << 3)
322
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED  (1 << 3)
322
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI        (2 << 3)
323
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI      (2 << 3)
323
#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS         (3 << 3)
324
#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS       (3 << 3)
324
//
325
//
325
// Bit [5]    : Memory to I/O Translation, _TTP
326
// Bit [5]    : Memory to I/O Translation, _TTP
326
//
327
//
327
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION          (1 << 5)
328
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION  (1 << 5)
328
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC               (0 << 5)
329
#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC       (0 << 5)
329
330
330
//
331
//
331
// IRQ Information
332
// IRQ Information
332
// Ref ACPI specification 6.4.2.1
333
// Ref ACPI specification 6.4.2.1
333
//
334
//
334
#define EFI_ACPI_IRQ_SHARABLE_MASK                      0x10
335
#define EFI_ACPI_IRQ_SHARABLE_MASK  0x10
335
#define   EFI_ACPI_IRQ_SHARABLE                         0x10
336
#define   EFI_ACPI_IRQ_SHARABLE     0x10
336
337
337
#define EFI_ACPI_IRQ_POLARITY_MASK                      0x08
338
#define EFI_ACPI_IRQ_POLARITY_MASK  0x08
338
#define   EFI_ACPI_IRQ_HIGH_TRUE                        0x00
339
#define   EFI_ACPI_IRQ_HIGH_TRUE    0x00
339
#define   EFI_ACPI_IRQ_LOW_FALSE                        0x08
340
#define   EFI_ACPI_IRQ_LOW_FALSE    0x08
340
341
341
#define EFI_ACPI_IRQ_MODE                               0x01
342
#define EFI_ACPI_IRQ_MODE               0x01
342
#define   EFI_ACPI_IRQ_LEVEL_TRIGGERED                  0x00
343
#define   EFI_ACPI_IRQ_LEVEL_TRIGGERED  0x00
343
#define   EFI_ACPI_IRQ_EDGE_TRIGGERED                   0x01
344
#define   EFI_ACPI_IRQ_EDGE_TRIGGERED   0x01
344
345
345
//
346
//
346
// DMA Information
347
// DMA Information
347
// Ref ACPI specification 6.4.2.2
348
// Ref ACPI specification 6.4.2.2
348
//
349
//
349
#define EFI_ACPI_DMA_SPEED_TYPE_MASK                    0x60
350
#define EFI_ACPI_DMA_SPEED_TYPE_MASK             0x60
350
#define   EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY         0x00
351
#define   EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY  0x00
351
#define   EFI_ACPI_DMA_SPEED_TYPE_A                     0x20
352
#define   EFI_ACPI_DMA_SPEED_TYPE_A              0x20
352
#define   EFI_ACPI_DMA_SPEED_TYPE_B                     0x40
353
#define   EFI_ACPI_DMA_SPEED_TYPE_B              0x40
353
#define   EFI_ACPI_DMA_SPEED_TYPE_F                     0x60
354
#define   EFI_ACPI_DMA_SPEED_TYPE_F              0x60
354
355
355
#define EFI_ACPI_DMA_BUS_MASTER_MASK                    0x04
356
#define EFI_ACPI_DMA_BUS_MASTER_MASK  0x04
356
#define   EFI_ACPI_DMA_BUS_MASTER                       0x04
357
#define   EFI_ACPI_DMA_BUS_MASTER     0x04
357
358
358
#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK                 0x03
359
#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK                0x03
359
#define   EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT              0x00
360
#define   EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT             0x00
360
#define   EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT   0x01
361
#define   EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT  0x01
361
#define   EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT             0x10
362
#define   EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT            0x02
362
363
363
//
364
//
364
// IO Information
365
// IO Information
365
// Ref ACPI specification 6.4.2.5
366
// Ref ACPI specification 6.4.2.5
366
//
367
//
367
#define EFI_ACPI_IO_DECODE_MASK                         0x01
368
#define EFI_ACPI_IO_DECODE_MASK      0x01
368
#define   EFI_ACPI_IO_DECODE_16_BIT                     0x01
369
#define   EFI_ACPI_IO_DECODE_16_BIT  0x01
369
#define   EFI_ACPI_IO_DECODE_10_BIT                     0x00
370
#define   EFI_ACPI_IO_DECODE_10_BIT  0x00
370
371
371
//
372
//
372
// Memory Information
373
// Memory Information
373
// Ref ACPI specification 6.4.3.4
374
// Ref ACPI specification 6.4.3.4
374
//
375
//
375
#define EFI_ACPI_MEMORY_WRITE_STATUS_MASK               0x01
376
#define EFI_ACPI_MEMORY_WRITE_STATUS_MASK  0x01
376
#define   EFI_ACPI_MEMORY_WRITABLE                      0x01
377
#define   EFI_ACPI_MEMORY_WRITABLE         0x01
377
#define   EFI_ACPI_MEMORY_NON_WRITABLE                  0x00
378
#define   EFI_ACPI_MEMORY_NON_WRITABLE     0x00
379
380
//
381
// Interrupt Vector Flags definitions for Extended Interrupt Descriptor
382
// Ref ACPI specification 6.4.3.6
383
//
384
#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK  BIT0
385
#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_MODE_MASK               BIT1
386
#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_POLARITY_MASK           BIT2
387
#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK           BIT3
388
#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLITY_MASK     BIT4
378
389
379
//
390
//
380
// Ensure proper structure formats
391
// Ensure proper structure formats
Lines 388-398 typedef struct { Link Here
388
/// Root System Description Pointer Structure.
399
/// Root System Description Pointer Structure.
389
///
400
///
390
typedef struct {
401
typedef struct {
391
  UINT64  Signature;
402
  UINT64    Signature;
392
  UINT8   Checksum;
403
  UINT8     Checksum;
393
  UINT8   OemId[6];
404
  UINT8     OemId[6];
394
  UINT8   Reserved;
405
  UINT8     Reserved;
395
  UINT32  RsdtAddress;
406
  UINT32    RsdtAddress;
396
} EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
407
} EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
397
408
398
//
409
//
Lines 404-455 typedef struct { Link Here
404
///
415
///
405
/// RSDT Revision (as defined in ACPI 1.0b specification).
416
/// RSDT Revision (as defined in ACPI 1.0b specification).
406
///
417
///
407
#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
418
#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
408
419
409
///
420
///
410
/// Fixed ACPI Description Table Structure (FADT).
421
/// Fixed ACPI Description Table Structure (FADT).
411
///
422
///
412
typedef struct {
423
typedef struct {
413
  EFI_ACPI_DESCRIPTION_HEADER Header;
424
  EFI_ACPI_DESCRIPTION_HEADER    Header;
414
  UINT32                      FirmwareCtrl;
425
  UINT32                         FirmwareCtrl;
415
  UINT32                      Dsdt;
426
  UINT32                         Dsdt;
416
  UINT8                       IntModel;
427
  UINT8                          IntModel;
417
  UINT8                       Reserved1;
428
  UINT8                          Reserved1;
418
  UINT16                      SciInt;
429
  UINT16                         SciInt;
419
  UINT32                      SmiCmd;
430
  UINT32                         SmiCmd;
420
  UINT8                       AcpiEnable;
431
  UINT8                          AcpiEnable;
421
  UINT8                       AcpiDisable;
432
  UINT8                          AcpiDisable;
422
  UINT8                       S4BiosReq;
433
  UINT8                          S4BiosReq;
423
  UINT8                       Reserved2;
434
  UINT8                          Reserved2;
424
  UINT32                      Pm1aEvtBlk;
435
  UINT32                         Pm1aEvtBlk;
425
  UINT32                      Pm1bEvtBlk;
436
  UINT32                         Pm1bEvtBlk;
426
  UINT32                      Pm1aCntBlk;
437
  UINT32                         Pm1aCntBlk;
427
  UINT32                      Pm1bCntBlk;
438
  UINT32                         Pm1bCntBlk;
428
  UINT32                      Pm2CntBlk;
439
  UINT32                         Pm2CntBlk;
429
  UINT32                      PmTmrBlk;
440
  UINT32                         PmTmrBlk;
430
  UINT32                      Gpe0Blk;
441
  UINT32                         Gpe0Blk;
431
  UINT32                      Gpe1Blk;
442
  UINT32                         Gpe1Blk;
432
  UINT8                       Pm1EvtLen;
443
  UINT8                          Pm1EvtLen;
433
  UINT8                       Pm1CntLen;
444
  UINT8                          Pm1CntLen;
434
  UINT8                       Pm2CntLen;
445
  UINT8                          Pm2CntLen;
435
  UINT8                       PmTmLen;
446
  UINT8                          PmTmLen;
436
  UINT8                       Gpe0BlkLen;
447
  UINT8                          Gpe0BlkLen;
437
  UINT8                       Gpe1BlkLen;
448
  UINT8                          Gpe1BlkLen;
438
  UINT8                       Gpe1Base;
449
  UINT8                          Gpe1Base;
439
  UINT8                       Reserved3;
450
  UINT8                          Reserved3;
440
  UINT16                      PLvl2Lat;
451
  UINT16                         PLvl2Lat;
441
  UINT16                      PLvl3Lat;
452
  UINT16                         PLvl3Lat;
442
  UINT16                      FlushSize;
453
  UINT16                         FlushSize;
443
  UINT16                      FlushStride;
454
  UINT16                         FlushStride;
444
  UINT8                       DutyOffset;
455
  UINT8                          DutyOffset;
445
  UINT8                       DutyWidth;
456
  UINT8                          DutyWidth;
446
  UINT8                       DayAlrm;
457
  UINT8                          DayAlrm;
447
  UINT8                       MonAlrm;
458
  UINT8                          MonAlrm;
448
  UINT8                       Century;
459
  UINT8                          Century;
449
  UINT8                       Reserved4;
460
  UINT8                          Reserved4;
450
  UINT8                       Reserved5;
461
  UINT8                          Reserved5;
451
  UINT8                       Reserved6;
462
  UINT8                          Reserved6;
452
  UINT32                      Flags;
463
  UINT32                         Flags;
453
} EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
464
} EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
454
465
455
///
466
///
Lines 457-519 typedef struct { Link Here
457
///
468
///
458
#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x01
469
#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x01
459
470
460
#define EFI_ACPI_1_0_INT_MODE_DUAL_PIC         0
471
#define EFI_ACPI_1_0_INT_MODE_DUAL_PIC       0
461
#define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC    1
472
#define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC  1
462
473
463
//
474
//
464
// Fixed ACPI Description Table Fixed Feature Flags
475
// Fixed ACPI Description Table Fixed Feature Flags
465
// All other bits are reserved and must be set to 0.
476
// All other bits are reserved and must be set to 0.
466
//
477
//
467
#define EFI_ACPI_1_0_WBINVD               BIT0
478
#define EFI_ACPI_1_0_WBINVD        BIT0
468
#define EFI_ACPI_1_0_WBINVD_FLUSH         BIT1
479
#define EFI_ACPI_1_0_WBINVD_FLUSH  BIT1
469
#define EFI_ACPI_1_0_PROC_C1              BIT2
480
#define EFI_ACPI_1_0_PROC_C1       BIT2
470
#define EFI_ACPI_1_0_P_LVL2_UP            BIT3
481
#define EFI_ACPI_1_0_P_LVL2_UP     BIT3
471
#define EFI_ACPI_1_0_PWR_BUTTON           BIT4
482
#define EFI_ACPI_1_0_PWR_BUTTON    BIT4
472
#define EFI_ACPI_1_0_SLP_BUTTON           BIT5
483
#define EFI_ACPI_1_0_SLP_BUTTON    BIT5
473
#define EFI_ACPI_1_0_FIX_RTC              BIT6
484
#define EFI_ACPI_1_0_FIX_RTC       BIT6
474
#define EFI_ACPI_1_0_RTC_S4               BIT7
485
#define EFI_ACPI_1_0_RTC_S4        BIT7
475
#define EFI_ACPI_1_0_TMR_VAL_EXT          BIT8
486
#define EFI_ACPI_1_0_TMR_VAL_EXT   BIT8
476
#define EFI_ACPI_1_0_DCK_CAP              BIT9
487
#define EFI_ACPI_1_0_DCK_CAP       BIT9
477
488
478
///
489
///
479
/// Firmware ACPI Control Structure.
490
/// Firmware ACPI Control Structure.
480
///
491
///
481
typedef struct {
492
typedef struct {
482
  UINT32  Signature;
493
  UINT32    Signature;
483
  UINT32  Length;
494
  UINT32    Length;
484
  UINT32  HardwareSignature;
495
  UINT32    HardwareSignature;
485
  UINT32  FirmwareWakingVector;
496
  UINT32    FirmwareWakingVector;
486
  UINT32  GlobalLock;
497
  UINT32    GlobalLock;
487
  UINT32  Flags;
498
  UINT32    Flags;
488
  UINT8   Reserved[40];
499
  UINT8     Reserved[40];
489
} EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
500
} EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
490
501
491
///
502
///
492
/// Firmware Control Structure Feature Flags.
503
/// Firmware Control Structure Feature Flags.
493
/// All other bits are reserved and must be set to 0.
504
/// All other bits are reserved and must be set to 0.
494
///
505
///
495
#define EFI_ACPI_1_0_S4BIOS_F             BIT0
506
#define EFI_ACPI_1_0_S4BIOS_F  BIT0
496
507
497
///
508
///
498
/// Multiple APIC Description Table header definition.  The rest of the table
509
/// Multiple APIC Description Table header definition.  The rest of the table
499
/// must be defined in a platform-specific manner.
510
/// must be defined in a platform-specific manner.
500
///
511
///
501
typedef struct {
512
typedef struct {
502
  EFI_ACPI_DESCRIPTION_HEADER Header;
513
  EFI_ACPI_DESCRIPTION_HEADER    Header;
503
  UINT32                      LocalApicAddress;
514
  UINT32                         LocalApicAddress;
504
  UINT32                      Flags;
515
  UINT32                         Flags;
505
} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
516
} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
506
517
507
///
518
///
508
/// MADT Revision (as defined in ACPI 1.0b specification).
519
/// MADT Revision (as defined in ACPI 1.0b specification).
509
///
520
///
510
#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
521
#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x01
511
522
512
///
523
///
513
/// Multiple APIC Flags
524
/// Multiple APIC Flags
514
/// All other bits are reserved and must be set to 0.
525
/// All other bits are reserved and must be set to 0.
515
///
526
///
516
#define EFI_ACPI_1_0_PCAT_COMPAT           BIT0
527
#define EFI_ACPI_1_0_PCAT_COMPAT  BIT0
517
528
518
//
529
//
519
// Multiple APIC Description Table APIC structure types
530
// Multiple APIC Description Table APIC structure types
Lines 534-604 typedef struct { Link Here
534
/// Processor Local APIC Structure Definition.
545
/// Processor Local APIC Structure Definition.
535
///
546
///
536
typedef struct {
547
typedef struct {
537
  UINT8   Type;
548
  UINT8     Type;
538
  UINT8   Length;
549
  UINT8     Length;
539
  UINT8   AcpiProcessorId;
550
  UINT8     AcpiProcessorId;
540
  UINT8   ApicId;
551
  UINT8     ApicId;
541
  UINT32  Flags;
552
  UINT32    Flags;
542
} EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
553
} EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
543
554
544
///
555
///
545
/// Local APIC Flags.  All other bits are reserved and must be 0.
556
/// Local APIC Flags.  All other bits are reserved and must be 0.
546
///
557
///
547
#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED      BIT0
558
#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED  BIT0
548
559
549
///
560
///
550
/// IO APIC Structure.
561
/// IO APIC Structure.
551
///
562
///
552
typedef struct {
563
typedef struct {
553
  UINT8   Type;
564
  UINT8     Type;
554
  UINT8   Length;
565
  UINT8     Length;
555
  UINT8   IoApicId;
566
  UINT8     IoApicId;
556
  UINT8   Reserved;
567
  UINT8     Reserved;
557
  UINT32  IoApicAddress;
568
  UINT32    IoApicAddress;
558
  UINT32  SystemVectorBase;
569
  UINT32    SystemVectorBase;
559
} EFI_ACPI_1_0_IO_APIC_STRUCTURE;
570
} EFI_ACPI_1_0_IO_APIC_STRUCTURE;
560
571
561
///
572
///
562
/// Interrupt Source Override Structure.
573
/// Interrupt Source Override Structure.
563
///
574
///
564
typedef struct {
575
typedef struct {
565
  UINT8   Type;
576
  UINT8     Type;
566
  UINT8   Length;
577
  UINT8     Length;
567
  UINT8   Bus;
578
  UINT8     Bus;
568
  UINT8   Source;
579
  UINT8     Source;
569
  UINT32  GlobalSystemInterruptVector;
580
  UINT32    GlobalSystemInterruptVector;
570
  UINT16  Flags;
581
  UINT16    Flags;
571
} EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
582
} EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
572
583
573
///
584
///
574
/// Non-Maskable Interrupt Source Structure.
585
/// Non-Maskable Interrupt Source Structure.
575
///
586
///
576
typedef struct {
587
typedef struct {
577
  UINT8   Type;
588
  UINT8     Type;
578
  UINT8   Length;
589
  UINT8     Length;
579
  UINT16  Flags;
590
  UINT16    Flags;
580
  UINT32  GlobalSystemInterruptVector;
591
  UINT32    GlobalSystemInterruptVector;
581
} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
592
} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
582
593
583
///
594
///
584
/// Local APIC NMI Structure.
595
/// Local APIC NMI Structure.
585
///
596
///
586
typedef struct {
597
typedef struct {
587
  UINT8   Type;
598
  UINT8     Type;
588
  UINT8   Length;
599
  UINT8     Length;
589
  UINT8   AcpiProcessorId;
600
  UINT8     AcpiProcessorId;
590
  UINT16  Flags;
601
  UINT16    Flags;
591
  UINT8   LocalApicInti;
602
  UINT8     LocalApicInti;
592
} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
603
} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
593
604
594
///
605
///
595
/// Smart Battery Description Table (SBST)
606
/// Smart Battery Description Table (SBST)
596
///
607
///
597
typedef struct {
608
typedef struct {
598
  EFI_ACPI_DESCRIPTION_HEADER Header;
609
  EFI_ACPI_DESCRIPTION_HEADER    Header;
599
  UINT32                      WarningEnergyLevel;
610
  UINT32                         WarningEnergyLevel;
600
  UINT32                      LowEnergyLevel;
611
  UINT32                         LowEnergyLevel;
601
  UINT32                      CriticalEnergyLevel;
612
  UINT32                         CriticalEnergyLevel;
602
} EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
613
} EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
603
614
604
//
615
//
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi20.h (-174 / +174 lines)
Lines 13-21 Link Here
13
//
13
//
14
// Define for Descriptor
14
// Define for Descriptor
15
//
15
//
16
#define ACPI_LARGE_GENERIC_REGISTER_DESCRIPTOR_NAME          0x02
16
#define ACPI_LARGE_GENERIC_REGISTER_DESCRIPTOR_NAME  0x02
17
17
18
#define ACPI_GENERIC_REGISTER_DESCRIPTOR          0x82
18
#define ACPI_GENERIC_REGISTER_DESCRIPTOR  0x82
19
19
20
//
20
//
21
// Ensure proper structure formats
21
// Ensure proper structure formats
Lines 45-55 typedef PACKED struct { Link Here
45
/// ACPI 2.0 Generic Address Space definition
45
/// ACPI 2.0 Generic Address Space definition
46
///
46
///
47
typedef struct {
47
typedef struct {
48
  UINT8   AddressSpaceId;
48
  UINT8     AddressSpaceId;
49
  UINT8   RegisterBitWidth;
49
  UINT8     RegisterBitWidth;
50
  UINT8   RegisterBitOffset;
50
  UINT8     RegisterBitOffset;
51
  UINT8   Reserved;
51
  UINT8     Reserved;
52
  UINT64  Address;
52
  UINT64    Address;
53
} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
53
} EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
54
54
55
//
55
//
Lines 70-98 typedef struct { Link Here
70
/// Root System Description Pointer Structure
70
/// Root System Description Pointer Structure
71
///
71
///
72
typedef struct {
72
typedef struct {
73
  UINT64  Signature;
73
  UINT64    Signature;
74
  UINT8   Checksum;
74
  UINT8     Checksum;
75
  UINT8   OemId[6];
75
  UINT8     OemId[6];
76
  UINT8   Revision;
76
  UINT8     Revision;
77
  UINT32  RsdtAddress;
77
  UINT32    RsdtAddress;
78
  UINT32  Length;
78
  UINT32    Length;
79
  UINT64  XsdtAddress;
79
  UINT64    XsdtAddress;
80
  UINT8   ExtendedChecksum;
80
  UINT8     ExtendedChecksum;
81
  UINT8   Reserved[3];
81
  UINT8     Reserved[3];
82
} EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
82
} EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
83
83
84
///
84
///
85
/// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
85
/// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
86
///
86
///
87
#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
87
#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02
88
88
89
///
89
///
90
/// Common table header, this prefaces all ACPI tables, including FACS, but
90
/// Common table header, this prefaces all ACPI tables, including FACS, but
91
/// excluding the RSD PTR structure
91
/// excluding the RSD PTR structure
92
///
92
///
93
typedef struct {
93
typedef struct {
94
  UINT32  Signature;
94
  UINT32    Signature;
95
  UINT32  Length;
95
  UINT32    Length;
96
} EFI_ACPI_2_0_COMMON_HEADER;
96
} EFI_ACPI_2_0_COMMON_HEADER;
97
97
98
//
98
//
Lines 104-110 typedef struct { Link Here
104
///
104
///
105
/// RSDT Revision (as defined in ACPI 2.0 spec.)
105
/// RSDT Revision (as defined in ACPI 2.0 spec.)
106
///
106
///
107
#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
107
#define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
108
108
109
//
109
//
110
// Extended System Description Table
110
// Extended System Description Table
Lines 115-178 typedef struct { Link Here
115
///
115
///
116
/// XSDT Revision (as defined in ACPI 2.0 spec.)
116
/// XSDT Revision (as defined in ACPI 2.0 spec.)
117
///
117
///
118
#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
118
#define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
119
119
120
///
120
///
121
/// Fixed ACPI Description Table Structure (FADT)
121
/// Fixed ACPI Description Table Structure (FADT)
122
///
122
///
123
typedef struct {
123
typedef struct {
124
  EFI_ACPI_DESCRIPTION_HEADER             Header;
124
  EFI_ACPI_DESCRIPTION_HEADER               Header;
125
  UINT32                                  FirmwareCtrl;
125
  UINT32                                    FirmwareCtrl;
126
  UINT32                                  Dsdt;
126
  UINT32                                    Dsdt;
127
  UINT8                                   Reserved0;
127
  UINT8                                     Reserved0;
128
  UINT8                                   PreferredPmProfile;
128
  UINT8                                     PreferredPmProfile;
129
  UINT16                                  SciInt;
129
  UINT16                                    SciInt;
130
  UINT32                                  SmiCmd;
130
  UINT32                                    SmiCmd;
131
  UINT8                                   AcpiEnable;
131
  UINT8                                     AcpiEnable;
132
  UINT8                                   AcpiDisable;
132
  UINT8                                     AcpiDisable;
133
  UINT8                                   S4BiosReq;
133
  UINT8                                     S4BiosReq;
134
  UINT8                                   PstateCnt;
134
  UINT8                                     PstateCnt;
135
  UINT32                                  Pm1aEvtBlk;
135
  UINT32                                    Pm1aEvtBlk;
136
  UINT32                                  Pm1bEvtBlk;
136
  UINT32                                    Pm1bEvtBlk;
137
  UINT32                                  Pm1aCntBlk;
137
  UINT32                                    Pm1aCntBlk;
138
  UINT32                                  Pm1bCntBlk;
138
  UINT32                                    Pm1bCntBlk;
139
  UINT32                                  Pm2CntBlk;
139
  UINT32                                    Pm2CntBlk;
140
  UINT32                                  PmTmrBlk;
140
  UINT32                                    PmTmrBlk;
141
  UINT32                                  Gpe0Blk;
141
  UINT32                                    Gpe0Blk;
142
  UINT32                                  Gpe1Blk;
142
  UINT32                                    Gpe1Blk;
143
  UINT8                                   Pm1EvtLen;
143
  UINT8                                     Pm1EvtLen;
144
  UINT8                                   Pm1CntLen;
144
  UINT8                                     Pm1CntLen;
145
  UINT8                                   Pm2CntLen;
145
  UINT8                                     Pm2CntLen;
146
  UINT8                                   PmTmrLen;
146
  UINT8                                     PmTmrLen;
147
  UINT8                                   Gpe0BlkLen;
147
  UINT8                                     Gpe0BlkLen;
148
  UINT8                                   Gpe1BlkLen;
148
  UINT8                                     Gpe1BlkLen;
149
  UINT8                                   Gpe1Base;
149
  UINT8                                     Gpe1Base;
150
  UINT8                                   CstCnt;
150
  UINT8                                     CstCnt;
151
  UINT16                                  PLvl2Lat;
151
  UINT16                                    PLvl2Lat;
152
  UINT16                                  PLvl3Lat;
152
  UINT16                                    PLvl3Lat;
153
  UINT16                                  FlushSize;
153
  UINT16                                    FlushSize;
154
  UINT16                                  FlushStride;
154
  UINT16                                    FlushStride;
155
  UINT8                                   DutyOffset;
155
  UINT8                                     DutyOffset;
156
  UINT8                                   DutyWidth;
156
  UINT8                                     DutyWidth;
157
  UINT8                                   DayAlrm;
157
  UINT8                                     DayAlrm;
158
  UINT8                                   MonAlrm;
158
  UINT8                                     MonAlrm;
159
  UINT8                                   Century;
159
  UINT8                                     Century;
160
  UINT16                                  IaPcBootArch;
160
  UINT16                                    IaPcBootArch;
161
  UINT8                                   Reserved1;
161
  UINT8                                     Reserved1;
162
  UINT32                                  Flags;
162
  UINT32                                    Flags;
163
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
163
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    ResetReg;
164
  UINT8                                   ResetValue;
164
  UINT8                                     ResetValue;
165
  UINT8                                   Reserved2[3];
165
  UINT8                                     Reserved2[3];
166
  UINT64                                  XFirmwareCtrl;
166
  UINT64                                    XFirmwareCtrl;
167
  UINT64                                  XDsdt;
167
  UINT64                                    XDsdt;
168
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
168
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
169
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
169
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
170
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
170
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
171
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
171
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
172
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
172
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
173
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
173
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
174
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
174
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
175
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
175
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
176
} EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
176
} EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
177
177
178
///
178
///
Lines 183-235 typedef struct { Link Here
183
//
183
//
184
// Fixed ACPI Description Table Preferred Power Management Profile
184
// Fixed ACPI Description Table Preferred Power Management Profile
185
//
185
//
186
#define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED         0
186
#define EFI_ACPI_2_0_PM_PROFILE_UNSPECIFIED        0
187
#define EFI_ACPI_2_0_PM_PROFILE_DESKTOP             1
187
#define EFI_ACPI_2_0_PM_PROFILE_DESKTOP            1
188
#define EFI_ACPI_2_0_PM_PROFILE_MOBILE              2
188
#define EFI_ACPI_2_0_PM_PROFILE_MOBILE             2
189
#define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION         3
189
#define EFI_ACPI_2_0_PM_PROFILE_WORKSTATION        3
190
#define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER   4
190
#define EFI_ACPI_2_0_PM_PROFILE_ENTERPRISE_SERVER  4
191
#define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER         5
191
#define EFI_ACPI_2_0_PM_PROFILE_SOHO_SERVER        5
192
#define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC        6
192
#define EFI_ACPI_2_0_PM_PROFILE_APPLIANCE_PC       6
193
193
194
//
194
//
195
// Fixed ACPI Description Table Boot Architecture Flags
195
// Fixed ACPI Description Table Boot Architecture Flags
196
// All other bits are reserved and must be set to 0.
196
// All other bits are reserved and must be set to 0.
197
//
197
//
198
#define EFI_ACPI_2_0_LEGACY_DEVICES          BIT0
198
#define EFI_ACPI_2_0_LEGACY_DEVICES  BIT0
199
#define EFI_ACPI_2_0_8042                    BIT1
199
#define EFI_ACPI_2_0_8042            BIT1
200
200
201
//
201
//
202
// Fixed ACPI Description Table Fixed Feature Flags
202
// Fixed ACPI Description Table Fixed Feature Flags
203
// All other bits are reserved and must be set to 0.
203
// All other bits are reserved and must be set to 0.
204
//
204
//
205
#define EFI_ACPI_2_0_WBINVD                  BIT0
205
#define EFI_ACPI_2_0_WBINVD         BIT0
206
#define EFI_ACPI_2_0_WBINVD_FLUSH            BIT1
206
#define EFI_ACPI_2_0_WBINVD_FLUSH   BIT1
207
#define EFI_ACPI_2_0_PROC_C1                 BIT2
207
#define EFI_ACPI_2_0_PROC_C1        BIT2
208
#define EFI_ACPI_2_0_P_LVL2_UP               BIT3
208
#define EFI_ACPI_2_0_P_LVL2_UP      BIT3
209
#define EFI_ACPI_2_0_PWR_BUTTON              BIT4
209
#define EFI_ACPI_2_0_PWR_BUTTON     BIT4
210
#define EFI_ACPI_2_0_SLP_BUTTON              BIT5
210
#define EFI_ACPI_2_0_SLP_BUTTON     BIT5
211
#define EFI_ACPI_2_0_FIX_RTC                 BIT6
211
#define EFI_ACPI_2_0_FIX_RTC        BIT6
212
#define EFI_ACPI_2_0_RTC_S4                  BIT7
212
#define EFI_ACPI_2_0_RTC_S4         BIT7
213
#define EFI_ACPI_2_0_TMR_VAL_EXT             BIT8
213
#define EFI_ACPI_2_0_TMR_VAL_EXT    BIT8
214
#define EFI_ACPI_2_0_DCK_CAP                 BIT9
214
#define EFI_ACPI_2_0_DCK_CAP        BIT9
215
#define EFI_ACPI_2_0_RESET_REG_SUP           BIT10
215
#define EFI_ACPI_2_0_RESET_REG_SUP  BIT10
216
#define EFI_ACPI_2_0_SEALED_CASE             BIT11
216
#define EFI_ACPI_2_0_SEALED_CASE    BIT11
217
#define EFI_ACPI_2_0_HEADLESS                BIT12
217
#define EFI_ACPI_2_0_HEADLESS       BIT12
218
#define EFI_ACPI_2_0_CPU_SW_SLP              BIT13
218
#define EFI_ACPI_2_0_CPU_SW_SLP     BIT13
219
219
220
///
220
///
221
/// Firmware ACPI Control Structure
221
/// Firmware ACPI Control Structure
222
///
222
///
223
typedef struct {
223
typedef struct {
224
  UINT32  Signature;
224
  UINT32    Signature;
225
  UINT32  Length;
225
  UINT32    Length;
226
  UINT32  HardwareSignature;
226
  UINT32    HardwareSignature;
227
  UINT32  FirmwareWakingVector;
227
  UINT32    FirmwareWakingVector;
228
  UINT32  GlobalLock;
228
  UINT32    GlobalLock;
229
  UINT32  Flags;
229
  UINT32    Flags;
230
  UINT64  XFirmwareWakingVector;
230
  UINT64    XFirmwareWakingVector;
231
  UINT8   Version;
231
  UINT8     Version;
232
  UINT8   Reserved[31];
232
  UINT8     Reserved[31];
233
} EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
233
} EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
234
234
235
///
235
///
Lines 241-268 typedef struct { Link Here
241
/// Firmware Control Structure Feature Flags
241
/// Firmware Control Structure Feature Flags
242
/// All other bits are reserved and must be set to 0.
242
/// All other bits are reserved and must be set to 0.
243
///
243
///
244
#define EFI_ACPI_2_0_S4BIOS_F        BIT0
244
#define EFI_ACPI_2_0_S4BIOS_F  BIT0
245
245
246
///
246
///
247
/// Multiple APIC Description Table header definition.  The rest of the table
247
/// Multiple APIC Description Table header definition.  The rest of the table
248
/// must be defined in a platform specific manner.
248
/// must be defined in a platform specific manner.
249
///
249
///
250
typedef struct {
250
typedef struct {
251
  EFI_ACPI_DESCRIPTION_HEADER Header;
251
  EFI_ACPI_DESCRIPTION_HEADER    Header;
252
  UINT32                      LocalApicAddress;
252
  UINT32                         LocalApicAddress;
253
  UINT32                      Flags;
253
  UINT32                         Flags;
254
} EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
254
} EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
255
255
256
///
256
///
257
/// MADT Revision (as defined in ACPI 2.0 spec.)
257
/// MADT Revision (as defined in ACPI 2.0 spec.)
258
///
258
///
259
#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
259
#define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x01
260
260
261
///
261
///
262
/// Multiple APIC Flags
262
/// Multiple APIC Flags
263
/// All other bits are reserved and must be set to 0.
263
/// All other bits are reserved and must be set to 0.
264
///
264
///
265
#define EFI_ACPI_2_0_PCAT_COMPAT          BIT0
265
#define EFI_ACPI_2_0_PCAT_COMPAT  BIT0
266
266
267
//
267
//
268
// Multiple APIC Description Table APIC structure types
268
// Multiple APIC Description Table APIC structure types
Lines 287-413 typedef struct { Link Here
287
/// Processor Local APIC Structure Definition
287
/// Processor Local APIC Structure Definition
288
///
288
///
289
typedef struct {
289
typedef struct {
290
  UINT8   Type;
290
  UINT8     Type;
291
  UINT8   Length;
291
  UINT8     Length;
292
  UINT8   AcpiProcessorId;
292
  UINT8     AcpiProcessorId;
293
  UINT8   ApicId;
293
  UINT8     ApicId;
294
  UINT32  Flags;
294
  UINT32    Flags;
295
} EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
295
} EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
296
296
297
///
297
///
298
/// Local APIC Flags.  All other bits are reserved and must be 0.
298
/// Local APIC Flags.  All other bits are reserved and must be 0.
299
///
299
///
300
#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED         BIT0
300
#define EFI_ACPI_2_0_LOCAL_APIC_ENABLED  BIT0
301
301
302
///
302
///
303
/// IO APIC Structure
303
/// IO APIC Structure
304
///
304
///
305
typedef struct {
305
typedef struct {
306
  UINT8   Type;
306
  UINT8     Type;
307
  UINT8   Length;
307
  UINT8     Length;
308
  UINT8   IoApicId;
308
  UINT8     IoApicId;
309
  UINT8   Reserved;
309
  UINT8     Reserved;
310
  UINT32  IoApicAddress;
310
  UINT32    IoApicAddress;
311
  UINT32  GlobalSystemInterruptBase;
311
  UINT32    GlobalSystemInterruptBase;
312
} EFI_ACPI_2_0_IO_APIC_STRUCTURE;
312
} EFI_ACPI_2_0_IO_APIC_STRUCTURE;
313
313
314
///
314
///
315
/// Interrupt Source Override Structure
315
/// Interrupt Source Override Structure
316
///
316
///
317
typedef struct {
317
typedef struct {
318
  UINT8   Type;
318
  UINT8     Type;
319
  UINT8   Length;
319
  UINT8     Length;
320
  UINT8   Bus;
320
  UINT8     Bus;
321
  UINT8   Source;
321
  UINT8     Source;
322
  UINT32  GlobalSystemInterrupt;
322
  UINT32    GlobalSystemInterrupt;
323
  UINT16  Flags;
323
  UINT16    Flags;
324
} EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
324
} EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
325
325
326
///
326
///
327
/// Non-Maskable Interrupt Source Structure
327
/// Non-Maskable Interrupt Source Structure
328
///
328
///
329
typedef struct {
329
typedef struct {
330
  UINT8   Type;
330
  UINT8     Type;
331
  UINT8   Length;
331
  UINT8     Length;
332
  UINT16  Flags;
332
  UINT16    Flags;
333
  UINT32  GlobalSystemInterrupt;
333
  UINT32    GlobalSystemInterrupt;
334
} EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
334
} EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
335
335
336
///
336
///
337
/// Local APIC NMI Structure
337
/// Local APIC NMI Structure
338
///
338
///
339
typedef struct {
339
typedef struct {
340
  UINT8   Type;
340
  UINT8     Type;
341
  UINT8   Length;
341
  UINT8     Length;
342
  UINT8   AcpiProcessorId;
342
  UINT8     AcpiProcessorId;
343
  UINT16  Flags;
343
  UINT16    Flags;
344
  UINT8   LocalApicLint;
344
  UINT8     LocalApicLint;
345
} EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
345
} EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
346
346
347
///
347
///
348
/// Local APIC Address Override Structure
348
/// Local APIC Address Override Structure
349
///
349
///
350
typedef struct {
350
typedef struct {
351
  UINT8   Type;
351
  UINT8     Type;
352
  UINT8   Length;
352
  UINT8     Length;
353
  UINT16  Reserved;
353
  UINT16    Reserved;
354
  UINT64  LocalApicAddress;
354
  UINT64    LocalApicAddress;
355
} EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
355
} EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
356
356
357
///
357
///
358
/// IO SAPIC Structure
358
/// IO SAPIC Structure
359
///
359
///
360
typedef struct {
360
typedef struct {
361
  UINT8   Type;
361
  UINT8     Type;
362
  UINT8   Length;
362
  UINT8     Length;
363
  UINT8   IoApicId;
363
  UINT8     IoApicId;
364
  UINT8   Reserved;
364
  UINT8     Reserved;
365
  UINT32  GlobalSystemInterruptBase;
365
  UINT32    GlobalSystemInterruptBase;
366
  UINT64  IoSapicAddress;
366
  UINT64    IoSapicAddress;
367
} EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
367
} EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
368
368
369
///
369
///
370
/// Local SAPIC Structure
370
/// Local SAPIC Structure
371
///
371
///
372
typedef struct {
372
typedef struct {
373
  UINT8   Type;
373
  UINT8     Type;
374
  UINT8   Length;
374
  UINT8     Length;
375
  UINT8   AcpiProcessorId;
375
  UINT8     AcpiProcessorId;
376
  UINT8   LocalSapicId;
376
  UINT8     LocalSapicId;
377
  UINT8   LocalSapicEid;
377
  UINT8     LocalSapicEid;
378
  UINT8   Reserved[3];
378
  UINT8     Reserved[3];
379
  UINT32  Flags;
379
  UINT32    Flags;
380
} EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
380
} EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
381
381
382
///
382
///
383
/// Platform Interrupt Sources Structure
383
/// Platform Interrupt Sources Structure
384
///
384
///
385
typedef struct {
385
typedef struct {
386
  UINT8   Type;
386
  UINT8     Type;
387
  UINT8   Length;
387
  UINT8     Length;
388
  UINT16  Flags;
388
  UINT16    Flags;
389
  UINT8   InterruptType;
389
  UINT8     InterruptType;
390
  UINT8   ProcessorId;
390
  UINT8     ProcessorId;
391
  UINT8   ProcessorEid;
391
  UINT8     ProcessorEid;
392
  UINT8   IoSapicVector;
392
  UINT8     IoSapicVector;
393
  UINT32  GlobalSystemInterrupt;
393
  UINT32    GlobalSystemInterrupt;
394
  UINT32  Reserved;
394
  UINT32    Reserved;
395
} EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
395
} EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
396
396
397
///
397
///
398
/// Smart Battery Description Table (SBST)
398
/// Smart Battery Description Table (SBST)
399
///
399
///
400
typedef struct {
400
typedef struct {
401
  EFI_ACPI_DESCRIPTION_HEADER Header;
401
  EFI_ACPI_DESCRIPTION_HEADER    Header;
402
  UINT32                      WarningEnergyLevel;
402
  UINT32                         WarningEnergyLevel;
403
  UINT32                      LowEnergyLevel;
403
  UINT32                         LowEnergyLevel;
404
  UINT32                      CriticalEnergyLevel;
404
  UINT32                         CriticalEnergyLevel;
405
} EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
405
} EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
406
406
407
///
407
///
408
/// SBST Version (as defined in ACPI 2.0 spec.)
408
/// SBST Version (as defined in ACPI 2.0 spec.)
409
///
409
///
410
#define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
410
#define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
411
411
412
///
412
///
413
/// Embedded Controller Boot Resources Table (ECDT)
413
/// Embedded Controller Boot Resources Table (ECDT)
Lines 415-425 typedef struct { Link Here
415
/// a fully qualified reference to the name space object.
415
/// a fully qualified reference to the name space object.
416
///
416
///
417
typedef struct {
417
typedef struct {
418
  EFI_ACPI_DESCRIPTION_HEADER             Header;
418
  EFI_ACPI_DESCRIPTION_HEADER               Header;
419
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
419
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    EcControl;
420
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE  EcData;
420
  EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE    EcData;
421
  UINT32                                  Uid;
421
  UINT32                                    Uid;
422
  UINT8                                   GpeBit;
422
  UINT8                                     GpeBit;
423
} EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
423
} EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
424
424
425
///
425
///
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi30.h (-225 / +239 lines)
Lines 13-21 Link Here
13
//
13
//
14
// Define for Descriptor
14
// Define for Descriptor
15
//
15
//
16
#define ACPI_LARGE_EXTENDED_ADDRESS_SPACE_DESCRIPTOR_NAME    0x0B
16
#define ACPI_LARGE_EXTENDED_ADDRESS_SPACE_DESCRIPTOR_NAME  0x0B
17
17
18
#define ACPI_EXTENDED_ADDRESS_SPACE_DESCRIPTOR    0x8B
18
#define ACPI_EXTENDED_ADDRESS_SPACE_DESCRIPTOR  0x8B
19
20
///
21
/// C-state Coordination Types
22
/// See s8.4.2.2 _CSD (C-State Dependency)
23
///
24
#define ACPI_AML_COORD_TYPE_SW_ALL  0xFC
25
#define ACPI_AML_COORD_TYPE_SW_ANY  0xFD
26
#define ACPI_AML_COORD_TYPE_HW_ALL  0xFE
27
28
///
29
/// _PSD Revision for ACPI 3.0
30
// See s8.4.4.5 _PSD (P-State Dependency)
31
///
32
#define EFI_ACPI_3_0_AML_PSD_REVISION  0
19
33
20
//
34
//
21
// Ensure proper structure formats
35
// Ensure proper structure formats
Lines 45-56 typedef PACKED struct { Link Here
45
//
59
//
46
// Memory Type Specific Flags
60
// Memory Type Specific Flags
47
//
61
//
48
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UC  0x0000000000000001
62
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UC   0x0000000000000001
49
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WC  0x0000000000000002
63
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WC   0x0000000000000002
50
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WT  0x0000000000000004
64
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WT   0x0000000000000004
51
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WB  0x0000000000000008
65
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_WB   0x0000000000000008
52
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UCE 0x0000000000000010
66
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_UCE  0x0000000000000010
53
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_NV  0x0000000000008000
67
#define EFI_ACPI_MEMORY_TYPE_SPECIFIC_ATTRIBUTES_NV   0x0000000000008000
54
68
55
//
69
//
56
// Ensure proper structure formats
70
// Ensure proper structure formats
Lines 61-71 typedef PACKED struct { Link Here
61
/// ACPI 3.0 Generic Address Space definition
75
/// ACPI 3.0 Generic Address Space definition
62
///
76
///
63
typedef struct {
77
typedef struct {
64
  UINT8   AddressSpaceId;
78
  UINT8     AddressSpaceId;
65
  UINT8   RegisterBitWidth;
79
  UINT8     RegisterBitWidth;
66
  UINT8   RegisterBitOffset;
80
  UINT8     RegisterBitOffset;
67
  UINT8   AccessSize;
81
  UINT8     AccessSize;
68
  UINT64  Address;
82
  UINT64    Address;
69
} EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
83
} EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE;
70
84
71
//
85
//
Lines 95-123 typedef struct { Link Here
95
/// Root System Description Pointer Structure
109
/// Root System Description Pointer Structure
96
///
110
///
97
typedef struct {
111
typedef struct {
98
  UINT64  Signature;
112
  UINT64    Signature;
99
  UINT8   Checksum;
113
  UINT8     Checksum;
100
  UINT8   OemId[6];
114
  UINT8     OemId[6];
101
  UINT8   Revision;
115
  UINT8     Revision;
102
  UINT32  RsdtAddress;
116
  UINT32    RsdtAddress;
103
  UINT32  Length;
117
  UINT32    Length;
104
  UINT64  XsdtAddress;
118
  UINT64    XsdtAddress;
105
  UINT8   ExtendedChecksum;
119
  UINT8     ExtendedChecksum;
106
  UINT8   Reserved[3];
120
  UINT8     Reserved[3];
107
} EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
121
} EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
108
122
109
///
123
///
110
/// RSD_PTR Revision (as defined in ACPI 3.0b spec.)
124
/// RSD_PTR Revision (as defined in ACPI 3.0b spec.)
111
///
125
///
112
#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 3.0b) says current value is 2
126
#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02 ///< ACPISpec (Revision 3.0b) says current value is 2
113
127
114
///
128
///
115
/// Common table header, this prefaces all ACPI tables, including FACS, but
129
/// Common table header, this prefaces all ACPI tables, including FACS, but
116
/// excluding the RSD PTR structure
130
/// excluding the RSD PTR structure
117
///
131
///
118
typedef struct {
132
typedef struct {
119
  UINT32  Signature;
133
  UINT32    Signature;
120
  UINT32  Length;
134
  UINT32    Length;
121
} EFI_ACPI_3_0_COMMON_HEADER;
135
} EFI_ACPI_3_0_COMMON_HEADER;
122
136
123
//
137
//
Lines 129-135 typedef struct { Link Here
129
///
143
///
130
/// RSDT Revision (as defined in ACPI 3.0 spec.)
144
/// RSDT Revision (as defined in ACPI 3.0 spec.)
131
///
145
///
132
#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
146
#define EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
133
147
134
//
148
//
135
// Extended System Description Table
149
// Extended System Description Table
Lines 140-203 typedef struct { Link Here
140
///
154
///
141
/// XSDT Revision (as defined in ACPI 3.0 spec.)
155
/// XSDT Revision (as defined in ACPI 3.0 spec.)
142
///
156
///
143
#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
157
#define EFI_ACPI_3_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
144
158
145
///
159
///
146
/// Fixed ACPI Description Table Structure (FADT)
160
/// Fixed ACPI Description Table Structure (FADT)
147
///
161
///
148
typedef struct {
162
typedef struct {
149
  EFI_ACPI_DESCRIPTION_HEADER             Header;
163
  EFI_ACPI_DESCRIPTION_HEADER               Header;
150
  UINT32                                  FirmwareCtrl;
164
  UINT32                                    FirmwareCtrl;
151
  UINT32                                  Dsdt;
165
  UINT32                                    Dsdt;
152
  UINT8                                   Reserved0;
166
  UINT8                                     Reserved0;
153
  UINT8                                   PreferredPmProfile;
167
  UINT8                                     PreferredPmProfile;
154
  UINT16                                  SciInt;
168
  UINT16                                    SciInt;
155
  UINT32                                  SmiCmd;
169
  UINT32                                    SmiCmd;
156
  UINT8                                   AcpiEnable;
170
  UINT8                                     AcpiEnable;
157
  UINT8                                   AcpiDisable;
171
  UINT8                                     AcpiDisable;
158
  UINT8                                   S4BiosReq;
172
  UINT8                                     S4BiosReq;
159
  UINT8                                   PstateCnt;
173
  UINT8                                     PstateCnt;
160
  UINT32                                  Pm1aEvtBlk;
174
  UINT32                                    Pm1aEvtBlk;
161
  UINT32                                  Pm1bEvtBlk;
175
  UINT32                                    Pm1bEvtBlk;
162
  UINT32                                  Pm1aCntBlk;
176
  UINT32                                    Pm1aCntBlk;
163
  UINT32                                  Pm1bCntBlk;
177
  UINT32                                    Pm1bCntBlk;
164
  UINT32                                  Pm2CntBlk;
178
  UINT32                                    Pm2CntBlk;
165
  UINT32                                  PmTmrBlk;
179
  UINT32                                    PmTmrBlk;
166
  UINT32                                  Gpe0Blk;
180
  UINT32                                    Gpe0Blk;
167
  UINT32                                  Gpe1Blk;
181
  UINT32                                    Gpe1Blk;
168
  UINT8                                   Pm1EvtLen;
182
  UINT8                                     Pm1EvtLen;
169
  UINT8                                   Pm1CntLen;
183
  UINT8                                     Pm1CntLen;
170
  UINT8                                   Pm2CntLen;
184
  UINT8                                     Pm2CntLen;
171
  UINT8                                   PmTmrLen;
185
  UINT8                                     PmTmrLen;
172
  UINT8                                   Gpe0BlkLen;
186
  UINT8                                     Gpe0BlkLen;
173
  UINT8                                   Gpe1BlkLen;
187
  UINT8                                     Gpe1BlkLen;
174
  UINT8                                   Gpe1Base;
188
  UINT8                                     Gpe1Base;
175
  UINT8                                   CstCnt;
189
  UINT8                                     CstCnt;
176
  UINT16                                  PLvl2Lat;
190
  UINT16                                    PLvl2Lat;
177
  UINT16                                  PLvl3Lat;
191
  UINT16                                    PLvl3Lat;
178
  UINT16                                  FlushSize;
192
  UINT16                                    FlushSize;
179
  UINT16                                  FlushStride;
193
  UINT16                                    FlushStride;
180
  UINT8                                   DutyOffset;
194
  UINT8                                     DutyOffset;
181
  UINT8                                   DutyWidth;
195
  UINT8                                     DutyWidth;
182
  UINT8                                   DayAlrm;
196
  UINT8                                     DayAlrm;
183
  UINT8                                   MonAlrm;
197
  UINT8                                     MonAlrm;
184
  UINT8                                   Century;
198
  UINT8                                     Century;
185
  UINT16                                  IaPcBootArch;
199
  UINT16                                    IaPcBootArch;
186
  UINT8                                   Reserved1;
200
  UINT8                                     Reserved1;
187
  UINT32                                  Flags;
201
  UINT32                                    Flags;
188
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
202
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    ResetReg;
189
  UINT8                                   ResetValue;
203
  UINT8                                     ResetValue;
190
  UINT8                                   Reserved2[3];
204
  UINT8                                     Reserved2[3];
191
  UINT64                                  XFirmwareCtrl;
205
  UINT64                                    XFirmwareCtrl;
192
  UINT64                                  XDsdt;
206
  UINT64                                    XDsdt;
193
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
207
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
194
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
208
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
195
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
209
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
196
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
210
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
197
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
211
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
198
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
212
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
199
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
213
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
200
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
214
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
201
} EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
215
} EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE;
202
216
203
///
217
///
Lines 221-270 typedef struct { Link Here
221
// Fixed ACPI Description Table Boot Architecture Flags
235
// Fixed ACPI Description Table Boot Architecture Flags
222
// All other bits are reserved and must be set to 0.
236
// All other bits are reserved and must be set to 0.
223
//
237
//
224
#define EFI_ACPI_3_0_LEGACY_DEVICES              BIT0
238
#define EFI_ACPI_3_0_LEGACY_DEVICES      BIT0
225
#define EFI_ACPI_3_0_8042                        BIT1
239
#define EFI_ACPI_3_0_8042                BIT1
226
#define EFI_ACPI_3_0_VGA_NOT_PRESENT             BIT2
240
#define EFI_ACPI_3_0_VGA_NOT_PRESENT     BIT2
227
#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED           BIT3
241
#define EFI_ACPI_3_0_MSI_NOT_SUPPORTED   BIT3
228
#define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS          BIT4
242
#define EFI_ACPI_3_0_PCIE_ASPM_CONTROLS  BIT4
229
243
230
//
244
//
231
// Fixed ACPI Description Table Fixed Feature Flags
245
// Fixed ACPI Description Table Fixed Feature Flags
232
// All other bits are reserved and must be set to 0.
246
// All other bits are reserved and must be set to 0.
233
//
247
//
234
#define EFI_ACPI_3_0_WBINVD                                 BIT0
248
#define EFI_ACPI_3_0_WBINVD                                BIT0
235
#define EFI_ACPI_3_0_WBINVD_FLUSH                           BIT1
249
#define EFI_ACPI_3_0_WBINVD_FLUSH                          BIT1
236
#define EFI_ACPI_3_0_PROC_C1                                BIT2
250
#define EFI_ACPI_3_0_PROC_C1                               BIT2
237
#define EFI_ACPI_3_0_P_LVL2_UP                              BIT3
251
#define EFI_ACPI_3_0_P_LVL2_UP                             BIT3
238
#define EFI_ACPI_3_0_PWR_BUTTON                             BIT4
252
#define EFI_ACPI_3_0_PWR_BUTTON                            BIT4
239
#define EFI_ACPI_3_0_SLP_BUTTON                             BIT5
253
#define EFI_ACPI_3_0_SLP_BUTTON                            BIT5
240
#define EFI_ACPI_3_0_FIX_RTC                                BIT6
254
#define EFI_ACPI_3_0_FIX_RTC                               BIT6
241
#define EFI_ACPI_3_0_RTC_S4                                 BIT7
255
#define EFI_ACPI_3_0_RTC_S4                                BIT7
242
#define EFI_ACPI_3_0_TMR_VAL_EXT                            BIT8
256
#define EFI_ACPI_3_0_TMR_VAL_EXT                           BIT8
243
#define EFI_ACPI_3_0_DCK_CAP                                BIT9
257
#define EFI_ACPI_3_0_DCK_CAP                               BIT9
244
#define EFI_ACPI_3_0_RESET_REG_SUP                          BIT10
258
#define EFI_ACPI_3_0_RESET_REG_SUP                         BIT10
245
#define EFI_ACPI_3_0_SEALED_CASE                            BIT11
259
#define EFI_ACPI_3_0_SEALED_CASE                           BIT11
246
#define EFI_ACPI_3_0_HEADLESS                               BIT12
260
#define EFI_ACPI_3_0_HEADLESS                              BIT12
247
#define EFI_ACPI_3_0_CPU_SW_SLP                             BIT13
261
#define EFI_ACPI_3_0_CPU_SW_SLP                            BIT13
248
#define EFI_ACPI_3_0_PCI_EXP_WAK                            BIT14
262
#define EFI_ACPI_3_0_PCI_EXP_WAK                           BIT14
249
#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK                     BIT15
263
#define EFI_ACPI_3_0_USE_PLATFORM_CLOCK                    BIT15
250
#define EFI_ACPI_3_0_S4_RTC_STS_VALID                       BIT16
264
#define EFI_ACPI_3_0_S4_RTC_STS_VALID                      BIT16
251
#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE                BIT17
265
#define EFI_ACPI_3_0_REMOTE_POWER_ON_CAPABLE               BIT17
252
#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL               BIT18
266
#define EFI_ACPI_3_0_FORCE_APIC_CLUSTER_MODEL              BIT18
253
#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
267
#define EFI_ACPI_3_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE  BIT19
254
268
255
///
269
///
256
/// Firmware ACPI Control Structure
270
/// Firmware ACPI Control Structure
257
///
271
///
258
typedef struct {
272
typedef struct {
259
  UINT32  Signature;
273
  UINT32    Signature;
260
  UINT32  Length;
274
  UINT32    Length;
261
  UINT32  HardwareSignature;
275
  UINT32    HardwareSignature;
262
  UINT32  FirmwareWakingVector;
276
  UINT32    FirmwareWakingVector;
263
  UINT32  GlobalLock;
277
  UINT32    GlobalLock;
264
  UINT32  Flags;
278
  UINT32    Flags;
265
  UINT64  XFirmwareWakingVector;
279
  UINT64    XFirmwareWakingVector;
266
  UINT8   Version;
280
  UINT8     Version;
267
  UINT8   Reserved[31];
281
  UINT8     Reserved[31];
268
} EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
282
} EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
269
283
270
///
284
///
Lines 276-282 typedef struct { Link Here
276
/// Firmware Control Structure Feature Flags
290
/// Firmware Control Structure Feature Flags
277
/// All other bits are reserved and must be set to 0.
291
/// All other bits are reserved and must be set to 0.
278
///
292
///
279
#define EFI_ACPI_3_0_S4BIOS_F       BIT0
293
#define EFI_ACPI_3_0_S4BIOS_F  BIT0
280
294
281
//
295
//
282
// Differentiated System Description Table,
296
// Differentiated System Description Table,
Lines 285-313 typedef struct { Link Here
285
// no definition needed as they are common description table header, the same with
299
// no definition needed as they are common description table header, the same with
286
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
300
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
287
//
301
//
288
#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
302
#define EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x02
289
#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
303
#define EFI_ACPI_3_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION       0x02
290
304
291
///
305
///
292
/// Multiple APIC Description Table header definition.  The rest of the table
306
/// Multiple APIC Description Table header definition.  The rest of the table
293
/// must be defined in a platform specific manner.
307
/// must be defined in a platform specific manner.
294
///
308
///
295
typedef struct {
309
typedef struct {
296
  EFI_ACPI_DESCRIPTION_HEADER Header;
310
  EFI_ACPI_DESCRIPTION_HEADER    Header;
297
  UINT32                      LocalApicAddress;
311
  UINT32                         LocalApicAddress;
298
  UINT32                      Flags;
312
  UINT32                         Flags;
299
} EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
313
} EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
300
314
301
///
315
///
302
/// MADT Revision (as defined in ACPI 3.0 spec.)
316
/// MADT Revision (as defined in ACPI 3.0 spec.)
303
///
317
///
304
#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x02
318
#define EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x02
305
319
306
///
320
///
307
/// Multiple APIC Flags
321
/// Multiple APIC Flags
308
/// All other bits are reserved and must be set to 0.
322
/// All other bits are reserved and must be set to 0.
309
///
323
///
310
#define EFI_ACPI_3_0_PCAT_COMPAT         BIT0
324
#define EFI_ACPI_3_0_PCAT_COMPAT  BIT0
311
325
312
//
326
//
313
// Multiple APIC Description Table APIC structure types
327
// Multiple APIC Description Table APIC structure types
Lines 332-388 typedef struct { Link Here
332
/// Processor Local APIC Structure Definition
346
/// Processor Local APIC Structure Definition
333
///
347
///
334
typedef struct {
348
typedef struct {
335
  UINT8   Type;
349
  UINT8     Type;
336
  UINT8   Length;
350
  UINT8     Length;
337
  UINT8   AcpiProcessorId;
351
  UINT8     AcpiProcessorId;
338
  UINT8   ApicId;
352
  UINT8     ApicId;
339
  UINT32  Flags;
353
  UINT32    Flags;
340
} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
354
} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
341
355
342
///
356
///
343
/// Local APIC Flags.  All other bits are reserved and must be 0.
357
/// Local APIC Flags.  All other bits are reserved and must be 0.
344
///
358
///
345
#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED        BIT0
359
#define EFI_ACPI_3_0_LOCAL_APIC_ENABLED  BIT0
346
360
347
///
361
///
348
/// IO APIC Structure
362
/// IO APIC Structure
349
///
363
///
350
typedef struct {
364
typedef struct {
351
  UINT8   Type;
365
  UINT8     Type;
352
  UINT8   Length;
366
  UINT8     Length;
353
  UINT8   IoApicId;
367
  UINT8     IoApicId;
354
  UINT8   Reserved;
368
  UINT8     Reserved;
355
  UINT32  IoApicAddress;
369
  UINT32    IoApicAddress;
356
  UINT32  GlobalSystemInterruptBase;
370
  UINT32    GlobalSystemInterruptBase;
357
} EFI_ACPI_3_0_IO_APIC_STRUCTURE;
371
} EFI_ACPI_3_0_IO_APIC_STRUCTURE;
358
372
359
///
373
///
360
/// Interrupt Source Override Structure
374
/// Interrupt Source Override Structure
361
///
375
///
362
typedef struct {
376
typedef struct {
363
  UINT8   Type;
377
  UINT8     Type;
364
  UINT8   Length;
378
  UINT8     Length;
365
  UINT8   Bus;
379
  UINT8     Bus;
366
  UINT8   Source;
380
  UINT8     Source;
367
  UINT32  GlobalSystemInterrupt;
381
  UINT32    GlobalSystemInterrupt;
368
  UINT16  Flags;
382
  UINT16    Flags;
369
} EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
383
} EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
370
384
371
///
385
///
372
/// Platform Interrupt Sources Structure Definition
386
/// Platform Interrupt Sources Structure Definition
373
///
387
///
374
typedef struct {
388
typedef struct {
375
  UINT8   Type;
389
  UINT8     Type;
376
  UINT8   Length;
390
  UINT8     Length;
377
  UINT16  Flags;
391
  UINT16    Flags;
378
  UINT8   InterruptType;
392
  UINT8     InterruptType;
379
  UINT8   ProcessorId;
393
  UINT8     ProcessorId;
380
  UINT8   ProcessorEid;
394
  UINT8     ProcessorEid;
381
  UINT8   IoSapicVector;
395
  UINT8     IoSapicVector;
382
  UINT32  GlobalSystemInterrupt;
396
  UINT32    GlobalSystemInterrupt;
383
  UINT32  PlatformInterruptSourceFlags;
397
  UINT32    PlatformInterruptSourceFlags;
384
  UINT8   CpeiProcessorOverride;
398
  UINT8     CpeiProcessorOverride;
385
  UINT8   Reserved[31];
399
  UINT8     Reserved[31];
386
} EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
400
} EFI_ACPI_3_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
387
401
388
//
402
//
Lines 396-438 typedef struct { Link Here
396
/// Non-Maskable Interrupt Source Structure
410
/// Non-Maskable Interrupt Source Structure
397
///
411
///
398
typedef struct {
412
typedef struct {
399
  UINT8   Type;
413
  UINT8     Type;
400
  UINT8   Length;
414
  UINT8     Length;
401
  UINT16  Flags;
415
  UINT16    Flags;
402
  UINT32  GlobalSystemInterrupt;
416
  UINT32    GlobalSystemInterrupt;
403
} EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
417
} EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
404
418
405
///
419
///
406
/// Local APIC NMI Structure
420
/// Local APIC NMI Structure
407
///
421
///
408
typedef struct {
422
typedef struct {
409
  UINT8   Type;
423
  UINT8     Type;
410
  UINT8   Length;
424
  UINT8     Length;
411
  UINT8   AcpiProcessorId;
425
  UINT8     AcpiProcessorId;
412
  UINT16  Flags;
426
  UINT16    Flags;
413
  UINT8   LocalApicLint;
427
  UINT8     LocalApicLint;
414
} EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE;
428
} EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE;
415
429
416
///
430
///
417
/// Local APIC Address Override Structure
431
/// Local APIC Address Override Structure
418
///
432
///
419
typedef struct {
433
typedef struct {
420
  UINT8   Type;
434
  UINT8     Type;
421
  UINT8   Length;
435
  UINT8     Length;
422
  UINT16  Reserved;
436
  UINT16    Reserved;
423
  UINT64  LocalApicAddress;
437
  UINT64    LocalApicAddress;
424
} EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
438
} EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
425
439
426
///
440
///
427
/// IO SAPIC Structure
441
/// IO SAPIC Structure
428
///
442
///
429
typedef struct {
443
typedef struct {
430
  UINT8   Type;
444
  UINT8     Type;
431
  UINT8   Length;
445
  UINT8     Length;
432
  UINT8   IoApicId;
446
  UINT8     IoApicId;
433
  UINT8   Reserved;
447
  UINT8     Reserved;
434
  UINT32  GlobalSystemInterruptBase;
448
  UINT32    GlobalSystemInterruptBase;
435
  UINT64  IoSapicAddress;
449
  UINT64    IoSapicAddress;
436
} EFI_ACPI_3_0_IO_SAPIC_STRUCTURE;
450
} EFI_ACPI_3_0_IO_SAPIC_STRUCTURE;
437
451
438
///
452
///
Lines 440-490 typedef struct { Link Here
440
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
454
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
441
///
455
///
442
typedef struct {
456
typedef struct {
443
  UINT8   Type;
457
  UINT8     Type;
444
  UINT8   Length;
458
  UINT8     Length;
445
  UINT8   AcpiProcessorId;
459
  UINT8     AcpiProcessorId;
446
  UINT8   LocalSapicId;
460
  UINT8     LocalSapicId;
447
  UINT8   LocalSapicEid;
461
  UINT8     LocalSapicEid;
448
  UINT8   Reserved[3];
462
  UINT8     Reserved[3];
449
  UINT32  Flags;
463
  UINT32    Flags;
450
  UINT32  ACPIProcessorUIDValue;
464
  UINT32    ACPIProcessorUIDValue;
451
} EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
465
} EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
452
466
453
///
467
///
454
/// Platform Interrupt Sources Structure
468
/// Platform Interrupt Sources Structure
455
///
469
///
456
typedef struct {
470
typedef struct {
457
  UINT8   Type;
471
  UINT8     Type;
458
  UINT8   Length;
472
  UINT8     Length;
459
  UINT16  Flags;
473
  UINT16    Flags;
460
  UINT8   InterruptType;
474
  UINT8     InterruptType;
461
  UINT8   ProcessorId;
475
  UINT8     ProcessorId;
462
  UINT8   ProcessorEid;
476
  UINT8     ProcessorEid;
463
  UINT8   IoSapicVector;
477
  UINT8     IoSapicVector;
464
  UINT32  GlobalSystemInterrupt;
478
  UINT32    GlobalSystemInterrupt;
465
  UINT32  PlatformInterruptSourceFlags;
479
  UINT32    PlatformInterruptSourceFlags;
466
} EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
480
} EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
467
481
468
///
482
///
469
/// Platform Interrupt Source Flags.
483
/// Platform Interrupt Source Flags.
470
/// All other bits are reserved and must be set to 0.
484
/// All other bits are reserved and must be set to 0.
471
///
485
///
472
#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE          BIT0
486
#define EFI_ACPI_3_0_CPEI_PROCESSOR_OVERRIDE  BIT0
473
487
474
///
488
///
475
/// Smart Battery Description Table (SBST)
489
/// Smart Battery Description Table (SBST)
476
///
490
///
477
typedef struct {
491
typedef struct {
478
  EFI_ACPI_DESCRIPTION_HEADER Header;
492
  EFI_ACPI_DESCRIPTION_HEADER    Header;
479
  UINT32                      WarningEnergyLevel;
493
  UINT32                         WarningEnergyLevel;
480
  UINT32                      LowEnergyLevel;
494
  UINT32                         LowEnergyLevel;
481
  UINT32                      CriticalEnergyLevel;
495
  UINT32                         CriticalEnergyLevel;
482
} EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE;
496
} EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE;
483
497
484
///
498
///
485
/// SBST Version (as defined in ACPI 3.0 spec.)
499
/// SBST Version (as defined in ACPI 3.0 spec.)
486
///
500
///
487
#define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
501
#define EFI_ACPI_3_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
488
502
489
///
503
///
490
/// Embedded Controller Boot Resources Table (ECDT)
504
/// Embedded Controller Boot Resources Table (ECDT)
Lines 492-502 typedef struct { Link Here
492
/// a fully qualified reference to the name space object.
506
/// a fully qualified reference to the name space object.
493
///
507
///
494
typedef struct {
508
typedef struct {
495
  EFI_ACPI_DESCRIPTION_HEADER             Header;
509
  EFI_ACPI_DESCRIPTION_HEADER               Header;
496
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
510
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    EcControl;
497
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE  EcData;
511
  EFI_ACPI_3_0_GENERIC_ADDRESS_STRUCTURE    EcData;
498
  UINT32                                  Uid;
512
  UINT32                                    Uid;
499
  UINT8                                   GpeBit;
513
  UINT8                                     GpeBit;
500
} EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
514
} EFI_ACPI_3_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
501
515
502
///
516
///
Lines 509-517 typedef struct { Link Here
509
/// must be defined in a platform specific manner.
523
/// must be defined in a platform specific manner.
510
///
524
///
511
typedef struct {
525
typedef struct {
512
  EFI_ACPI_DESCRIPTION_HEADER Header;
526
  EFI_ACPI_DESCRIPTION_HEADER    Header;
513
  UINT32                      Reserved1;  ///< Must be set to 1
527
  UINT32                         Reserved1; ///< Must be set to 1
514
  UINT64                      Reserved2;
528
  UINT64                         Reserved2;
515
} EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
529
} EFI_ACPI_3_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
516
530
517
///
531
///
Lines 531-582 typedef struct { Link Here
531
/// Processor Local APIC/SAPIC Affinity Structure Definition
545
/// Processor Local APIC/SAPIC Affinity Structure Definition
532
///
546
///
533
typedef struct {
547
typedef struct {
534
  UINT8   Type;
548
  UINT8     Type;
535
  UINT8   Length;
549
  UINT8     Length;
536
  UINT8   ProximityDomain7To0;
550
  UINT8     ProximityDomain7To0;
537
  UINT8   ApicId;
551
  UINT8     ApicId;
538
  UINT32  Flags;
552
  UINT32    Flags;
539
  UINT8   LocalSapicEid;
553
  UINT8     LocalSapicEid;
540
  UINT8   ProximityDomain31To8[3];
554
  UINT8     ProximityDomain31To8[3];
541
  UINT8   Reserved[4];
555
  UINT8     Reserved[4];
542
} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
556
} EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
543
557
544
///
558
///
545
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
559
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
546
///
560
///
547
#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
561
#define EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED  (1 << 0)
548
562
549
///
563
///
550
/// Memory Affinity Structure Definition
564
/// Memory Affinity Structure Definition
551
///
565
///
552
typedef struct {
566
typedef struct {
553
  UINT8   Type;
567
  UINT8     Type;
554
  UINT8   Length;
568
  UINT8     Length;
555
  UINT32  ProximityDomain;
569
  UINT32    ProximityDomain;
556
  UINT16  Reserved1;
570
  UINT16    Reserved1;
557
  UINT32  AddressBaseLow;
571
  UINT32    AddressBaseLow;
558
  UINT32  AddressBaseHigh;
572
  UINT32    AddressBaseHigh;
559
  UINT32  LengthLow;
573
  UINT32    LengthLow;
560
  UINT32  LengthHigh;
574
  UINT32    LengthHigh;
561
  UINT32  Reserved2;
575
  UINT32    Reserved2;
562
  UINT32  Flags;
576
  UINT32    Flags;
563
  UINT64  Reserved3;
577
  UINT64    Reserved3;
564
} EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
578
} EFI_ACPI_3_0_MEMORY_AFFINITY_STRUCTURE;
565
579
566
//
580
//
567
// Memory Flags.  All other bits are reserved and must be 0.
581
// Memory Flags.  All other bits are reserved and must be 0.
568
//
582
//
569
#define EFI_ACPI_3_0_MEMORY_ENABLED       (1 << 0)
583
#define EFI_ACPI_3_0_MEMORY_ENABLED        (1 << 0)
570
#define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE (1 << 1)
584
#define EFI_ACPI_3_0_MEMORY_HOT_PLUGGABLE  (1 << 1)
571
#define EFI_ACPI_3_0_MEMORY_NONVOLATILE   (1 << 2)
585
#define EFI_ACPI_3_0_MEMORY_NONVOLATILE    (1 << 2)
572
586
573
///
587
///
574
/// System Locality Distance Information Table (SLIT).
588
/// System Locality Distance Information Table (SLIT).
575
/// The rest of the table is a matrix.
589
/// The rest of the table is a matrix.
576
///
590
///
577
typedef struct {
591
typedef struct {
578
  EFI_ACPI_DESCRIPTION_HEADER Header;
592
  EFI_ACPI_DESCRIPTION_HEADER    Header;
579
  UINT64                      NumberOfSystemLocalities;
593
  UINT64                         NumberOfSystemLocalities;
580
} EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
594
} EFI_ACPI_3_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
581
595
582
///
596
///
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi40.h (-518 / +524 lines)
Lines 1-7 Link Here
1
/** @file
1
/** @file
2
  ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 2010
2
  ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 2010
3
3
4
  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
4
  Copyright (c) 2010 - 2022, Intel Corporation. All rights reserved.<BR>
5
  SPDX-License-Identifier: BSD-2-Clause-Patent
5
  SPDX-License-Identifier: BSD-2-Clause-Patent
6
**/
6
**/
7
7
Lines 10-15 Link Here
10
10
11
#include <IndustryStandard/Acpi30.h>
11
#include <IndustryStandard/Acpi30.h>
12
12
13
///
14
/// _PSD Revision for ACPI 4.0
15
///
16
#define EFI_ACPI_4_0_AML_PSD_REVISION  0
17
13
//
18
//
14
// Ensure proper structure formats
19
// Ensure proper structure formats
15
//
20
//
Lines 19-29 Link Here
19
/// ACPI 4.0 Generic Address Space definition
24
/// ACPI 4.0 Generic Address Space definition
20
///
25
///
21
typedef struct {
26
typedef struct {
22
  UINT8   AddressSpaceId;
27
  UINT8     AddressSpaceId;
23
  UINT8   RegisterBitWidth;
28
  UINT8     RegisterBitWidth;
24
  UINT8   RegisterBitOffset;
29
  UINT8     RegisterBitOffset;
25
  UINT8   AccessSize;
30
  UINT8     AccessSize;
26
  UINT64  Address;
31
  UINT64    Address;
27
} EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE;
32
} EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE;
28
33
29
//
34
//
Lines 53-81 typedef struct { Link Here
53
/// Root System Description Pointer Structure
58
/// Root System Description Pointer Structure
54
///
59
///
55
typedef struct {
60
typedef struct {
56
  UINT64  Signature;
61
  UINT64    Signature;
57
  UINT8   Checksum;
62
  UINT8     Checksum;
58
  UINT8   OemId[6];
63
  UINT8     OemId[6];
59
  UINT8   Revision;
64
  UINT8     Revision;
60
  UINT32  RsdtAddress;
65
  UINT32    RsdtAddress;
61
  UINT32  Length;
66
  UINT32    Length;
62
  UINT64  XsdtAddress;
67
  UINT64    XsdtAddress;
63
  UINT8   ExtendedChecksum;
68
  UINT8     ExtendedChecksum;
64
  UINT8   Reserved[3];
69
  UINT8     Reserved[3];
65
} EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
70
} EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
66
71
67
///
72
///
68
/// RSD_PTR Revision (as defined in ACPI 4.0b spec.)
73
/// RSD_PTR Revision (as defined in ACPI 4.0b spec.)
69
///
74
///
70
#define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 4.0a) says current value is 2
75
#define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02 ///< ACPISpec (Revision 4.0a) says current value is 2
71
76
72
///
77
///
73
/// Common table header, this prefaces all ACPI tables, including FACS, but
78
/// Common table header, this prefaces all ACPI tables, including FACS, but
74
/// excluding the RSD PTR structure
79
/// excluding the RSD PTR structure
75
///
80
///
76
typedef struct {
81
typedef struct {
77
  UINT32  Signature;
82
  UINT32    Signature;
78
  UINT32  Length;
83
  UINT32    Length;
79
} EFI_ACPI_4_0_COMMON_HEADER;
84
} EFI_ACPI_4_0_COMMON_HEADER;
80
85
81
//
86
//
Lines 87-93 typedef struct { Link Here
87
///
92
///
88
/// RSDT Revision (as defined in ACPI 4.0 spec.)
93
/// RSDT Revision (as defined in ACPI 4.0 spec.)
89
///
94
///
90
#define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
95
#define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
91
96
92
//
97
//
93
// Extended System Description Table
98
// Extended System Description Table
Lines 98-161 typedef struct { Link Here
98
///
103
///
99
/// XSDT Revision (as defined in ACPI 4.0 spec.)
104
/// XSDT Revision (as defined in ACPI 4.0 spec.)
100
///
105
///
101
#define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
106
#define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
102
107
103
///
108
///
104
/// Fixed ACPI Description Table Structure (FADT)
109
/// Fixed ACPI Description Table Structure (FADT)
105
///
110
///
106
typedef struct {
111
typedef struct {
107
  EFI_ACPI_DESCRIPTION_HEADER             Header;
112
  EFI_ACPI_DESCRIPTION_HEADER               Header;
108
  UINT32                                  FirmwareCtrl;
113
  UINT32                                    FirmwareCtrl;
109
  UINT32                                  Dsdt;
114
  UINT32                                    Dsdt;
110
  UINT8                                   Reserved0;
115
  UINT8                                     Reserved0;
111
  UINT8                                   PreferredPmProfile;
116
  UINT8                                     PreferredPmProfile;
112
  UINT16                                  SciInt;
117
  UINT16                                    SciInt;
113
  UINT32                                  SmiCmd;
118
  UINT32                                    SmiCmd;
114
  UINT8                                   AcpiEnable;
119
  UINT8                                     AcpiEnable;
115
  UINT8                                   AcpiDisable;
120
  UINT8                                     AcpiDisable;
116
  UINT8                                   S4BiosReq;
121
  UINT8                                     S4BiosReq;
117
  UINT8                                   PstateCnt;
122
  UINT8                                     PstateCnt;
118
  UINT32                                  Pm1aEvtBlk;
123
  UINT32                                    Pm1aEvtBlk;
119
  UINT32                                  Pm1bEvtBlk;
124
  UINT32                                    Pm1bEvtBlk;
120
  UINT32                                  Pm1aCntBlk;
125
  UINT32                                    Pm1aCntBlk;
121
  UINT32                                  Pm1bCntBlk;
126
  UINT32                                    Pm1bCntBlk;
122
  UINT32                                  Pm2CntBlk;
127
  UINT32                                    Pm2CntBlk;
123
  UINT32                                  PmTmrBlk;
128
  UINT32                                    PmTmrBlk;
124
  UINT32                                  Gpe0Blk;
129
  UINT32                                    Gpe0Blk;
125
  UINT32                                  Gpe1Blk;
130
  UINT32                                    Gpe1Blk;
126
  UINT8                                   Pm1EvtLen;
131
  UINT8                                     Pm1EvtLen;
127
  UINT8                                   Pm1CntLen;
132
  UINT8                                     Pm1CntLen;
128
  UINT8                                   Pm2CntLen;
133
  UINT8                                     Pm2CntLen;
129
  UINT8                                   PmTmrLen;
134
  UINT8                                     PmTmrLen;
130
  UINT8                                   Gpe0BlkLen;
135
  UINT8                                     Gpe0BlkLen;
131
  UINT8                                   Gpe1BlkLen;
136
  UINT8                                     Gpe1BlkLen;
132
  UINT8                                   Gpe1Base;
137
  UINT8                                     Gpe1Base;
133
  UINT8                                   CstCnt;
138
  UINT8                                     CstCnt;
134
  UINT16                                  PLvl2Lat;
139
  UINT16                                    PLvl2Lat;
135
  UINT16                                  PLvl3Lat;
140
  UINT16                                    PLvl3Lat;
136
  UINT16                                  FlushSize;
141
  UINT16                                    FlushSize;
137
  UINT16                                  FlushStride;
142
  UINT16                                    FlushStride;
138
  UINT8                                   DutyOffset;
143
  UINT8                                     DutyOffset;
139
  UINT8                                   DutyWidth;
144
  UINT8                                     DutyWidth;
140
  UINT8                                   DayAlrm;
145
  UINT8                                     DayAlrm;
141
  UINT8                                   MonAlrm;
146
  UINT8                                     MonAlrm;
142
  UINT8                                   Century;
147
  UINT8                                     Century;
143
  UINT16                                  IaPcBootArch;
148
  UINT16                                    IaPcBootArch;
144
  UINT8                                   Reserved1;
149
  UINT8                                     Reserved1;
145
  UINT32                                  Flags;
150
  UINT32                                    Flags;
146
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
151
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    ResetReg;
147
  UINT8                                   ResetValue;
152
  UINT8                                     ResetValue;
148
  UINT8                                   Reserved2[3];
153
  UINT8                                     Reserved2[3];
149
  UINT64                                  XFirmwareCtrl;
154
  UINT64                                    XFirmwareCtrl;
150
  UINT64                                  XDsdt;
155
  UINT64                                    XDsdt;
151
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
156
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
152
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
157
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
153
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
158
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
154
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
159
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
155
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
160
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
156
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
161
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
157
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
162
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
158
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
163
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
159
} EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE;
164
} EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE;
160
165
161
///
166
///
Lines 179-230 typedef struct { Link Here
179
// Fixed ACPI Description Table Boot Architecture Flags
184
// Fixed ACPI Description Table Boot Architecture Flags
180
// All other bits are reserved and must be set to 0.
185
// All other bits are reserved and must be set to 0.
181
//
186
//
182
#define EFI_ACPI_4_0_LEGACY_DEVICES              BIT0
187
#define EFI_ACPI_4_0_LEGACY_DEVICES      BIT0
183
#define EFI_ACPI_4_0_8042                        BIT1
188
#define EFI_ACPI_4_0_8042                BIT1
184
#define EFI_ACPI_4_0_VGA_NOT_PRESENT             BIT2
189
#define EFI_ACPI_4_0_VGA_NOT_PRESENT     BIT2
185
#define EFI_ACPI_4_0_MSI_NOT_SUPPORTED           BIT3
190
#define EFI_ACPI_4_0_MSI_NOT_SUPPORTED   BIT3
186
#define EFI_ACPI_4_0_PCIE_ASPM_CONTROLS          BIT4
191
#define EFI_ACPI_4_0_PCIE_ASPM_CONTROLS  BIT4
187
192
188
//
193
//
189
// Fixed ACPI Description Table Fixed Feature Flags
194
// Fixed ACPI Description Table Fixed Feature Flags
190
// All other bits are reserved and must be set to 0.
195
// All other bits are reserved and must be set to 0.
191
//
196
//
192
#define EFI_ACPI_4_0_WBINVD                                 BIT0
197
#define EFI_ACPI_4_0_WBINVD                                BIT0
193
#define EFI_ACPI_4_0_WBINVD_FLUSH                           BIT1
198
#define EFI_ACPI_4_0_WBINVD_FLUSH                          BIT1
194
#define EFI_ACPI_4_0_PROC_C1                                BIT2
199
#define EFI_ACPI_4_0_PROC_C1                               BIT2
195
#define EFI_ACPI_4_0_P_LVL2_UP                              BIT3
200
#define EFI_ACPI_4_0_P_LVL2_UP                             BIT3
196
#define EFI_ACPI_4_0_PWR_BUTTON                             BIT4
201
#define EFI_ACPI_4_0_PWR_BUTTON                            BIT4
197
#define EFI_ACPI_4_0_SLP_BUTTON                             BIT5
202
#define EFI_ACPI_4_0_SLP_BUTTON                            BIT5
198
#define EFI_ACPI_4_0_FIX_RTC                                BIT6
203
#define EFI_ACPI_4_0_FIX_RTC                               BIT6
199
#define EFI_ACPI_4_0_RTC_S4                                 BIT7
204
#define EFI_ACPI_4_0_RTC_S4                                BIT7
200
#define EFI_ACPI_4_0_TMR_VAL_EXT                            BIT8
205
#define EFI_ACPI_4_0_TMR_VAL_EXT                           BIT8
201
#define EFI_ACPI_4_0_DCK_CAP                                BIT9
206
#define EFI_ACPI_4_0_DCK_CAP                               BIT9
202
#define EFI_ACPI_4_0_RESET_REG_SUP                          BIT10
207
#define EFI_ACPI_4_0_RESET_REG_SUP                         BIT10
203
#define EFI_ACPI_4_0_SEALED_CASE                            BIT11
208
#define EFI_ACPI_4_0_SEALED_CASE                           BIT11
204
#define EFI_ACPI_4_0_HEADLESS                               BIT12
209
#define EFI_ACPI_4_0_HEADLESS                              BIT12
205
#define EFI_ACPI_4_0_CPU_SW_SLP                             BIT13
210
#define EFI_ACPI_4_0_CPU_SW_SLP                            BIT13
206
#define EFI_ACPI_4_0_PCI_EXP_WAK                            BIT14
211
#define EFI_ACPI_4_0_PCI_EXP_WAK                           BIT14
207
#define EFI_ACPI_4_0_USE_PLATFORM_CLOCK                     BIT15
212
#define EFI_ACPI_4_0_USE_PLATFORM_CLOCK                    BIT15
208
#define EFI_ACPI_4_0_S4_RTC_STS_VALID                       BIT16
213
#define EFI_ACPI_4_0_S4_RTC_STS_VALID                      BIT16
209
#define EFI_ACPI_4_0_REMOTE_POWER_ON_CAPABLE                BIT17
214
#define EFI_ACPI_4_0_REMOTE_POWER_ON_CAPABLE               BIT17
210
#define EFI_ACPI_4_0_FORCE_APIC_CLUSTER_MODEL               BIT18
215
#define EFI_ACPI_4_0_FORCE_APIC_CLUSTER_MODEL              BIT18
211
#define EFI_ACPI_4_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
216
#define EFI_ACPI_4_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE  BIT19
212
217
213
///
218
///
214
/// Firmware ACPI Control Structure
219
/// Firmware ACPI Control Structure
215
///
220
///
216
typedef struct {
221
typedef struct {
217
  UINT32  Signature;
222
  UINT32    Signature;
218
  UINT32  Length;
223
  UINT32    Length;
219
  UINT32  HardwareSignature;
224
  UINT32    HardwareSignature;
220
  UINT32  FirmwareWakingVector;
225
  UINT32    FirmwareWakingVector;
221
  UINT32  GlobalLock;
226
  UINT32    GlobalLock;
222
  UINT32  Flags;
227
  UINT32    Flags;
223
  UINT64  XFirmwareWakingVector;
228
  UINT64    XFirmwareWakingVector;
224
  UINT8   Version;
229
  UINT8     Version;
225
  UINT8   Reserved0[3];
230
  UINT8     Reserved0[3];
226
  UINT32  OspmFlags;
231
  UINT32    OspmFlags;
227
  UINT8   Reserved1[24];
232
  UINT8     Reserved1[24];
228
} EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
233
} EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
229
234
230
///
235
///
Lines 236-249 typedef struct { Link Here
236
/// Firmware Control Structure Feature Flags
241
/// Firmware Control Structure Feature Flags
237
/// All other bits are reserved and must be set to 0.
242
/// All other bits are reserved and must be set to 0.
238
///
243
///
239
#define EFI_ACPI_4_0_S4BIOS_F                     BIT0
244
#define EFI_ACPI_4_0_S4BIOS_F                BIT0
240
#define EFI_ACPI_4_0_64BIT_WAKE_SUPPORTED_F       BIT1
245
#define EFI_ACPI_4_0_64BIT_WAKE_SUPPORTED_F  BIT1
241
246
242
///
247
///
243
/// OSPM Enabled Firmware Control Structure Flags
248
/// OSPM Enabled Firmware Control Structure Flags
244
/// All other bits are reserved and must be set to 0.
249
/// All other bits are reserved and must be set to 0.
245
///
250
///
246
#define EFI_ACPI_4_0_OSPM_64BIT_WAKE__F           BIT0
251
#define EFI_ACPI_4_0_OSPM_64BIT_WAKE__F  BIT0
247
252
248
//
253
//
249
// Differentiated System Description Table,
254
// Differentiated System Description Table,
Lines 252-280 typedef struct { Link Here
252
// no definition needed as they are common description table header, the same with
257
// no definition needed as they are common description table header, the same with
253
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
258
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
254
//
259
//
255
#define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
260
#define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x02
256
#define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
261
#define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION       0x02
257
262
258
///
263
///
259
/// Multiple APIC Description Table header definition.  The rest of the table
264
/// Multiple APIC Description Table header definition.  The rest of the table
260
/// must be defined in a platform specific manner.
265
/// must be defined in a platform specific manner.
261
///
266
///
262
typedef struct {
267
typedef struct {
263
  EFI_ACPI_DESCRIPTION_HEADER Header;
268
  EFI_ACPI_DESCRIPTION_HEADER    Header;
264
  UINT32                      LocalApicAddress;
269
  UINT32                         LocalApicAddress;
265
  UINT32                      Flags;
270
  UINT32                         Flags;
266
} EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
271
} EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
267
272
268
///
273
///
269
/// MADT Revision (as defined in ACPI 4.0 spec.)
274
/// MADT Revision (as defined in ACPI 4.0 spec.)
270
///
275
///
271
#define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
276
#define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x03
272
277
273
///
278
///
274
/// Multiple APIC Flags
279
/// Multiple APIC Flags
275
/// All other bits are reserved and must be set to 0.
280
/// All other bits are reserved and must be set to 0.
276
///
281
///
277
#define EFI_ACPI_4_0_PCAT_COMPAT         BIT0
282
#define EFI_ACPI_4_0_PCAT_COMPAT  BIT0
278
283
279
//
284
//
280
// Multiple APIC Description Table APIC structure types
285
// Multiple APIC Description Table APIC structure types
Lines 301-357 typedef struct { Link Here
301
/// Processor Local APIC Structure Definition
306
/// Processor Local APIC Structure Definition
302
///
307
///
303
typedef struct {
308
typedef struct {
304
  UINT8   Type;
309
  UINT8     Type;
305
  UINT8   Length;
310
  UINT8     Length;
306
  UINT8   AcpiProcessorId;
311
  UINT8     AcpiProcessorId;
307
  UINT8   ApicId;
312
  UINT8     ApicId;
308
  UINT32  Flags;
313
  UINT32    Flags;
309
} EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
314
} EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
310
315
311
///
316
///
312
/// Local APIC Flags.  All other bits are reserved and must be 0.
317
/// Local APIC Flags.  All other bits are reserved and must be 0.
313
///
318
///
314
#define EFI_ACPI_4_0_LOCAL_APIC_ENABLED        BIT0
319
#define EFI_ACPI_4_0_LOCAL_APIC_ENABLED  BIT0
315
320
316
///
321
///
317
/// IO APIC Structure
322
/// IO APIC Structure
318
///
323
///
319
typedef struct {
324
typedef struct {
320
  UINT8   Type;
325
  UINT8     Type;
321
  UINT8   Length;
326
  UINT8     Length;
322
  UINT8   IoApicId;
327
  UINT8     IoApicId;
323
  UINT8   Reserved;
328
  UINT8     Reserved;
324
  UINT32  IoApicAddress;
329
  UINT32    IoApicAddress;
325
  UINT32  GlobalSystemInterruptBase;
330
  UINT32    GlobalSystemInterruptBase;
326
} EFI_ACPI_4_0_IO_APIC_STRUCTURE;
331
} EFI_ACPI_4_0_IO_APIC_STRUCTURE;
327
332
328
///
333
///
329
/// Interrupt Source Override Structure
334
/// Interrupt Source Override Structure
330
///
335
///
331
typedef struct {
336
typedef struct {
332
  UINT8   Type;
337
  UINT8     Type;
333
  UINT8   Length;
338
  UINT8     Length;
334
  UINT8   Bus;
339
  UINT8     Bus;
335
  UINT8   Source;
340
  UINT8     Source;
336
  UINT32  GlobalSystemInterrupt;
341
  UINT32    GlobalSystemInterrupt;
337
  UINT16  Flags;
342
  UINT16    Flags;
338
} EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
343
} EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
339
344
340
///
345
///
341
/// Platform Interrupt Sources Structure Definition
346
/// Platform Interrupt Sources Structure Definition
342
///
347
///
343
typedef struct {
348
typedef struct {
344
  UINT8   Type;
349
  UINT8     Type;
345
  UINT8   Length;
350
  UINT8     Length;
346
  UINT16  Flags;
351
  UINT16    Flags;
347
  UINT8   InterruptType;
352
  UINT8     InterruptType;
348
  UINT8   ProcessorId;
353
  UINT8     ProcessorId;
349
  UINT8   ProcessorEid;
354
  UINT8     ProcessorEid;
350
  UINT8   IoSapicVector;
355
  UINT8     IoSapicVector;
351
  UINT32  GlobalSystemInterrupt;
356
  UINT32    GlobalSystemInterrupt;
352
  UINT32  PlatformInterruptSourceFlags;
357
  UINT32    PlatformInterruptSourceFlags;
353
  UINT8   CpeiProcessorOverride;
358
  UINT8     CpeiProcessorOverride;
354
  UINT8   Reserved[31];
359
  UINT8     Reserved[31];
355
} EFI_ACPI_4_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
360
} EFI_ACPI_4_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
356
361
357
//
362
//
Lines 365-407 typedef struct { Link Here
365
/// Non-Maskable Interrupt Source Structure
370
/// Non-Maskable Interrupt Source Structure
366
///
371
///
367
typedef struct {
372
typedef struct {
368
  UINT8   Type;
373
  UINT8     Type;
369
  UINT8   Length;
374
  UINT8     Length;
370
  UINT16  Flags;
375
  UINT16    Flags;
371
  UINT32  GlobalSystemInterrupt;
376
  UINT32    GlobalSystemInterrupt;
372
} EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
377
} EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
373
378
374
///
379
///
375
/// Local APIC NMI Structure
380
/// Local APIC NMI Structure
376
///
381
///
377
typedef struct {
382
typedef struct {
378
  UINT8   Type;
383
  UINT8     Type;
379
  UINT8   Length;
384
  UINT8     Length;
380
  UINT8   AcpiProcessorId;
385
  UINT8     AcpiProcessorId;
381
  UINT16  Flags;
386
  UINT16    Flags;
382
  UINT8   LocalApicLint;
387
  UINT8     LocalApicLint;
383
} EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE;
388
} EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE;
384
389
385
///
390
///
386
/// Local APIC Address Override Structure
391
/// Local APIC Address Override Structure
387
///
392
///
388
typedef struct {
393
typedef struct {
389
  UINT8   Type;
394
  UINT8     Type;
390
  UINT8   Length;
395
  UINT8     Length;
391
  UINT16  Reserved;
396
  UINT16    Reserved;
392
  UINT64  LocalApicAddress;
397
  UINT64    LocalApicAddress;
393
} EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
398
} EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
394
399
395
///
400
///
396
/// IO SAPIC Structure
401
/// IO SAPIC Structure
397
///
402
///
398
typedef struct {
403
typedef struct {
399
  UINT8   Type;
404
  UINT8     Type;
400
  UINT8   Length;
405
  UINT8     Length;
401
  UINT8   IoApicId;
406
  UINT8     IoApicId;
402
  UINT8   Reserved;
407
  UINT8     Reserved;
403
  UINT32  GlobalSystemInterruptBase;
408
  UINT32    GlobalSystemInterruptBase;
404
  UINT64  IoSapicAddress;
409
  UINT64    IoSapicAddress;
405
} EFI_ACPI_4_0_IO_SAPIC_STRUCTURE;
410
} EFI_ACPI_4_0_IO_SAPIC_STRUCTURE;
406
411
407
///
412
///
Lines 409-483 typedef struct { Link Here
409
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
414
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
410
///
415
///
411
typedef struct {
416
typedef struct {
412
  UINT8   Type;
417
  UINT8     Type;
413
  UINT8   Length;
418
  UINT8     Length;
414
  UINT8   AcpiProcessorId;
419
  UINT8     AcpiProcessorId;
415
  UINT8   LocalSapicId;
420
  UINT8     LocalSapicId;
416
  UINT8   LocalSapicEid;
421
  UINT8     LocalSapicEid;
417
  UINT8   Reserved[3];
422
  UINT8     Reserved[3];
418
  UINT32  Flags;
423
  UINT32    Flags;
419
  UINT32  ACPIProcessorUIDValue;
424
  UINT32    ACPIProcessorUIDValue;
420
} EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
425
} EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
421
426
422
///
427
///
423
/// Platform Interrupt Sources Structure
428
/// Platform Interrupt Sources Structure
424
///
429
///
425
typedef struct {
430
typedef struct {
426
  UINT8   Type;
431
  UINT8     Type;
427
  UINT8   Length;
432
  UINT8     Length;
428
  UINT16  Flags;
433
  UINT16    Flags;
429
  UINT8   InterruptType;
434
  UINT8     InterruptType;
430
  UINT8   ProcessorId;
435
  UINT8     ProcessorId;
431
  UINT8   ProcessorEid;
436
  UINT8     ProcessorEid;
432
  UINT8   IoSapicVector;
437
  UINT8     IoSapicVector;
433
  UINT32  GlobalSystemInterrupt;
438
  UINT32    GlobalSystemInterrupt;
434
  UINT32  PlatformInterruptSourceFlags;
439
  UINT32    PlatformInterruptSourceFlags;
435
} EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
440
} EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
436
441
437
///
442
///
438
/// Platform Interrupt Source Flags.
443
/// Platform Interrupt Source Flags.
439
/// All other bits are reserved and must be set to 0.
444
/// All other bits are reserved and must be set to 0.
440
///
445
///
441
#define EFI_ACPI_4_0_CPEI_PROCESSOR_OVERRIDE          BIT0
446
#define EFI_ACPI_4_0_CPEI_PROCESSOR_OVERRIDE  BIT0
442
447
443
///
448
///
444
/// Processor Local x2APIC Structure Definition
449
/// Processor Local x2APIC Structure Definition
445
///
450
///
446
typedef struct {
451
typedef struct {
447
  UINT8   Type;
452
  UINT8     Type;
448
  UINT8   Length;
453
  UINT8     Length;
449
  UINT8   Reserved[2];
454
  UINT8     Reserved[2];
450
  UINT32  X2ApicId;
455
  UINT32    X2ApicId;
451
  UINT32  Flags;
456
  UINT32    Flags;
452
  UINT32  AcpiProcessorUid;
457
  UINT32    AcpiProcessorUid;
453
} EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
458
} EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
454
459
455
///
460
///
456
/// Local x2APIC NMI Structure
461
/// Local x2APIC NMI Structure
457
///
462
///
458
typedef struct {
463
typedef struct {
459
  UINT8   Type;
464
  UINT8     Type;
460
  UINT8   Length;
465
  UINT8     Length;
461
  UINT16  Flags;
466
  UINT16    Flags;
462
  UINT32  AcpiProcessorUid;
467
  UINT32    AcpiProcessorUid;
463
  UINT8   LocalX2ApicLint;
468
  UINT8     LocalX2ApicLint;
464
  UINT8   Reserved[3];
469
  UINT8     Reserved[3];
465
} EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE;
470
} EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE;
466
471
467
///
472
///
468
/// Smart Battery Description Table (SBST)
473
/// Smart Battery Description Table (SBST)
469
///
474
///
470
typedef struct {
475
typedef struct {
471
  EFI_ACPI_DESCRIPTION_HEADER Header;
476
  EFI_ACPI_DESCRIPTION_HEADER    Header;
472
  UINT32                      WarningEnergyLevel;
477
  UINT32                         WarningEnergyLevel;
473
  UINT32                      LowEnergyLevel;
478
  UINT32                         LowEnergyLevel;
474
  UINT32                      CriticalEnergyLevel;
479
  UINT32                         CriticalEnergyLevel;
475
} EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE;
480
} EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE;
476
481
477
///
482
///
478
/// SBST Version (as defined in ACPI 4.0 spec.)
483
/// SBST Version (as defined in ACPI 4.0 spec.)
479
///
484
///
480
#define EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
485
#define EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
481
486
482
///
487
///
483
/// Embedded Controller Boot Resources Table (ECDT)
488
/// Embedded Controller Boot Resources Table (ECDT)
Lines 485-495 typedef struct { Link Here
485
/// a fully qualified reference to the name space object.
490
/// a fully qualified reference to the name space object.
486
///
491
///
487
typedef struct {
492
typedef struct {
488
  EFI_ACPI_DESCRIPTION_HEADER             Header;
493
  EFI_ACPI_DESCRIPTION_HEADER               Header;
489
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
494
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    EcControl;
490
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  EcData;
495
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    EcData;
491
  UINT32                                  Uid;
496
  UINT32                                    Uid;
492
  UINT8                                   GpeBit;
497
  UINT8                                     GpeBit;
493
} EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
498
} EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
494
499
495
///
500
///
Lines 502-510 typedef struct { Link Here
502
/// must be defined in a platform specific manner.
507
/// must be defined in a platform specific manner.
503
///
508
///
504
typedef struct {
509
typedef struct {
505
  EFI_ACPI_DESCRIPTION_HEADER Header;
510
  EFI_ACPI_DESCRIPTION_HEADER    Header;
506
  UINT32                      Reserved1;  ///< Must be set to 1
511
  UINT32                         Reserved1; ///< Must be set to 1
507
  UINT64                      Reserved2;
512
  UINT64                         Reserved2;
508
} EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
513
} EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
509
514
510
///
515
///
Lines 525-581 typedef struct { Link Here
525
/// Processor Local APIC/SAPIC Affinity Structure Definition
530
/// Processor Local APIC/SAPIC Affinity Structure Definition
526
///
531
///
527
typedef struct {
532
typedef struct {
528
  UINT8   Type;
533
  UINT8     Type;
529
  UINT8   Length;
534
  UINT8     Length;
530
  UINT8   ProximityDomain7To0;
535
  UINT8     ProximityDomain7To0;
531
  UINT8   ApicId;
536
  UINT8     ApicId;
532
  UINT32  Flags;
537
  UINT32    Flags;
533
  UINT8   LocalSapicEid;
538
  UINT8     LocalSapicEid;
534
  UINT8   ProximityDomain31To8[3];
539
  UINT8     ProximityDomain31To8[3];
535
  UINT32  ClockDomain;
540
  UINT32    ClockDomain;
536
} EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
541
} EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
537
542
538
///
543
///
539
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
544
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
540
///
545
///
541
#define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
546
#define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED  (1 << 0)
542
547
543
///
548
///
544
/// Memory Affinity Structure Definition
549
/// Memory Affinity Structure Definition
545
///
550
///
546
typedef struct {
551
typedef struct {
547
  UINT8   Type;
552
  UINT8     Type;
548
  UINT8   Length;
553
  UINT8     Length;
549
  UINT32  ProximityDomain;
554
  UINT32    ProximityDomain;
550
  UINT16  Reserved1;
555
  UINT16    Reserved1;
551
  UINT32  AddressBaseLow;
556
  UINT32    AddressBaseLow;
552
  UINT32  AddressBaseHigh;
557
  UINT32    AddressBaseHigh;
553
  UINT32  LengthLow;
558
  UINT32    LengthLow;
554
  UINT32  LengthHigh;
559
  UINT32    LengthHigh;
555
  UINT32  Reserved2;
560
  UINT32    Reserved2;
556
  UINT32  Flags;
561
  UINT32    Flags;
557
  UINT64  Reserved3;
562
  UINT64    Reserved3;
558
} EFI_ACPI_4_0_MEMORY_AFFINITY_STRUCTURE;
563
} EFI_ACPI_4_0_MEMORY_AFFINITY_STRUCTURE;
559
564
560
//
565
//
561
// Memory Flags.  All other bits are reserved and must be 0.
566
// Memory Flags.  All other bits are reserved and must be 0.
562
//
567
//
563
#define EFI_ACPI_4_0_MEMORY_ENABLED       (1 << 0)
568
#define EFI_ACPI_4_0_MEMORY_ENABLED        (1 << 0)
564
#define EFI_ACPI_4_0_MEMORY_HOT_PLUGGABLE (1 << 1)
569
#define EFI_ACPI_4_0_MEMORY_HOT_PLUGGABLE  (1 << 1)
565
#define EFI_ACPI_4_0_MEMORY_NONVOLATILE   (1 << 2)
570
#define EFI_ACPI_4_0_MEMORY_NONVOLATILE    (1 << 2)
566
571
567
///
572
///
568
/// Processor Local x2APIC Affinity Structure Definition
573
/// Processor Local x2APIC Affinity Structure Definition
569
///
574
///
570
typedef struct {
575
typedef struct {
571
  UINT8   Type;
576
  UINT8     Type;
572
  UINT8   Length;
577
  UINT8     Length;
573
  UINT8   Reserved1[2];
578
  UINT8     Reserved1[2];
574
  UINT32  ProximityDomain;
579
  UINT32    ProximityDomain;
575
  UINT32  X2ApicId;
580
  UINT32    X2ApicId;
576
  UINT32  Flags;
581
  UINT32    Flags;
577
  UINT32  ClockDomain;
582
  UINT32    ClockDomain;
578
  UINT8   Reserved2[4];
583
  UINT8     Reserved2[4];
579
} EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
584
} EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
580
585
581
///
586
///
Lines 583-590 typedef struct { Link Here
583
/// The rest of the table is a matrix.
588
/// The rest of the table is a matrix.
584
///
589
///
585
typedef struct {
590
typedef struct {
586
  EFI_ACPI_DESCRIPTION_HEADER Header;
591
  EFI_ACPI_DESCRIPTION_HEADER    Header;
587
  UINT64                      NumberOfSystemLocalities;
592
  UINT64                         NumberOfSystemLocalities;
588
} EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
593
} EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
589
594
590
///
595
///
Lines 596-609 typedef struct { Link Here
596
/// Corrected Platform Error Polling Table (CPEP)
601
/// Corrected Platform Error Polling Table (CPEP)
597
///
602
///
598
typedef struct {
603
typedef struct {
599
  EFI_ACPI_DESCRIPTION_HEADER Header;
604
  EFI_ACPI_DESCRIPTION_HEADER    Header;
600
  UINT8                       Reserved[8];
605
  UINT8                          Reserved[8];
601
} EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
606
} EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
602
607
603
///
608
///
604
/// CPEP Version (as defined in ACPI 4.0 spec.)
609
/// CPEP Version (as defined in ACPI 4.0 spec.)
605
///
610
///
606
#define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
611
#define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION  0x01
607
612
608
//
613
//
609
// CPEP processor structure types.
614
// CPEP processor structure types.
Lines 614-695 typedef struct { Link Here
614
/// Corrected Platform Error Polling Processor Structure Definition
619
/// Corrected Platform Error Polling Processor Structure Definition
615
///
620
///
616
typedef struct {
621
typedef struct {
617
  UINT8   Type;
622
  UINT8     Type;
618
  UINT8   Length;
623
  UINT8     Length;
619
  UINT8   ProcessorId;
624
  UINT8     ProcessorId;
620
  UINT8   ProcessorEid;
625
  UINT8     ProcessorEid;
621
  UINT32  PollingInterval;
626
  UINT32    PollingInterval;
622
} EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
627
} EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
623
628
624
///
629
///
625
/// Maximum System Characteristics Table (MSCT)
630
/// Maximum System Characteristics Table (MSCT)
626
///
631
///
627
typedef struct {
632
typedef struct {
628
  EFI_ACPI_DESCRIPTION_HEADER Header;
633
  EFI_ACPI_DESCRIPTION_HEADER    Header;
629
  UINT32                      OffsetProxDomInfo;
634
  UINT32                         OffsetProxDomInfo;
630
  UINT32                      MaximumNumberOfProximityDomains;
635
  UINT32                         MaximumNumberOfProximityDomains;
631
  UINT32                      MaximumNumberOfClockDomains;
636
  UINT32                         MaximumNumberOfClockDomains;
632
  UINT64                      MaximumPhysicalAddress;
637
  UINT64                         MaximumPhysicalAddress;
633
} EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
638
} EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
634
639
635
///
640
///
636
/// MSCT Version (as defined in ACPI 4.0 spec.)
641
/// MSCT Version (as defined in ACPI 4.0 spec.)
637
///
642
///
638
#define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
643
#define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION  0x01
639
644
640
///
645
///
641
/// Maximum Proximity Domain Information Structure Definition
646
/// Maximum Proximity Domain Information Structure Definition
642
///
647
///
643
typedef struct {
648
typedef struct {
644
  UINT8   Revision;
649
  UINT8     Revision;
645
  UINT8   Length;
650
  UINT8     Length;
646
  UINT32  ProximityDomainRangeLow;
651
  UINT32    ProximityDomainRangeLow;
647
  UINT32  ProximityDomainRangeHigh;
652
  UINT32    ProximityDomainRangeHigh;
648
  UINT32  MaximumProcessorCapacity;
653
  UINT32    MaximumProcessorCapacity;
649
  UINT64  MaximumMemoryCapacity;
654
  UINT64    MaximumMemoryCapacity;
650
} EFI_ACPI_4_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
655
} EFI_ACPI_4_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
651
656
652
///
657
///
653
/// Boot Error Record Table (BERT)
658
/// Boot Error Record Table (BERT)
654
///
659
///
655
typedef struct {
660
typedef struct {
656
  EFI_ACPI_DESCRIPTION_HEADER Header;
661
  EFI_ACPI_DESCRIPTION_HEADER    Header;
657
  UINT32                      BootErrorRegionLength;
662
  UINT32                         BootErrorRegionLength;
658
  UINT64                      BootErrorRegion;
663
  UINT64                         BootErrorRegion;
659
} EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_HEADER;
664
} EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_HEADER;
660
665
661
///
666
///
662
/// BERT Version (as defined in ACPI 4.0 spec.)
667
/// BERT Version (as defined in ACPI 4.0 spec.)
663
///
668
///
664
#define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
669
#define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_REVISION  0x01
665
670
666
///
671
///
667
/// Boot Error Region Block Status Definition
672
/// Boot Error Region Block Status Definition
668
///
673
///
669
typedef struct {
674
typedef struct {
670
  UINT32       UncorrectableErrorValid:1;
675
  UINT32    UncorrectableErrorValid     : 1;
671
  UINT32       CorrectableErrorValid:1;
676
  UINT32    CorrectableErrorValid       : 1;
672
  UINT32       MultipleUncorrectableErrors:1;
677
  UINT32    MultipleUncorrectableErrors : 1;
673
  UINT32       MultipleCorrectableErrors:1;
678
  UINT32    MultipleCorrectableErrors   : 1;
674
  UINT32       ErrorDataEntryCount:10;
679
  UINT32    ErrorDataEntryCount         : 10;
675
  UINT32       Reserved:18;
680
  UINT32    Reserved                    : 18;
676
} EFI_ACPI_4_0_ERROR_BLOCK_STATUS;
681
} EFI_ACPI_4_0_ERROR_BLOCK_STATUS;
677
682
678
///
683
///
679
/// Boot Error Region Definition
684
/// Boot Error Region Definition
680
///
685
///
681
typedef struct {
686
typedef struct {
682
  EFI_ACPI_4_0_ERROR_BLOCK_STATUS              BlockStatus;
687
  EFI_ACPI_4_0_ERROR_BLOCK_STATUS    BlockStatus;
683
  UINT32                                       RawDataOffset;
688
  UINT32                             RawDataOffset;
684
  UINT32                                       RawDataLength;
689
  UINT32                             RawDataLength;
685
  UINT32                                       DataLength;
690
  UINT32                             DataLength;
686
  UINT32                                       ErrorSeverity;
691
  UINT32                             ErrorSeverity;
687
} EFI_ACPI_4_0_BOOT_ERROR_REGION_STRUCTURE;
692
} EFI_ACPI_4_0_BOOT_ERROR_REGION_STRUCTURE;
688
693
689
//
694
//
690
// Boot Error Severity types
695
// Boot Error Severity types
691
//
696
//
692
#define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTABLE  0x00
697
#define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTABLE  0x00
698
#define EFI_ACPI_4_0_ERROR_SEVERITY_RECOVERABLE  0x00
693
#define EFI_ACPI_4_0_ERROR_SEVERITY_FATAL        0x01
699
#define EFI_ACPI_4_0_ERROR_SEVERITY_FATAL        0x01
694
#define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTED    0x02
700
#define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTED    0x02
695
#define EFI_ACPI_4_0_ERROR_SEVERITY_NONE         0x03
701
#define EFI_ACPI_4_0_ERROR_SEVERITY_NONE         0x03
Lines 698-711 typedef struct { Link Here
698
/// Generic Error Data Entry Definition
704
/// Generic Error Data Entry Definition
699
///
705
///
700
typedef struct {
706
typedef struct {
701
  UINT8    SectionType[16];
707
  UINT8     SectionType[16];
702
  UINT32   ErrorSeverity;
708
  UINT32    ErrorSeverity;
703
  UINT16   Revision;
709
  UINT16    Revision;
704
  UINT8    ValidationBits;
710
  UINT8     ValidationBits;
705
  UINT8    Flags;
711
  UINT8     Flags;
706
  UINT32   ErrorDataLength;
712
  UINT32    ErrorDataLength;
707
  UINT8    FruId[16];
713
  UINT8     FruId[16];
708
  UINT8    FruText[20];
714
  UINT8     FruText[20];
709
} EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
715
} EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
710
716
711
///
717
///
Lines 717-730 typedef struct { Link Here
717
/// HEST - Hardware Error Source Table
723
/// HEST - Hardware Error Source Table
718
///
724
///
719
typedef struct {
725
typedef struct {
720
  EFI_ACPI_DESCRIPTION_HEADER Header;
726
  EFI_ACPI_DESCRIPTION_HEADER    Header;
721
  UINT32                      ErrorSourceCount;
727
  UINT32                         ErrorSourceCount;
722
} EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
728
} EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
723
729
724
///
730
///
725
/// HEST Version (as defined in ACPI 4.0 spec.)
731
/// HEST Version (as defined in ACPI 4.0 spec.)
726
///
732
///
727
#define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
733
#define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION  0x01
728
734
729
//
735
//
730
// Error Source structure types.
736
// Error Source structure types.
Lines 740-1122 typedef struct { Link Here
740
//
746
//
741
// Error Source structure flags.
747
// Error Source structure flags.
742
//
748
//
743
#define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST       (1 << 0)
749
#define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST  (1 << 0)
744
#define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_GLOBAL               (1 << 1)
750
#define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_GLOBAL          (1 << 1)
745
751
746
///
752
///
747
/// IA-32 Architecture Machine Check Exception Structure Definition
753
/// IA-32 Architecture Machine Check Exception Structure Definition
748
///
754
///
749
typedef struct {
755
typedef struct {
750
  UINT16  Type;
756
  UINT16    Type;
751
  UINT16  SourceId;
757
  UINT16    SourceId;
752
  UINT8   Reserved0[2];
758
  UINT8     Reserved0[2];
753
  UINT8   Flags;
759
  UINT8     Flags;
754
  UINT8   Enabled;
760
  UINT8     Enabled;
755
  UINT32  NumberOfRecordsToPreAllocate;
761
  UINT32    NumberOfRecordsToPreAllocate;
756
  UINT32  MaxSectionsPerRecord;
762
  UINT32    MaxSectionsPerRecord;
757
  UINT64  GlobalCapabilityInitData;
763
  UINT64    GlobalCapabilityInitData;
758
  UINT64  GlobalControlInitData;
764
  UINT64    GlobalControlInitData;
759
  UINT8   NumberOfHardwareBanks;
765
  UINT8     NumberOfHardwareBanks;
760
  UINT8   Reserved1[7];
766
  UINT8     Reserved1[7];
761
} EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
767
} EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
762
768
763
///
769
///
764
/// IA-32 Architecture Machine Check Bank Structure Definition
770
/// IA-32 Architecture Machine Check Bank Structure Definition
765
///
771
///
766
typedef struct {
772
typedef struct {
767
  UINT8   BankNumber;
773
  UINT8     BankNumber;
768
  UINT8   ClearStatusOnInitialization;
774
  UINT8     ClearStatusOnInitialization;
769
  UINT8   StatusDataFormat;
775
  UINT8     StatusDataFormat;
770
  UINT8   Reserved0;
776
  UINT8     Reserved0;
771
  UINT32  ControlRegisterMsrAddress;
777
  UINT32    ControlRegisterMsrAddress;
772
  UINT64  ControlInitData;
778
  UINT64    ControlInitData;
773
  UINT32  StatusRegisterMsrAddress;
779
  UINT32    StatusRegisterMsrAddress;
774
  UINT32  AddressRegisterMsrAddress;
780
  UINT32    AddressRegisterMsrAddress;
775
  UINT32  MiscRegisterMsrAddress;
781
  UINT32    MiscRegisterMsrAddress;
776
} EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
782
} EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
777
783
778
///
784
///
779
/// IA-32 Architecture Machine Check Bank Structure MCA data format
785
/// IA-32 Architecture Machine Check Bank Structure MCA data format
780
///
786
///
781
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32      0x00
787
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32     0x00
782
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64   0x01
788
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64  0x01
783
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64     0x02
789
#define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64    0x02
784
790
785
//
791
//
786
// Hardware Error Notification types. All other values are reserved
792
// Hardware Error Notification types. All other values are reserved
787
//
793
//
788
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_POLLED                0x00
794
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_POLLED              0x00
789
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT    0x01
795
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT  0x01
790
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT       0x02
796
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT     0x02
791
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_SCI                   0x03
797
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_SCI                 0x03
792
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_NMI                   0x04
798
#define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_NMI                 0x04
793
799
794
///
800
///
795
/// Hardware Error Notification Configuration Write Enable Structure Definition
801
/// Hardware Error Notification Configuration Write Enable Structure Definition
796
///
802
///
797
typedef struct {
803
typedef struct {
798
  UINT16    Type:1;
804
  UINT16    Type                           : 1;
799
  UINT16    PollInterval:1;
805
  UINT16    PollInterval                   : 1;
800
  UINT16    SwitchToPollingThresholdValue:1;
806
  UINT16    SwitchToPollingThresholdValue  : 1;
801
  UINT16    SwitchToPollingThresholdWindow:1;
807
  UINT16    SwitchToPollingThresholdWindow : 1;
802
  UINT16    ErrorThresholdValue:1;
808
  UINT16    ErrorThresholdValue            : 1;
803
  UINT16    ErrorThresholdWindow:1;
809
  UINT16    ErrorThresholdWindow           : 1;
804
  UINT16    Reserved:10;
810
  UINT16    Reserved                       : 10;
805
} EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
811
} EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
806
812
807
///
813
///
808
/// Hardware Error Notification Structure Definition
814
/// Hardware Error Notification Structure Definition
809
///
815
///
810
typedef struct {
816
typedef struct {
811
  UINT8                                                                          Type;
817
  UINT8                                                                            Type;
812
  UINT8                                                                          Length;
818
  UINT8                                                                            Length;
813
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE  ConfigurationWriteEnable;
819
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE    ConfigurationWriteEnable;
814
  UINT32                                                                         PollInterval;
820
  UINT32                                                                           PollInterval;
815
  UINT32                                                                         Vector;
821
  UINT32                                                                           Vector;
816
  UINT32                                                                         SwitchToPollingThresholdValue;
822
  UINT32                                                                           SwitchToPollingThresholdValue;
817
  UINT32                                                                         SwitchToPollingThresholdWindow;
823
  UINT32                                                                           SwitchToPollingThresholdWindow;
818
  UINT32                                                                         ErrorThresholdValue;
824
  UINT32                                                                           ErrorThresholdValue;
819
  UINT32                                                                         ErrorThresholdWindow;
825
  UINT32                                                                           ErrorThresholdWindow;
820
} EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
826
} EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
821
827
822
///
828
///
823
/// IA-32 Architecture Corrected Machine Check Structure Definition
829
/// IA-32 Architecture Corrected Machine Check Structure Definition
824
///
830
///
825
typedef struct {
831
typedef struct {
826
  UINT16                                                 Type;
832
  UINT16                                                Type;
827
  UINT16                                                 SourceId;
833
  UINT16                                                SourceId;
828
  UINT8                                                  Reserved0[2];
834
  UINT8                                                 Reserved0[2];
829
  UINT8                                                  Flags;
835
  UINT8                                                 Flags;
830
  UINT8                                                  Enabled;
836
  UINT8                                                 Enabled;
831
  UINT32                                                 NumberOfRecordsToPreAllocate;
837
  UINT32                                                NumberOfRecordsToPreAllocate;
832
  UINT32                                                 MaxSectionsPerRecord;
838
  UINT32                                                MaxSectionsPerRecord;
833
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
839
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
834
  UINT8                                                  NumberOfHardwareBanks;
840
  UINT8                                                 NumberOfHardwareBanks;
835
  UINT8                                                  Reserved1[3];
841
  UINT8                                                 Reserved1[3];
836
} EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
842
} EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
837
843
838
///
844
///
839
/// IA-32 Architecture NMI Error Structure Definition
845
/// IA-32 Architecture NMI Error Structure Definition
840
///
846
///
841
typedef struct {
847
typedef struct {
842
  UINT16  Type;
848
  UINT16    Type;
843
  UINT16  SourceId;
849
  UINT16    SourceId;
844
  UINT8   Reserved0[2];
850
  UINT8     Reserved0[2];
845
  UINT32  NumberOfRecordsToPreAllocate;
851
  UINT32    NumberOfRecordsToPreAllocate;
846
  UINT32  MaxSectionsPerRecord;
852
  UINT32    MaxSectionsPerRecord;
847
  UINT32  MaxRawDataLength;
853
  UINT32    MaxRawDataLength;
848
} EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
854
} EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
849
855
850
///
856
///
851
/// PCI Express Root Port AER Structure Definition
857
/// PCI Express Root Port AER Structure Definition
852
///
858
///
853
typedef struct {
859
typedef struct {
854
  UINT16  Type;
860
  UINT16    Type;
855
  UINT16  SourceId;
861
  UINT16    SourceId;
856
  UINT8   Reserved0[2];
862
  UINT8     Reserved0[2];
857
  UINT8   Flags;
863
  UINT8     Flags;
858
  UINT8   Enabled;
864
  UINT8     Enabled;
859
  UINT32  NumberOfRecordsToPreAllocate;
865
  UINT32    NumberOfRecordsToPreAllocate;
860
  UINT32  MaxSectionsPerRecord;
866
  UINT32    MaxSectionsPerRecord;
861
  UINT32  Bus;
867
  UINT32    Bus;
862
  UINT16  Device;
868
  UINT16    Device;
863
  UINT16  Function;
869
  UINT16    Function;
864
  UINT16  DeviceControl;
870
  UINT16    DeviceControl;
865
  UINT8   Reserved1[2];
871
  UINT8     Reserved1[2];
866
  UINT32  UncorrectableErrorMask;
872
  UINT32    UncorrectableErrorMask;
867
  UINT32  UncorrectableErrorSeverity;
873
  UINT32    UncorrectableErrorSeverity;
868
  UINT32  CorrectableErrorMask;
874
  UINT32    CorrectableErrorMask;
869
  UINT32  AdvancedErrorCapabilitiesAndControl;
875
  UINT32    AdvancedErrorCapabilitiesAndControl;
870
  UINT32  RootErrorCommand;
876
  UINT32    RootErrorCommand;
871
} EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
877
} EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
872
878
873
///
879
///
874
/// PCI Express Device AER Structure Definition
880
/// PCI Express Device AER Structure Definition
875
///
881
///
876
typedef struct {
882
typedef struct {
877
  UINT16  Type;
883
  UINT16    Type;
878
  UINT16  SourceId;
884
  UINT16    SourceId;
879
  UINT8   Reserved0[2];
885
  UINT8     Reserved0[2];
880
  UINT8   Flags;
886
  UINT8     Flags;
881
  UINT8   Enabled;
887
  UINT8     Enabled;
882
  UINT32  NumberOfRecordsToPreAllocate;
888
  UINT32    NumberOfRecordsToPreAllocate;
883
  UINT32  MaxSectionsPerRecord;
889
  UINT32    MaxSectionsPerRecord;
884
  UINT32  Bus;
890
  UINT32    Bus;
885
  UINT16  Device;
891
  UINT16    Device;
886
  UINT16  Function;
892
  UINT16    Function;
887
  UINT16  DeviceControl;
893
  UINT16    DeviceControl;
888
  UINT8   Reserved1[2];
894
  UINT8     Reserved1[2];
889
  UINT32  UncorrectableErrorMask;
895
  UINT32    UncorrectableErrorMask;
890
  UINT32  UncorrectableErrorSeverity;
896
  UINT32    UncorrectableErrorSeverity;
891
  UINT32  CorrectableErrorMask;
897
  UINT32    CorrectableErrorMask;
892
  UINT32  AdvancedErrorCapabilitiesAndControl;
898
  UINT32    AdvancedErrorCapabilitiesAndControl;
893
} EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
899
} EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
894
900
895
///
901
///
896
/// PCI Express Bridge AER Structure Definition
902
/// PCI Express Bridge AER Structure Definition
897
///
903
///
898
typedef struct {
904
typedef struct {
899
  UINT16  Type;
905
  UINT16    Type;
900
  UINT16  SourceId;
906
  UINT16    SourceId;
901
  UINT8   Reserved0[2];
907
  UINT8     Reserved0[2];
902
  UINT8   Flags;
908
  UINT8     Flags;
903
  UINT8   Enabled;
909
  UINT8     Enabled;
904
  UINT32  NumberOfRecordsToPreAllocate;
910
  UINT32    NumberOfRecordsToPreAllocate;
905
  UINT32  MaxSectionsPerRecord;
911
  UINT32    MaxSectionsPerRecord;
906
  UINT32  Bus;
912
  UINT32    Bus;
907
  UINT16  Device;
913
  UINT16    Device;
908
  UINT16  Function;
914
  UINT16    Function;
909
  UINT16  DeviceControl;
915
  UINT16    DeviceControl;
910
  UINT8   Reserved1[2];
916
  UINT8     Reserved1[2];
911
  UINT32  UncorrectableErrorMask;
917
  UINT32    UncorrectableErrorMask;
912
  UINT32  UncorrectableErrorSeverity;
918
  UINT32    UncorrectableErrorSeverity;
913
  UINT32  CorrectableErrorMask;
919
  UINT32    CorrectableErrorMask;
914
  UINT32  AdvancedErrorCapabilitiesAndControl;
920
  UINT32    AdvancedErrorCapabilitiesAndControl;
915
  UINT32  SecondaryUncorrectableErrorMask;
921
  UINT32    SecondaryUncorrectableErrorMask;
916
  UINT32  SecondaryUncorrectableErrorSeverity;
922
  UINT32    SecondaryUncorrectableErrorSeverity;
917
  UINT32  SecondaryAdvancedErrorCapabilitiesAndControl;
923
  UINT32    SecondaryAdvancedErrorCapabilitiesAndControl;
918
} EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
924
} EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
919
925
920
///
926
///
921
/// Generic Hardware Error Source Structure Definition
927
/// Generic Hardware Error Source Structure Definition
922
///
928
///
923
typedef struct {
929
typedef struct {
924
  UINT16                                                 Type;
930
  UINT16                                                Type;
925
  UINT16                                                 SourceId;
931
  UINT16                                                SourceId;
926
  UINT16                                                 RelatedSourceId;
932
  UINT16                                                RelatedSourceId;
927
  UINT8                                                  Flags;
933
  UINT8                                                 Flags;
928
  UINT8                                                  Enabled;
934
  UINT8                                                 Enabled;
929
  UINT32                                                 NumberOfRecordsToPreAllocate;
935
  UINT32                                                NumberOfRecordsToPreAllocate;
930
  UINT32                                                 MaxSectionsPerRecord;
936
  UINT32                                                MaxSectionsPerRecord;
931
  UINT32                                                 MaxRawDataLength;
937
  UINT32                                                MaxRawDataLength;
932
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE                 ErrorStatusAddress;
938
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE                ErrorStatusAddress;
933
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
939
  EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
934
  UINT32                                                 ErrorStatusBlockLength;
940
  UINT32                                                ErrorStatusBlockLength;
935
} EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
941
} EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
936
942
937
///
943
///
938
/// Generic Error Status Definition
944
/// Generic Error Status Definition
939
///
945
///
940
typedef struct {
946
typedef struct {
941
  EFI_ACPI_4_0_ERROR_BLOCK_STATUS              BlockStatus;
947
  EFI_ACPI_4_0_ERROR_BLOCK_STATUS    BlockStatus;
942
  UINT32                                       RawDataOffset;
948
  UINT32                             RawDataOffset;
943
  UINT32                                       RawDataLength;
949
  UINT32                             RawDataLength;
944
  UINT32                                       DataLength;
950
  UINT32                             DataLength;
945
  UINT32                                       ErrorSeverity;
951
  UINT32                             ErrorSeverity;
946
} EFI_ACPI_4_0_GENERIC_ERROR_STATUS_STRUCTURE;
952
} EFI_ACPI_4_0_GENERIC_ERROR_STATUS_STRUCTURE;
947
953
948
///
954
///
949
/// ERST - Error Record Serialization Table
955
/// ERST - Error Record Serialization Table
950
///
956
///
951
typedef struct {
957
typedef struct {
952
  EFI_ACPI_DESCRIPTION_HEADER Header;
958
  EFI_ACPI_DESCRIPTION_HEADER    Header;
953
  UINT32                      SerializationHeaderSize;
959
  UINT32                         SerializationHeaderSize;
954
  UINT8                       Reserved0[4];
960
  UINT8                          Reserved0[4];
955
  UINT32                      InstructionEntryCount;
961
  UINT32                         InstructionEntryCount;
956
} EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
962
} EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
957
963
958
///
964
///
959
/// ERST Version (as defined in ACPI 4.0 spec.)
965
/// ERST Version (as defined in ACPI 4.0 spec.)
960
///
966
///
961
#define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
967
#define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION  0x01
962
968
963
///
969
///
964
/// ERST Serialization Actions
970
/// ERST Serialization Actions
965
///
971
///
966
#define EFI_ACPI_4_0_ERST_BEGIN_WRITE_OPERATION                    0x00
972
#define EFI_ACPI_4_0_ERST_BEGIN_WRITE_OPERATION                   0x00
967
#define EFI_ACPI_4_0_ERST_BEGIN_READ_OPERATION                     0x01
973
#define EFI_ACPI_4_0_ERST_BEGIN_READ_OPERATION                    0x01
968
#define EFI_ACPI_4_0_ERST_BEGIN_CLEAR_OPERATION                    0x02
974
#define EFI_ACPI_4_0_ERST_BEGIN_CLEAR_OPERATION                   0x02
969
#define EFI_ACPI_4_0_ERST_END_OPERATION                            0x03
975
#define EFI_ACPI_4_0_ERST_END_OPERATION                           0x03
970
#define EFI_ACPI_4_0_ERST_SET_RECORD_OFFSET                        0x04
976
#define EFI_ACPI_4_0_ERST_SET_RECORD_OFFSET                       0x04
971
#define EFI_ACPI_4_0_ERST_EXECUTE_OPERATION                        0x05
977
#define EFI_ACPI_4_0_ERST_EXECUTE_OPERATION                       0x05
972
#define EFI_ACPI_4_0_ERST_CHECK_BUSY_STATUS                        0x06
978
#define EFI_ACPI_4_0_ERST_CHECK_BUSY_STATUS                       0x06
973
#define EFI_ACPI_4_0_ERST_GET_COMMAND_STATUS                       0x07
979
#define EFI_ACPI_4_0_ERST_GET_COMMAND_STATUS                      0x07
974
#define EFI_ACPI_4_0_ERST_GET_RECORD_IDENTIFIER                    0x08
980
#define EFI_ACPI_4_0_ERST_GET_RECORD_IDENTIFIER                   0x08
975
#define EFI_ACPI_4_0_ERST_SET_RECORD_IDENTIFIER                    0x09
981
#define EFI_ACPI_4_0_ERST_SET_RECORD_IDENTIFIER                   0x09
976
#define EFI_ACPI_4_0_ERST_GET_RECORD_COUNT                         0x0A
982
#define EFI_ACPI_4_0_ERST_GET_RECORD_COUNT                        0x0A
977
#define EFI_ACPI_4_0_ERST_BEGIN_DUMMY_WRITE_OPERATION              0x0B
983
#define EFI_ACPI_4_0_ERST_BEGIN_DUMMY_WRITE_OPERATION             0x0B
978
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE              0x0D
984
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE             0x0D
979
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH       0x0E
985
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH      0x0E
980
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES   0x0F
986
#define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES  0x0F
981
987
982
///
988
///
983
/// ERST Action Command Status
989
/// ERST Action Command Status
984
///
990
///
985
#define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS                           0x00
991
#define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS                 0x00
986
#define EFI_ACPI_4_0_EINJ_STATUS_NOT_ENOUGH_SPACE                  0x01
992
#define EFI_ACPI_4_0_EINJ_STATUS_NOT_ENOUGH_SPACE        0x01
987
#define EFI_ACPI_4_0_EINJ_STATUS_HARDWARE_NOT_AVAILABLE            0x02
993
#define EFI_ACPI_4_0_EINJ_STATUS_HARDWARE_NOT_AVAILABLE  0x02
988
#define EFI_ACPI_4_0_EINJ_STATUS_FAILED                            0x03
994
#define EFI_ACPI_4_0_EINJ_STATUS_FAILED                  0x03
989
#define EFI_ACPI_4_0_EINJ_STATUS_RECORD_STORE_EMPTY                0x04
995
#define EFI_ACPI_4_0_EINJ_STATUS_RECORD_STORE_EMPTY      0x04
990
#define EFI_ACPI_4_0_EINJ_STATUS_RECORD_NOT_FOUND                  0x05
996
#define EFI_ACPI_4_0_EINJ_STATUS_RECORD_NOT_FOUND        0x05
991
997
992
///
998
///
993
/// ERST Serialization Instructions
999
/// ERST Serialization Instructions
994
///
1000
///
995
#define EFI_ACPI_4_0_ERST_READ_REGISTER                            0x00
1001
#define EFI_ACPI_4_0_ERST_READ_REGISTER                  0x00
996
#define EFI_ACPI_4_0_ERST_READ_REGISTER_VALUE                      0x01
1002
#define EFI_ACPI_4_0_ERST_READ_REGISTER_VALUE            0x01
997
#define EFI_ACPI_4_0_ERST_WRITE_REGISTER                           0x02
1003
#define EFI_ACPI_4_0_ERST_WRITE_REGISTER                 0x02
998
#define EFI_ACPI_4_0_ERST_WRITE_REGISTER_VALUE                     0x03
1004
#define EFI_ACPI_4_0_ERST_WRITE_REGISTER_VALUE           0x03
999
#define EFI_ACPI_4_0_ERST_NOOP                                     0x04
1005
#define EFI_ACPI_4_0_ERST_NOOP                           0x04
1000
#define EFI_ACPI_4_0_ERST_LOAD_VAR1                                0x05
1006
#define EFI_ACPI_4_0_ERST_LOAD_VAR1                      0x05
1001
#define EFI_ACPI_4_0_ERST_LOAD_VAR2                                0x06
1007
#define EFI_ACPI_4_0_ERST_LOAD_VAR2                      0x06
1002
#define EFI_ACPI_4_0_ERST_STORE_VAR1                               0x07
1008
#define EFI_ACPI_4_0_ERST_STORE_VAR1                     0x07
1003
#define EFI_ACPI_4_0_ERST_ADD                                      0x08
1009
#define EFI_ACPI_4_0_ERST_ADD                            0x08
1004
#define EFI_ACPI_4_0_ERST_SUBTRACT                                 0x09
1010
#define EFI_ACPI_4_0_ERST_SUBTRACT                       0x09
1005
#define EFI_ACPI_4_0_ERST_ADD_VALUE                                0x0A
1011
#define EFI_ACPI_4_0_ERST_ADD_VALUE                      0x0A
1006
#define EFI_ACPI_4_0_ERST_SUBTRACT_VALUE                           0x0B
1012
#define EFI_ACPI_4_0_ERST_SUBTRACT_VALUE                 0x0B
1007
#define EFI_ACPI_4_0_ERST_STALL                                    0x0C
1013
#define EFI_ACPI_4_0_ERST_STALL                          0x0C
1008
#define EFI_ACPI_4_0_ERST_STALL_WHILE_TRUE                         0x0D
1014
#define EFI_ACPI_4_0_ERST_STALL_WHILE_TRUE               0x0D
1009
#define EFI_ACPI_4_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE            0x0E
1015
#define EFI_ACPI_4_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE  0x0E
1010
#define EFI_ACPI_4_0_ERST_GOTO                                     0x0F
1016
#define EFI_ACPI_4_0_ERST_GOTO                           0x0F
1011
#define EFI_ACPI_4_0_ERST_SET_SRC_ADDRESS_BASE                     0x10
1017
#define EFI_ACPI_4_0_ERST_SET_SRC_ADDRESS_BASE           0x10
1012
#define EFI_ACPI_4_0_ERST_SET_DST_ADDRESS_BASE                     0x11
1018
#define EFI_ACPI_4_0_ERST_SET_DST_ADDRESS_BASE           0x11
1013
#define EFI_ACPI_4_0_ERST_MOVE_DATA                                0x12
1019
#define EFI_ACPI_4_0_ERST_MOVE_DATA                      0x12
1014
1020
1015
///
1021
///
1016
/// ERST Instruction Flags
1022
/// ERST Instruction Flags
1017
///
1023
///
1018
#define EFI_ACPI_4_0_ERST_PRESERVE_REGISTER                        0x01
1024
#define EFI_ACPI_4_0_ERST_PRESERVE_REGISTER  0x01
1019
1025
1020
///
1026
///
1021
/// ERST Serialization Instruction Entry
1027
/// ERST Serialization Instruction Entry
1022
///
1028
///
1023
typedef struct {
1029
typedef struct {
1024
  UINT8                                    SerializationAction;
1030
  UINT8                                     SerializationAction;
1025
  UINT8                                    Instruction;
1031
  UINT8                                     Instruction;
1026
  UINT8                                    Flags;
1032
  UINT8                                     Flags;
1027
  UINT8                                    Reserved0;
1033
  UINT8                                     Reserved0;
1028
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1034
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1029
  UINT64                                   Value;
1035
  UINT64                                    Value;
1030
  UINT64                                   Mask;
1036
  UINT64                                    Mask;
1031
} EFI_ACPI_4_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1037
} EFI_ACPI_4_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1032
1038
1033
///
1039
///
1034
/// EINJ - Error Injection Table
1040
/// EINJ - Error Injection Table
1035
///
1041
///
1036
typedef struct {
1042
typedef struct {
1037
  EFI_ACPI_DESCRIPTION_HEADER Header;
1043
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1038
  UINT32                      InjectionHeaderSize;
1044
  UINT32                         InjectionHeaderSize;
1039
  UINT8                       InjectionFlags;
1045
  UINT8                          InjectionFlags;
1040
  UINT8                       Reserved0[3];
1046
  UINT8                          Reserved0[3];
1041
  UINT32                      InjectionEntryCount;
1047
  UINT32                         InjectionEntryCount;
1042
} EFI_ACPI_4_0_ERROR_INJECTION_TABLE_HEADER;
1048
} EFI_ACPI_4_0_ERROR_INJECTION_TABLE_HEADER;
1043
1049
1044
///
1050
///
1045
/// EINJ Version (as defined in ACPI 4.0 spec.)
1051
/// EINJ Version (as defined in ACPI 4.0 spec.)
1046
///
1052
///
1047
#define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_REVISION 0x01
1053
#define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_REVISION  0x01
1048
1054
1049
///
1055
///
1050
/// EINJ Error Injection Actions
1056
/// EINJ Error Injection Actions
1051
///
1057
///
1052
#define EFI_ACPI_4_0_EINJ_BEGIN_INJECTION_OPERATION                0x00
1058
#define EFI_ACPI_4_0_EINJ_BEGIN_INJECTION_OPERATION       0x00
1053
#define EFI_ACPI_4_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE           0x01
1059
#define EFI_ACPI_4_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE  0x01
1054
#define EFI_ACPI_4_0_EINJ_SET_ERROR_TYPE                           0x02
1060
#define EFI_ACPI_4_0_EINJ_SET_ERROR_TYPE                  0x02
1055
#define EFI_ACPI_4_0_EINJ_GET_ERROR_TYPE                           0x03
1061
#define EFI_ACPI_4_0_EINJ_GET_ERROR_TYPE                  0x03
1056
#define EFI_ACPI_4_0_EINJ_END_OPERATION                            0x04
1062
#define EFI_ACPI_4_0_EINJ_END_OPERATION                   0x04
1057
#define EFI_ACPI_4_0_EINJ_EXECUTE_OPERATION                        0x05
1063
#define EFI_ACPI_4_0_EINJ_EXECUTE_OPERATION               0x05
1058
#define EFI_ACPI_4_0_EINJ_CHECK_BUSY_STATUS                        0x06
1064
#define EFI_ACPI_4_0_EINJ_CHECK_BUSY_STATUS               0x06
1059
#define EFI_ACPI_4_0_EINJ_GET_COMMAND_STATUS                       0x07
1065
#define EFI_ACPI_4_0_EINJ_GET_COMMAND_STATUS              0x07
1060
#define EFI_ACPI_4_0_EINJ_TRIGGER_ERROR                            0xFF
1066
#define EFI_ACPI_4_0_EINJ_TRIGGER_ERROR                   0xFF
1061
1067
1062
///
1068
///
1063
/// EINJ Action Command Status
1069
/// EINJ Action Command Status
1064
///
1070
///
1065
#define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS                           0x00
1071
#define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS          0x00
1066
#define EFI_ACPI_4_0_EINJ_STATUS_UNKNOWN_FAILURE                   0x01
1072
#define EFI_ACPI_4_0_EINJ_STATUS_UNKNOWN_FAILURE  0x01
1067
#define EFI_ACPI_4_0_EINJ_STATUS_INVALID_ACCESS                    0x02
1073
#define EFI_ACPI_4_0_EINJ_STATUS_INVALID_ACCESS   0x02
1068
1074
1069
///
1075
///
1070
/// EINJ Error Type Definition
1076
/// EINJ Error Type Definition
1071
///
1077
///
1072
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_CORRECTABLE                 (1 << 0)
1078
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_CORRECTABLE               (1 << 0)
1073
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL      (1 << 1)
1079
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL    (1 << 1)
1074
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL         (1 << 2)
1080
#define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL       (1 << 2)
1075
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_CORRECTABLE                    (1 << 3)
1081
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_CORRECTABLE                  (1 << 3)
1076
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL         (1 << 4)
1082
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL       (1 << 4)
1077
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL            (1 << 5)
1083
#define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL          (1 << 5)
1078
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE               (1 << 6)
1084
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE             (1 << 6)
1079
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL    (1 << 7)
1085
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL  (1 << 7)
1080
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL       (1 << 8)
1086
#define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL     (1 << 8)
1081
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_CORRECTABLE                  (1 << 9)
1087
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_CORRECTABLE                (1 << 9)
1082
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL       (1 << 10)
1088
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL     (1 << 10)
1083
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL          (1 << 11)
1089
#define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL        (1 << 11)
1084
1090
1085
///
1091
///
1086
/// EINJ Injection Instructions
1092
/// EINJ Injection Instructions
1087
///
1093
///
1088
#define EFI_ACPI_4_0_EINJ_READ_REGISTER                            0x00
1094
#define EFI_ACPI_4_0_EINJ_READ_REGISTER         0x00
1089
#define EFI_ACPI_4_0_EINJ_READ_REGISTER_VALUE                      0x01
1095
#define EFI_ACPI_4_0_EINJ_READ_REGISTER_VALUE   0x01
1090
#define EFI_ACPI_4_0_EINJ_WRITE_REGISTER                           0x02
1096
#define EFI_ACPI_4_0_EINJ_WRITE_REGISTER        0x02
1091
#define EFI_ACPI_4_0_EINJ_WRITE_REGISTER_VALUE                     0x03
1097
#define EFI_ACPI_4_0_EINJ_WRITE_REGISTER_VALUE  0x03
1092
#define EFI_ACPI_4_0_EINJ_NOOP                                     0x04
1098
#define EFI_ACPI_4_0_EINJ_NOOP                  0x04
1093
1099
1094
///
1100
///
1095
/// EINJ Instruction Flags
1101
/// EINJ Instruction Flags
1096
///
1102
///
1097
#define EFI_ACPI_4_0_EINJ_PRESERVE_REGISTER                        0x01
1103
#define EFI_ACPI_4_0_EINJ_PRESERVE_REGISTER  0x01
1098
1104
1099
///
1105
///
1100
/// EINJ Injection Instruction Entry
1106
/// EINJ Injection Instruction Entry
1101
///
1107
///
1102
typedef struct {
1108
typedef struct {
1103
  UINT8                                    InjectionAction;
1109
  UINT8                                     InjectionAction;
1104
  UINT8                                    Instruction;
1110
  UINT8                                     Instruction;
1105
  UINT8                                    Flags;
1111
  UINT8                                     Flags;
1106
  UINT8                                    Reserved0;
1112
  UINT8                                     Reserved0;
1107
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1113
  EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1108
  UINT64                                   Value;
1114
  UINT64                                    Value;
1109
  UINT64                                   Mask;
1115
  UINT64                                    Mask;
1110
} EFI_ACPI_4_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1116
} EFI_ACPI_4_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1111
1117
1112
///
1118
///
1113
/// EINJ Trigger Action Table
1119
/// EINJ Trigger Action Table
1114
///
1120
///
1115
typedef struct {
1121
typedef struct {
1116
  UINT32  HeaderSize;
1122
  UINT32    HeaderSize;
1117
  UINT32  Revision;
1123
  UINT32    Revision;
1118
  UINT32  TableSize;
1124
  UINT32    TableSize;
1119
  UINT32  EntryCount;
1125
  UINT32    EntryCount;
1120
} EFI_ACPI_4_0_EINJ_TRIGGER_ACTION_TABLE;
1126
} EFI_ACPI_4_0_EINJ_TRIGGER_ACTION_TABLE;
1121
1127
1122
//
1128
//
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi50.h (-753 / +764 lines)
Lines 2-8 Link Here
2
  ACPI 5.0 definitions from the ACPI Specification Revision 5.0a November 13, 2013.
2
  ACPI 5.0 definitions from the ACPI Specification Revision 5.0a November 13, 2013.
3
3
4
  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
4
  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
5
  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5
  Copyright (c) 2011 - 2022, Intel Corporation. All rights reserved.<BR>
6
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
6
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
7
  SPDX-License-Identifier: BSD-2-Clause-Patent
7
  SPDX-License-Identifier: BSD-2-Clause-Patent
8
**/
8
**/
Lines 15-27 Link Here
15
//
15
//
16
// Define for Descriptor
16
// Define for Descriptor
17
//
17
//
18
#define ACPI_SMALL_FIXED_DMA_DESCRIPTOR_NAME                         0x0A
18
#define ACPI_SMALL_FIXED_DMA_DESCRIPTOR_NAME                      0x0A
19
#define ACPI_LARGE_GPIO_CONNECTION_DESCRIPTOR_NAME                   0x0C
19
#define ACPI_LARGE_GPIO_CONNECTION_DESCRIPTOR_NAME                0x0C
20
#define ACPI_LARGE_GENERIC_SERIAL_BUS_CONNECTION_DESCRIPTOR_NAME     0x0E
20
#define ACPI_LARGE_GENERIC_SERIAL_BUS_CONNECTION_DESCRIPTOR_NAME  0x0E
21
21
22
#define ACPI_FIXED_DMA_DESCRIPTOR                         0x55
22
#define ACPI_FIXED_DMA_DESCRIPTOR                      0x55
23
#define ACPI_GPIO_CONNECTION_DESCRIPTOR                   0x8C
23
#define ACPI_GPIO_CONNECTION_DESCRIPTOR                0x8C
24
#define ACPI_GENERIC_SERIAL_BUS_CONNECTION_DESCRIPTOR     0x8E
24
#define ACPI_GENERIC_SERIAL_BUS_CONNECTION_DESCRIPTOR  0x8E
25
26
///
27
/// _PSD Revision for ACPI 5.0
28
///
29
#define EFI_ACPI_5_0_AML_PSD_REVISION  0
30
31
///
32
/// _CPC Revision for ACPI 5.0
33
///
34
#define EFI_ACPI_5_0_AML_CPC_REVISION  1
25
35
26
#pragma pack(1)
36
#pragma pack(1)
27
37
Lines 29-38 Link Here
29
/// Generic DMA Descriptor.
39
/// Generic DMA Descriptor.
30
///
40
///
31
typedef PACKED struct {
41
typedef PACKED struct {
32
  ACPI_SMALL_RESOURCE_HEADER   Header;
42
  ACPI_SMALL_RESOURCE_HEADER    Header;
33
  UINT16                       DmaRequestLine;
43
  UINT16                        DmaRequestLine;
34
  UINT16                       DmaChannel;
44
  UINT16                        DmaChannel;
35
  UINT8                        DmaTransferWidth;
45
  UINT8                         DmaTransferWidth;
36
} EFI_ACPI_FIXED_DMA_DESCRIPTOR;
46
} EFI_ACPI_FIXED_DMA_DESCRIPTOR;
37
47
38
///
48
///
Lines 54-61 typedef PACKED struct { Link Here
54
  UINT16                        VendorDataLength;
64
  UINT16                        VendorDataLength;
55
} EFI_ACPI_GPIO_CONNECTION_DESCRIPTOR;
65
} EFI_ACPI_GPIO_CONNECTION_DESCRIPTOR;
56
66
57
#define EFI_ACPI_GPIO_CONNECTION_TYPE_INTERRUPT   0x0
67
#define EFI_ACPI_GPIO_CONNECTION_TYPE_INTERRUPT  0x0
58
#define EFI_ACPI_GPIO_CONNECTION_TYPE_IO          0x1
68
#define EFI_ACPI_GPIO_CONNECTION_TYPE_IO         0x1
59
69
60
///
70
///
61
/// Serial Bus Resource Descriptor (Generic)
71
/// Serial Bus Resource Descriptor (Generic)
Lines 69-75 typedef PACKED struct { Link Here
69
  UINT16                        TypeSpecificFlags;
79
  UINT16                        TypeSpecificFlags;
70
  UINT8                         TypeSpecificRevisionId;
80
  UINT8                         TypeSpecificRevisionId;
71
  UINT16                        TypeDataLength;
81
  UINT16                        TypeDataLength;
72
// Type specific data
82
  // Type specific data
73
} EFI_ACPI_SERIAL_BUS_RESOURCE_DESCRIPTOR;
83
} EFI_ACPI_SERIAL_BUS_RESOURCE_DESCRIPTOR;
74
84
75
#define EFI_ACPI_SERIAL_BUS_RESOURCE_TYPE_I2C   0x1
85
#define EFI_ACPI_SERIAL_BUS_RESOURCE_TYPE_I2C   0x1
Lines 141-161 typedef PACKED struct { Link Here
141
/// ACPI 5.0 Generic Address Space definition
151
/// ACPI 5.0 Generic Address Space definition
142
///
152
///
143
typedef struct {
153
typedef struct {
144
  UINT8   AddressSpaceId;
154
  UINT8     AddressSpaceId;
145
  UINT8   RegisterBitWidth;
155
  UINT8     RegisterBitWidth;
146
  UINT8   RegisterBitOffset;
156
  UINT8     RegisterBitOffset;
147
  UINT8   AccessSize;
157
  UINT8     AccessSize;
148
  UINT64  Address;
158
  UINT64    Address;
149
} EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE;
159
} EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE;
150
160
151
//
161
//
152
// Generic Address Space Address IDs
162
// Generic Address Space Address IDs
153
//
163
//
154
#define EFI_ACPI_5_0_SYSTEM_MEMORY              0
164
#define EFI_ACPI_5_0_SYSTEM_MEMORY                   0
155
#define EFI_ACPI_5_0_SYSTEM_IO                  1
165
#define EFI_ACPI_5_0_SYSTEM_IO                       1
156
#define EFI_ACPI_5_0_PCI_CONFIGURATION_SPACE    2
166
#define EFI_ACPI_5_0_PCI_CONFIGURATION_SPACE         2
157
#define EFI_ACPI_5_0_EMBEDDED_CONTROLLER        3
167
#define EFI_ACPI_5_0_EMBEDDED_CONTROLLER             3
158
#define EFI_ACPI_5_0_SMBUS                      4
168
#define EFI_ACPI_5_0_SMBUS                           4
159
#define EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL  0x0A
169
#define EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL  0x0A
160
#define EFI_ACPI_5_0_FUNCTIONAL_FIXED_HARDWARE       0x7F
170
#define EFI_ACPI_5_0_FUNCTIONAL_FIXED_HARDWARE       0x7F
161
171
Lines 176-204 typedef struct { Link Here
176
/// Root System Description Pointer Structure
186
/// Root System Description Pointer Structure
177
///
187
///
178
typedef struct {
188
typedef struct {
179
  UINT64  Signature;
189
  UINT64    Signature;
180
  UINT8   Checksum;
190
  UINT8     Checksum;
181
  UINT8   OemId[6];
191
  UINT8     OemId[6];
182
  UINT8   Revision;
192
  UINT8     Revision;
183
  UINT32  RsdtAddress;
193
  UINT32    RsdtAddress;
184
  UINT32  Length;
194
  UINT32    Length;
185
  UINT64  XsdtAddress;
195
  UINT64    XsdtAddress;
186
  UINT8   ExtendedChecksum;
196
  UINT8     ExtendedChecksum;
187
  UINT8   Reserved[3];
197
  UINT8     Reserved[3];
188
} EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
198
} EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
189
199
190
///
200
///
191
/// RSD_PTR Revision (as defined in ACPI 5.0 spec.)
201
/// RSD_PTR Revision (as defined in ACPI 5.0 spec.)
192
///
202
///
193
#define EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 5.0) says current value is 2
203
#define EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02 ///< ACPISpec (Revision 5.0) says current value is 2
194
204
195
///
205
///
196
/// Common table header, this prefaces all ACPI tables, including FACS, but
206
/// Common table header, this prefaces all ACPI tables, including FACS, but
197
/// excluding the RSD PTR structure
207
/// excluding the RSD PTR structure
198
///
208
///
199
typedef struct {
209
typedef struct {
200
  UINT32  Signature;
210
  UINT32    Signature;
201
  UINT32  Length;
211
  UINT32    Length;
202
} EFI_ACPI_5_0_COMMON_HEADER;
212
} EFI_ACPI_5_0_COMMON_HEADER;
203
213
204
//
214
//
Lines 210-216 typedef struct { Link Here
210
///
220
///
211
/// RSDT Revision (as defined in ACPI 5.0 spec.)
221
/// RSDT Revision (as defined in ACPI 5.0 spec.)
212
///
222
///
213
#define EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
223
#define EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
214
224
215
//
225
//
216
// Extended System Description Table
226
// Extended System Description Table
Lines 221-286 typedef struct { Link Here
221
///
231
///
222
/// XSDT Revision (as defined in ACPI 5.0 spec.)
232
/// XSDT Revision (as defined in ACPI 5.0 spec.)
223
///
233
///
224
#define EFI_ACPI_5_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
234
#define EFI_ACPI_5_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
225
235
226
///
236
///
227
/// Fixed ACPI Description Table Structure (FADT)
237
/// Fixed ACPI Description Table Structure (FADT)
228
///
238
///
229
typedef struct {
239
typedef struct {
230
  EFI_ACPI_DESCRIPTION_HEADER             Header;
240
  EFI_ACPI_DESCRIPTION_HEADER               Header;
231
  UINT32                                  FirmwareCtrl;
241
  UINT32                                    FirmwareCtrl;
232
  UINT32                                  Dsdt;
242
  UINT32                                    Dsdt;
233
  UINT8                                   Reserved0;
243
  UINT8                                     Reserved0;
234
  UINT8                                   PreferredPmProfile;
244
  UINT8                                     PreferredPmProfile;
235
  UINT16                                  SciInt;
245
  UINT16                                    SciInt;
236
  UINT32                                  SmiCmd;
246
  UINT32                                    SmiCmd;
237
  UINT8                                   AcpiEnable;
247
  UINT8                                     AcpiEnable;
238
  UINT8                                   AcpiDisable;
248
  UINT8                                     AcpiDisable;
239
  UINT8                                   S4BiosReq;
249
  UINT8                                     S4BiosReq;
240
  UINT8                                   PstateCnt;
250
  UINT8                                     PstateCnt;
241
  UINT32                                  Pm1aEvtBlk;
251
  UINT32                                    Pm1aEvtBlk;
242
  UINT32                                  Pm1bEvtBlk;
252
  UINT32                                    Pm1bEvtBlk;
243
  UINT32                                  Pm1aCntBlk;
253
  UINT32                                    Pm1aCntBlk;
244
  UINT32                                  Pm1bCntBlk;
254
  UINT32                                    Pm1bCntBlk;
245
  UINT32                                  Pm2CntBlk;
255
  UINT32                                    Pm2CntBlk;
246
  UINT32                                  PmTmrBlk;
256
  UINT32                                    PmTmrBlk;
247
  UINT32                                  Gpe0Blk;
257
  UINT32                                    Gpe0Blk;
248
  UINT32                                  Gpe1Blk;
258
  UINT32                                    Gpe1Blk;
249
  UINT8                                   Pm1EvtLen;
259
  UINT8                                     Pm1EvtLen;
250
  UINT8                                   Pm1CntLen;
260
  UINT8                                     Pm1CntLen;
251
  UINT8                                   Pm2CntLen;
261
  UINT8                                     Pm2CntLen;
252
  UINT8                                   PmTmrLen;
262
  UINT8                                     PmTmrLen;
253
  UINT8                                   Gpe0BlkLen;
263
  UINT8                                     Gpe0BlkLen;
254
  UINT8                                   Gpe1BlkLen;
264
  UINT8                                     Gpe1BlkLen;
255
  UINT8                                   Gpe1Base;
265
  UINT8                                     Gpe1Base;
256
  UINT8                                   CstCnt;
266
  UINT8                                     CstCnt;
257
  UINT16                                  PLvl2Lat;
267
  UINT16                                    PLvl2Lat;
258
  UINT16                                  PLvl3Lat;
268
  UINT16                                    PLvl3Lat;
259
  UINT16                                  FlushSize;
269
  UINT16                                    FlushSize;
260
  UINT16                                  FlushStride;
270
  UINT16                                    FlushStride;
261
  UINT8                                   DutyOffset;
271
  UINT8                                     DutyOffset;
262
  UINT8                                   DutyWidth;
272
  UINT8                                     DutyWidth;
263
  UINT8                                   DayAlrm;
273
  UINT8                                     DayAlrm;
264
  UINT8                                   MonAlrm;
274
  UINT8                                     MonAlrm;
265
  UINT8                                   Century;
275
  UINT8                                     Century;
266
  UINT16                                  IaPcBootArch;
276
  UINT16                                    IaPcBootArch;
267
  UINT8                                   Reserved1;
277
  UINT8                                     Reserved1;
268
  UINT32                                  Flags;
278
  UINT32                                    Flags;
269
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
279
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    ResetReg;
270
  UINT8                                   ResetValue;
280
  UINT8                                     ResetValue;
271
  UINT8                                   Reserved2[3];
281
  UINT8                                     Reserved2[3];
272
  UINT64                                  XFirmwareCtrl;
282
  UINT64                                    XFirmwareCtrl;
273
  UINT64                                  XDsdt;
283
  UINT64                                    XDsdt;
274
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
284
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
275
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
285
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
276
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
286
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
277
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
287
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
278
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
288
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
279
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
289
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
280
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
290
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
281
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
291
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
282
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  SleepControlReg;
292
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    SleepControlReg;
283
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg;
293
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    SleepStatusReg;
284
} EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE;
294
} EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE;
285
295
286
///
296
///
Lines 305-359 typedef struct { Link Here
305
// Fixed ACPI Description Table Boot Architecture Flags
315
// Fixed ACPI Description Table Boot Architecture Flags
306
// All other bits are reserved and must be set to 0.
316
// All other bits are reserved and must be set to 0.
307
//
317
//
308
#define EFI_ACPI_5_0_LEGACY_DEVICES              BIT0
318
#define EFI_ACPI_5_0_LEGACY_DEVICES        BIT0
309
#define EFI_ACPI_5_0_8042                        BIT1
319
#define EFI_ACPI_5_0_8042                  BIT1
310
#define EFI_ACPI_5_0_VGA_NOT_PRESENT             BIT2
320
#define EFI_ACPI_5_0_VGA_NOT_PRESENT       BIT2
311
#define EFI_ACPI_5_0_MSI_NOT_SUPPORTED           BIT3
321
#define EFI_ACPI_5_0_MSI_NOT_SUPPORTED     BIT3
312
#define EFI_ACPI_5_0_PCIE_ASPM_CONTROLS          BIT4
322
#define EFI_ACPI_5_0_PCIE_ASPM_CONTROLS    BIT4
313
#define EFI_ACPI_5_0_CMOS_RTC_NOT_PRESENT        BIT5
323
#define EFI_ACPI_5_0_CMOS_RTC_NOT_PRESENT  BIT5
314
324
315
//
325
//
316
// Fixed ACPI Description Table Fixed Feature Flags
326
// Fixed ACPI Description Table Fixed Feature Flags
317
// All other bits are reserved and must be set to 0.
327
// All other bits are reserved and must be set to 0.
318
//
328
//
319
#define EFI_ACPI_5_0_WBINVD                                 BIT0
329
#define EFI_ACPI_5_0_WBINVD                                BIT0
320
#define EFI_ACPI_5_0_WBINVD_FLUSH                           BIT1
330
#define EFI_ACPI_5_0_WBINVD_FLUSH                          BIT1
321
#define EFI_ACPI_5_0_PROC_C1                                BIT2
331
#define EFI_ACPI_5_0_PROC_C1                               BIT2
322
#define EFI_ACPI_5_0_P_LVL2_UP                              BIT3
332
#define EFI_ACPI_5_0_P_LVL2_UP                             BIT3
323
#define EFI_ACPI_5_0_PWR_BUTTON                             BIT4
333
#define EFI_ACPI_5_0_PWR_BUTTON                            BIT4
324
#define EFI_ACPI_5_0_SLP_BUTTON                             BIT5
334
#define EFI_ACPI_5_0_SLP_BUTTON                            BIT5
325
#define EFI_ACPI_5_0_FIX_RTC                                BIT6
335
#define EFI_ACPI_5_0_FIX_RTC                               BIT6
326
#define EFI_ACPI_5_0_RTC_S4                                 BIT7
336
#define EFI_ACPI_5_0_RTC_S4                                BIT7
327
#define EFI_ACPI_5_0_TMR_VAL_EXT                            BIT8
337
#define EFI_ACPI_5_0_TMR_VAL_EXT                           BIT8
328
#define EFI_ACPI_5_0_DCK_CAP                                BIT9
338
#define EFI_ACPI_5_0_DCK_CAP                               BIT9
329
#define EFI_ACPI_5_0_RESET_REG_SUP                          BIT10
339
#define EFI_ACPI_5_0_RESET_REG_SUP                         BIT10
330
#define EFI_ACPI_5_0_SEALED_CASE                            BIT11
340
#define EFI_ACPI_5_0_SEALED_CASE                           BIT11
331
#define EFI_ACPI_5_0_HEADLESS                               BIT12
341
#define EFI_ACPI_5_0_HEADLESS                              BIT12
332
#define EFI_ACPI_5_0_CPU_SW_SLP                             BIT13
342
#define EFI_ACPI_5_0_CPU_SW_SLP                            BIT13
333
#define EFI_ACPI_5_0_PCI_EXP_WAK                            BIT14
343
#define EFI_ACPI_5_0_PCI_EXP_WAK                           BIT14
334
#define EFI_ACPI_5_0_USE_PLATFORM_CLOCK                     BIT15
344
#define EFI_ACPI_5_0_USE_PLATFORM_CLOCK                    BIT15
335
#define EFI_ACPI_5_0_S4_RTC_STS_VALID                       BIT16
345
#define EFI_ACPI_5_0_S4_RTC_STS_VALID                      BIT16
336
#define EFI_ACPI_5_0_REMOTE_POWER_ON_CAPABLE                BIT17
346
#define EFI_ACPI_5_0_REMOTE_POWER_ON_CAPABLE               BIT17
337
#define EFI_ACPI_5_0_FORCE_APIC_CLUSTER_MODEL               BIT18
347
#define EFI_ACPI_5_0_FORCE_APIC_CLUSTER_MODEL              BIT18
338
#define EFI_ACPI_5_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
348
#define EFI_ACPI_5_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE  BIT19
339
#define EFI_ACPI_5_0_HW_REDUCED_ACPI                        BIT20
349
#define EFI_ACPI_5_0_HW_REDUCED_ACPI                       BIT20
340
#define EFI_ACPI_5_0_LOW_POWER_S0_IDLE_CAPABLE              BIT21
350
#define EFI_ACPI_5_0_LOW_POWER_S0_IDLE_CAPABLE             BIT21
341
351
342
///
352
///
343
/// Firmware ACPI Control Structure
353
/// Firmware ACPI Control Structure
344
///
354
///
345
typedef struct {
355
typedef struct {
346
  UINT32  Signature;
356
  UINT32    Signature;
347
  UINT32  Length;
357
  UINT32    Length;
348
  UINT32  HardwareSignature;
358
  UINT32    HardwareSignature;
349
  UINT32  FirmwareWakingVector;
359
  UINT32    FirmwareWakingVector;
350
  UINT32  GlobalLock;
360
  UINT32    GlobalLock;
351
  UINT32  Flags;
361
  UINT32    Flags;
352
  UINT64  XFirmwareWakingVector;
362
  UINT64    XFirmwareWakingVector;
353
  UINT8   Version;
363
  UINT8     Version;
354
  UINT8   Reserved0[3];
364
  UINT8     Reserved0[3];
355
  UINT32  OspmFlags;
365
  UINT32    OspmFlags;
356
  UINT8   Reserved1[24];
366
  UINT8     Reserved1[24];
357
} EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
367
} EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
358
368
359
///
369
///
Lines 365-378 typedef struct { Link Here
365
/// Firmware Control Structure Feature Flags
375
/// Firmware Control Structure Feature Flags
366
/// All other bits are reserved and must be set to 0.
376
/// All other bits are reserved and must be set to 0.
367
///
377
///
368
#define EFI_ACPI_5_0_S4BIOS_F                     BIT0
378
#define EFI_ACPI_5_0_S4BIOS_F                BIT0
369
#define EFI_ACPI_5_0_64BIT_WAKE_SUPPORTED_F       BIT1
379
#define EFI_ACPI_5_0_64BIT_WAKE_SUPPORTED_F  BIT1
370
380
371
///
381
///
372
/// OSPM Enabled Firmware Control Structure Flags
382
/// OSPM Enabled Firmware Control Structure Flags
373
/// All other bits are reserved and must be set to 0.
383
/// All other bits are reserved and must be set to 0.
374
///
384
///
375
#define EFI_ACPI_5_0_OSPM_64BIT_WAKE_F            BIT0
385
#define EFI_ACPI_5_0_OSPM_64BIT_WAKE_F  BIT0
376
386
377
//
387
//
378
// Differentiated System Description Table,
388
// Differentiated System Description Table,
Lines 381-409 typedef struct { Link Here
381
// no definition needed as they are common description table header, the same with
391
// no definition needed as they are common description table header, the same with
382
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
392
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
383
//
393
//
384
#define EFI_ACPI_5_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
394
#define EFI_ACPI_5_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x02
385
#define EFI_ACPI_5_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
395
#define EFI_ACPI_5_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION       0x02
386
396
387
///
397
///
388
/// Multiple APIC Description Table header definition.  The rest of the table
398
/// Multiple APIC Description Table header definition.  The rest of the table
389
/// must be defined in a platform specific manner.
399
/// must be defined in a platform specific manner.
390
///
400
///
391
typedef struct {
401
typedef struct {
392
  EFI_ACPI_DESCRIPTION_HEADER Header;
402
  EFI_ACPI_DESCRIPTION_HEADER    Header;
393
  UINT32                      LocalApicAddress;
403
  UINT32                         LocalApicAddress;
394
  UINT32                      Flags;
404
  UINT32                         Flags;
395
} EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
405
} EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
396
406
397
///
407
///
398
/// MADT Revision (as defined in ACPI 5.0 spec.)
408
/// MADT Revision (as defined in ACPI 5.0 spec.)
399
///
409
///
400
#define EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
410
#define EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x03
401
411
402
///
412
///
403
/// Multiple APIC Flags
413
/// Multiple APIC Flags
404
/// All other bits are reserved and must be set to 0.
414
/// All other bits are reserved and must be set to 0.
405
///
415
///
406
#define EFI_ACPI_5_0_PCAT_COMPAT         BIT0
416
#define EFI_ACPI_5_0_PCAT_COMPAT  BIT0
407
417
408
//
418
//
409
// Multiple APIC Description Table APIC structure types
419
// Multiple APIC Description Table APIC structure types
Lines 432-488 typedef struct { Link Here
432
/// Processor Local APIC Structure Definition
442
/// Processor Local APIC Structure Definition
433
///
443
///
434
typedef struct {
444
typedef struct {
435
  UINT8   Type;
445
  UINT8     Type;
436
  UINT8   Length;
446
  UINT8     Length;
437
  UINT8   AcpiProcessorId;
447
  UINT8     AcpiProcessorId;
438
  UINT8   ApicId;
448
  UINT8     ApicId;
439
  UINT32  Flags;
449
  UINT32    Flags;
440
} EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
450
} EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
441
451
442
///
452
///
443
/// Local APIC Flags.  All other bits are reserved and must be 0.
453
/// Local APIC Flags.  All other bits are reserved and must be 0.
444
///
454
///
445
#define EFI_ACPI_5_0_LOCAL_APIC_ENABLED        BIT0
455
#define EFI_ACPI_5_0_LOCAL_APIC_ENABLED  BIT0
446
456
447
///
457
///
448
/// IO APIC Structure
458
/// IO APIC Structure
449
///
459
///
450
typedef struct {
460
typedef struct {
451
  UINT8   Type;
461
  UINT8     Type;
452
  UINT8   Length;
462
  UINT8     Length;
453
  UINT8   IoApicId;
463
  UINT8     IoApicId;
454
  UINT8   Reserved;
464
  UINT8     Reserved;
455
  UINT32  IoApicAddress;
465
  UINT32    IoApicAddress;
456
  UINT32  GlobalSystemInterruptBase;
466
  UINT32    GlobalSystemInterruptBase;
457
} EFI_ACPI_5_0_IO_APIC_STRUCTURE;
467
} EFI_ACPI_5_0_IO_APIC_STRUCTURE;
458
468
459
///
469
///
460
/// Interrupt Source Override Structure
470
/// Interrupt Source Override Structure
461
///
471
///
462
typedef struct {
472
typedef struct {
463
  UINT8   Type;
473
  UINT8     Type;
464
  UINT8   Length;
474
  UINT8     Length;
465
  UINT8   Bus;
475
  UINT8     Bus;
466
  UINT8   Source;
476
  UINT8     Source;
467
  UINT32  GlobalSystemInterrupt;
477
  UINT32    GlobalSystemInterrupt;
468
  UINT16  Flags;
478
  UINT16    Flags;
469
} EFI_ACPI_5_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
479
} EFI_ACPI_5_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
470
480
471
///
481
///
472
/// Platform Interrupt Sources Structure Definition
482
/// Platform Interrupt Sources Structure Definition
473
///
483
///
474
typedef struct {
484
typedef struct {
475
  UINT8   Type;
485
  UINT8     Type;
476
  UINT8   Length;
486
  UINT8     Length;
477
  UINT16  Flags;
487
  UINT16    Flags;
478
  UINT8   InterruptType;
488
  UINT8     InterruptType;
479
  UINT8   ProcessorId;
489
  UINT8     ProcessorId;
480
  UINT8   ProcessorEid;
490
  UINT8     ProcessorEid;
481
  UINT8   IoSapicVector;
491
  UINT8     IoSapicVector;
482
  UINT32  GlobalSystemInterrupt;
492
  UINT32    GlobalSystemInterrupt;
483
  UINT32  PlatformInterruptSourceFlags;
493
  UINT32    PlatformInterruptSourceFlags;
484
  UINT8   CpeiProcessorOverride;
494
  UINT8     CpeiProcessorOverride;
485
  UINT8   Reserved[31];
495
  UINT8     Reserved[31];
486
} EFI_ACPI_5_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
496
} EFI_ACPI_5_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
487
497
488
//
498
//
Lines 496-538 typedef struct { Link Here
496
/// Non-Maskable Interrupt Source Structure
506
/// Non-Maskable Interrupt Source Structure
497
///
507
///
498
typedef struct {
508
typedef struct {
499
  UINT8   Type;
509
  UINT8     Type;
500
  UINT8   Length;
510
  UINT8     Length;
501
  UINT16  Flags;
511
  UINT16    Flags;
502
  UINT32  GlobalSystemInterrupt;
512
  UINT32    GlobalSystemInterrupt;
503
} EFI_ACPI_5_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
513
} EFI_ACPI_5_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
504
514
505
///
515
///
506
/// Local APIC NMI Structure
516
/// Local APIC NMI Structure
507
///
517
///
508
typedef struct {
518
typedef struct {
509
  UINT8   Type;
519
  UINT8     Type;
510
  UINT8   Length;
520
  UINT8     Length;
511
  UINT8   AcpiProcessorId;
521
  UINT8     AcpiProcessorId;
512
  UINT16  Flags;
522
  UINT16    Flags;
513
  UINT8   LocalApicLint;
523
  UINT8     LocalApicLint;
514
} EFI_ACPI_5_0_LOCAL_APIC_NMI_STRUCTURE;
524
} EFI_ACPI_5_0_LOCAL_APIC_NMI_STRUCTURE;
515
525
516
///
526
///
517
/// Local APIC Address Override Structure
527
/// Local APIC Address Override Structure
518
///
528
///
519
typedef struct {
529
typedef struct {
520
  UINT8   Type;
530
  UINT8     Type;
521
  UINT8   Length;
531
  UINT8     Length;
522
  UINT16  Reserved;
532
  UINT16    Reserved;
523
  UINT64  LocalApicAddress;
533
  UINT64    LocalApicAddress;
524
} EFI_ACPI_5_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
534
} EFI_ACPI_5_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
525
535
526
///
536
///
527
/// IO SAPIC Structure
537
/// IO SAPIC Structure
528
///
538
///
529
typedef struct {
539
typedef struct {
530
  UINT8   Type;
540
  UINT8     Type;
531
  UINT8   Length;
541
  UINT8     Length;
532
  UINT8   IoApicId;
542
  UINT8     IoApicId;
533
  UINT8   Reserved;
543
  UINT8     Reserved;
534
  UINT32  GlobalSystemInterruptBase;
544
  UINT32    GlobalSystemInterruptBase;
535
  UINT64  IoSapicAddress;
545
  UINT64    IoSapicAddress;
536
} EFI_ACPI_5_0_IO_SAPIC_STRUCTURE;
546
} EFI_ACPI_5_0_IO_SAPIC_STRUCTURE;
537
547
538
///
548
///
Lines 540-649 typedef struct { Link Here
540
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
550
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
541
///
551
///
542
typedef struct {
552
typedef struct {
543
  UINT8   Type;
553
  UINT8     Type;
544
  UINT8   Length;
554
  UINT8     Length;
545
  UINT8   AcpiProcessorId;
555
  UINT8     AcpiProcessorId;
546
  UINT8   LocalSapicId;
556
  UINT8     LocalSapicId;
547
  UINT8   LocalSapicEid;
557
  UINT8     LocalSapicEid;
548
  UINT8   Reserved[3];
558
  UINT8     Reserved[3];
549
  UINT32  Flags;
559
  UINT32    Flags;
550
  UINT32  ACPIProcessorUIDValue;
560
  UINT32    ACPIProcessorUIDValue;
551
} EFI_ACPI_5_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
561
} EFI_ACPI_5_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
552
562
553
///
563
///
554
/// Platform Interrupt Sources Structure
564
/// Platform Interrupt Sources Structure
555
///
565
///
556
typedef struct {
566
typedef struct {
557
  UINT8   Type;
567
  UINT8     Type;
558
  UINT8   Length;
568
  UINT8     Length;
559
  UINT16  Flags;
569
  UINT16    Flags;
560
  UINT8   InterruptType;
570
  UINT8     InterruptType;
561
  UINT8   ProcessorId;
571
  UINT8     ProcessorId;
562
  UINT8   ProcessorEid;
572
  UINT8     ProcessorEid;
563
  UINT8   IoSapicVector;
573
  UINT8     IoSapicVector;
564
  UINT32  GlobalSystemInterrupt;
574
  UINT32    GlobalSystemInterrupt;
565
  UINT32  PlatformInterruptSourceFlags;
575
  UINT32    PlatformInterruptSourceFlags;
566
} EFI_ACPI_5_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
576
} EFI_ACPI_5_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
567
577
568
///
578
///
569
/// Platform Interrupt Source Flags.
579
/// Platform Interrupt Source Flags.
570
/// All other bits are reserved and must be set to 0.
580
/// All other bits are reserved and must be set to 0.
571
///
581
///
572
#define EFI_ACPI_5_0_CPEI_PROCESSOR_OVERRIDE          BIT0
582
#define EFI_ACPI_5_0_CPEI_PROCESSOR_OVERRIDE  BIT0
573
583
574
///
584
///
575
/// Processor Local x2APIC Structure Definition
585
/// Processor Local x2APIC Structure Definition
576
///
586
///
577
typedef struct {
587
typedef struct {
578
  UINT8   Type;
588
  UINT8     Type;
579
  UINT8   Length;
589
  UINT8     Length;
580
  UINT8   Reserved[2];
590
  UINT8     Reserved[2];
581
  UINT32  X2ApicId;
591
  UINT32    X2ApicId;
582
  UINT32  Flags;
592
  UINT32    Flags;
583
  UINT32  AcpiProcessorUid;
593
  UINT32    AcpiProcessorUid;
584
} EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
594
} EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
585
595
586
///
596
///
587
/// Local x2APIC NMI Structure
597
/// Local x2APIC NMI Structure
588
///
598
///
589
typedef struct {
599
typedef struct {
590
  UINT8   Type;
600
  UINT8     Type;
591
  UINT8   Length;
601
  UINT8     Length;
592
  UINT16  Flags;
602
  UINT16    Flags;
593
  UINT32  AcpiProcessorUid;
603
  UINT32    AcpiProcessorUid;
594
  UINT8   LocalX2ApicLint;
604
  UINT8     LocalX2ApicLint;
595
  UINT8   Reserved[3];
605
  UINT8     Reserved[3];
596
} EFI_ACPI_5_0_LOCAL_X2APIC_NMI_STRUCTURE;
606
} EFI_ACPI_5_0_LOCAL_X2APIC_NMI_STRUCTURE;
597
607
598
///
608
///
599
/// GIC Structure
609
/// GIC Structure
600
///
610
///
601
typedef struct {
611
typedef struct {
602
  UINT8   Type;
612
  UINT8     Type;
603
  UINT8   Length;
613
  UINT8     Length;
604
  UINT16  Reserved;
614
  UINT16    Reserved;
605
  UINT32  GicId;
615
  UINT32    GicId;
606
  UINT32  AcpiProcessorUid;
616
  UINT32    AcpiProcessorUid;
607
  UINT32  Flags;
617
  UINT32    Flags;
608
  UINT32  ParkingProtocolVersion;
618
  UINT32    ParkingProtocolVersion;
609
  UINT32  PerformanceInterruptGsiv;
619
  UINT32    PerformanceInterruptGsiv;
610
  UINT64  ParkedAddress;
620
  UINT64    ParkedAddress;
611
  UINT64  PhysicalBaseAddress;
621
  UINT64    PhysicalBaseAddress;
612
} EFI_ACPI_5_0_GIC_STRUCTURE;
622
} EFI_ACPI_5_0_GIC_STRUCTURE;
613
623
614
///
624
///
615
/// GIC Flags.  All other bits are reserved and must be 0.
625
/// GIC Flags.  All other bits are reserved and must be 0.
616
///
626
///
617
#define EFI_ACPI_5_0_GIC_ENABLED                     BIT0
627
#define EFI_ACPI_5_0_GIC_ENABLED                  BIT0
618
#define EFI_ACPI_5_0_PERFORMANCE_INTERRUPT_MODEL     BIT1
628
#define EFI_ACPI_5_0_PERFORMANCE_INTERRUPT_MODEL  BIT1
619
629
620
///
630
///
621
/// GIC Distributor Structure
631
/// GIC Distributor Structure
622
///
632
///
623
typedef struct {
633
typedef struct {
624
  UINT8   Type;
634
  UINT8     Type;
625
  UINT8   Length;
635
  UINT8     Length;
626
  UINT16  Reserved1;
636
  UINT16    Reserved1;
627
  UINT32  GicId;
637
  UINT32    GicId;
628
  UINT64  PhysicalBaseAddress;
638
  UINT64    PhysicalBaseAddress;
629
  UINT32  SystemVectorBase;
639
  UINT32    SystemVectorBase;
630
  UINT32  Reserved2;
640
  UINT32    Reserved2;
631
} EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE;
641
} EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE;
632
642
633
///
643
///
634
/// Smart Battery Description Table (SBST)
644
/// Smart Battery Description Table (SBST)
635
///
645
///
636
typedef struct {
646
typedef struct {
637
  EFI_ACPI_DESCRIPTION_HEADER Header;
647
  EFI_ACPI_DESCRIPTION_HEADER    Header;
638
  UINT32                      WarningEnergyLevel;
648
  UINT32                         WarningEnergyLevel;
639
  UINT32                      LowEnergyLevel;
649
  UINT32                         LowEnergyLevel;
640
  UINT32                      CriticalEnergyLevel;
650
  UINT32                         CriticalEnergyLevel;
641
} EFI_ACPI_5_0_SMART_BATTERY_DESCRIPTION_TABLE;
651
} EFI_ACPI_5_0_SMART_BATTERY_DESCRIPTION_TABLE;
642
652
643
///
653
///
644
/// SBST Version (as defined in ACPI 5.0 spec.)
654
/// SBST Version (as defined in ACPI 5.0 spec.)
645
///
655
///
646
#define EFI_ACPI_5_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
656
#define EFI_ACPI_5_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
647
657
648
///
658
///
649
/// Embedded Controller Boot Resources Table (ECDT)
659
/// Embedded Controller Boot Resources Table (ECDT)
Lines 651-661 typedef struct { Link Here
651
/// a fully qualified reference to the name space object.
661
/// a fully qualified reference to the name space object.
652
///
662
///
653
typedef struct {
663
typedef struct {
654
  EFI_ACPI_DESCRIPTION_HEADER             Header;
664
  EFI_ACPI_DESCRIPTION_HEADER               Header;
655
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
665
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    EcControl;
656
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  EcData;
666
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    EcData;
657
  UINT32                                  Uid;
667
  UINT32                                    Uid;
658
  UINT8                                   GpeBit;
668
  UINT8                                     GpeBit;
659
} EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
669
} EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
660
670
661
///
671
///
Lines 668-676 typedef struct { Link Here
668
/// must be defined in a platform specific manner.
678
/// must be defined in a platform specific manner.
669
///
679
///
670
typedef struct {
680
typedef struct {
671
  EFI_ACPI_DESCRIPTION_HEADER Header;
681
  EFI_ACPI_DESCRIPTION_HEADER    Header;
672
  UINT32                      Reserved1;  ///< Must be set to 1
682
  UINT32                         Reserved1; ///< Must be set to 1
673
  UINT64                      Reserved2;
683
  UINT64                         Reserved2;
674
} EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
684
} EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
675
685
676
///
686
///
Lines 691-747 typedef struct { Link Here
691
/// Processor Local APIC/SAPIC Affinity Structure Definition
701
/// Processor Local APIC/SAPIC Affinity Structure Definition
692
///
702
///
693
typedef struct {
703
typedef struct {
694
  UINT8   Type;
704
  UINT8     Type;
695
  UINT8   Length;
705
  UINT8     Length;
696
  UINT8   ProximityDomain7To0;
706
  UINT8     ProximityDomain7To0;
697
  UINT8   ApicId;
707
  UINT8     ApicId;
698
  UINT32  Flags;
708
  UINT32    Flags;
699
  UINT8   LocalSapicEid;
709
  UINT8     LocalSapicEid;
700
  UINT8   ProximityDomain31To8[3];
710
  UINT8     ProximityDomain31To8[3];
701
  UINT32  ClockDomain;
711
  UINT32    ClockDomain;
702
} EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
712
} EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
703
713
704
///
714
///
705
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
715
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
706
///
716
///
707
#define EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
717
#define EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED  (1 << 0)
708
718
709
///
719
///
710
/// Memory Affinity Structure Definition
720
/// Memory Affinity Structure Definition
711
///
721
///
712
typedef struct {
722
typedef struct {
713
  UINT8   Type;
723
  UINT8     Type;
714
  UINT8   Length;
724
  UINT8     Length;
715
  UINT32  ProximityDomain;
725
  UINT32    ProximityDomain;
716
  UINT16  Reserved1;
726
  UINT16    Reserved1;
717
  UINT32  AddressBaseLow;
727
  UINT32    AddressBaseLow;
718
  UINT32  AddressBaseHigh;
728
  UINT32    AddressBaseHigh;
719
  UINT32  LengthLow;
729
  UINT32    LengthLow;
720
  UINT32  LengthHigh;
730
  UINT32    LengthHigh;
721
  UINT32  Reserved2;
731
  UINT32    Reserved2;
722
  UINT32  Flags;
732
  UINT32    Flags;
723
  UINT64  Reserved3;
733
  UINT64    Reserved3;
724
} EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE;
734
} EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE;
725
735
726
//
736
//
727
// Memory Flags.  All other bits are reserved and must be 0.
737
// Memory Flags.  All other bits are reserved and must be 0.
728
//
738
//
729
#define EFI_ACPI_5_0_MEMORY_ENABLED       (1 << 0)
739
#define EFI_ACPI_5_0_MEMORY_ENABLED        (1 << 0)
730
#define EFI_ACPI_5_0_MEMORY_HOT_PLUGGABLE (1 << 1)
740
#define EFI_ACPI_5_0_MEMORY_HOT_PLUGGABLE  (1 << 1)
731
#define EFI_ACPI_5_0_MEMORY_NONVOLATILE   (1 << 2)
741
#define EFI_ACPI_5_0_MEMORY_NONVOLATILE    (1 << 2)
732
742
733
///
743
///
734
/// Processor Local x2APIC Affinity Structure Definition
744
/// Processor Local x2APIC Affinity Structure Definition
735
///
745
///
736
typedef struct {
746
typedef struct {
737
  UINT8   Type;
747
  UINT8     Type;
738
  UINT8   Length;
748
  UINT8     Length;
739
  UINT8   Reserved1[2];
749
  UINT8     Reserved1[2];
740
  UINT32  ProximityDomain;
750
  UINT32    ProximityDomain;
741
  UINT32  X2ApicId;
751
  UINT32    X2ApicId;
742
  UINT32  Flags;
752
  UINT32    Flags;
743
  UINT32  ClockDomain;
753
  UINT32    ClockDomain;
744
  UINT8   Reserved2[4];
754
  UINT8     Reserved2[4];
745
} EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
755
} EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
746
756
747
///
757
///
Lines 749-756 typedef struct { Link Here
749
/// The rest of the table is a matrix.
759
/// The rest of the table is a matrix.
750
///
760
///
751
typedef struct {
761
typedef struct {
752
  EFI_ACPI_DESCRIPTION_HEADER Header;
762
  EFI_ACPI_DESCRIPTION_HEADER    Header;
753
  UINT64                      NumberOfSystemLocalities;
763
  UINT64                         NumberOfSystemLocalities;
754
} EFI_ACPI_5_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
764
} EFI_ACPI_5_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
755
765
756
///
766
///
Lines 762-775 typedef struct { Link Here
762
/// Corrected Platform Error Polling Table (CPEP)
772
/// Corrected Platform Error Polling Table (CPEP)
763
///
773
///
764
typedef struct {
774
typedef struct {
765
  EFI_ACPI_DESCRIPTION_HEADER Header;
775
  EFI_ACPI_DESCRIPTION_HEADER    Header;
766
  UINT8                       Reserved[8];
776
  UINT8                          Reserved[8];
767
} EFI_ACPI_5_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
777
} EFI_ACPI_5_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
768
778
769
///
779
///
770
/// CPEP Version (as defined in ACPI 5.0 spec.)
780
/// CPEP Version (as defined in ACPI 5.0 spec.)
771
///
781
///
772
#define EFI_ACPI_5_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
782
#define EFI_ACPI_5_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION  0x01
773
783
774
//
784
//
775
// CPEP processor structure types.
785
// CPEP processor structure types.
Lines 780-845 typedef struct { Link Here
780
/// Corrected Platform Error Polling Processor Structure Definition
790
/// Corrected Platform Error Polling Processor Structure Definition
781
///
791
///
782
typedef struct {
792
typedef struct {
783
  UINT8   Type;
793
  UINT8     Type;
784
  UINT8   Length;
794
  UINT8     Length;
785
  UINT8   ProcessorId;
795
  UINT8     ProcessorId;
786
  UINT8   ProcessorEid;
796
  UINT8     ProcessorEid;
787
  UINT32  PollingInterval;
797
  UINT32    PollingInterval;
788
} EFI_ACPI_5_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
798
} EFI_ACPI_5_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
789
799
790
///
800
///
791
/// Maximum System Characteristics Table (MSCT)
801
/// Maximum System Characteristics Table (MSCT)
792
///
802
///
793
typedef struct {
803
typedef struct {
794
  EFI_ACPI_DESCRIPTION_HEADER Header;
804
  EFI_ACPI_DESCRIPTION_HEADER    Header;
795
  UINT32                      OffsetProxDomInfo;
805
  UINT32                         OffsetProxDomInfo;
796
  UINT32                      MaximumNumberOfProximityDomains;
806
  UINT32                         MaximumNumberOfProximityDomains;
797
  UINT32                      MaximumNumberOfClockDomains;
807
  UINT32                         MaximumNumberOfClockDomains;
798
  UINT64                      MaximumPhysicalAddress;
808
  UINT64                         MaximumPhysicalAddress;
799
} EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
809
} EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
800
810
801
///
811
///
802
/// MSCT Version (as defined in ACPI 5.0 spec.)
812
/// MSCT Version (as defined in ACPI 5.0 spec.)
803
///
813
///
804
#define EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
814
#define EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION  0x01
805
815
806
///
816
///
807
/// Maximum Proximity Domain Information Structure Definition
817
/// Maximum Proximity Domain Information Structure Definition
808
///
818
///
809
typedef struct {
819
typedef struct {
810
  UINT8   Revision;
820
  UINT8     Revision;
811
  UINT8   Length;
821
  UINT8     Length;
812
  UINT32  ProximityDomainRangeLow;
822
  UINT32    ProximityDomainRangeLow;
813
  UINT32  ProximityDomainRangeHigh;
823
  UINT32    ProximityDomainRangeHigh;
814
  UINT32  MaximumProcessorCapacity;
824
  UINT32    MaximumProcessorCapacity;
815
  UINT64  MaximumMemoryCapacity;
825
  UINT64    MaximumMemoryCapacity;
816
} EFI_ACPI_5_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
826
} EFI_ACPI_5_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
817
827
818
///
828
///
819
/// ACPI RAS Feature Table definition.
829
/// ACPI RAS Feature Table definition.
820
///
830
///
821
typedef struct {
831
typedef struct {
822
  EFI_ACPI_DESCRIPTION_HEADER Header;
832
  EFI_ACPI_DESCRIPTION_HEADER    Header;
823
  UINT8                       PlatformCommunicationChannelIdentifier[12];
833
  UINT8                          PlatformCommunicationChannelIdentifier[12];
824
} EFI_ACPI_5_0_RAS_FEATURE_TABLE;
834
} EFI_ACPI_5_0_RAS_FEATURE_TABLE;
825
835
826
///
836
///
827
/// RASF Version (as defined in ACPI 5.0 spec.)
837
/// RASF Version (as defined in ACPI 5.0 spec.)
828
///
838
///
829
#define EFI_ACPI_5_0_RAS_FEATURE_TABLE_REVISION 0x01
839
#define EFI_ACPI_5_0_RAS_FEATURE_TABLE_REVISION  0x01
830
840
831
///
841
///
832
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
842
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
833
///
843
///
834
typedef struct {
844
typedef struct {
835
  UINT32                      Signature;
845
  UINT32    Signature;
836
  UINT16                      Command;
846
  UINT16    Command;
837
  UINT16                      Status;
847
  UINT16    Status;
838
  UINT16                      Version;
848
  UINT16    Version;
839
  UINT8                       RASCapabilities[16];
849
  UINT8     RASCapabilities[16];
840
  UINT8                       SetRASCapabilities[16];
850
  UINT8     SetRASCapabilities[16];
841
  UINT16                      NumberOfRASFParameterBlocks;
851
  UINT16    NumberOfRASFParameterBlocks;
842
  UINT32                      SetRASCapabilitiesStatus;
852
  UINT32    SetRASCapabilitiesStatus;
843
} EFI_ACPI_5_0_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
853
} EFI_ACPI_5_0_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
844
854
845
///
855
///
Lines 857-908 typedef struct { Link Here
857
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
867
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
858
///
868
///
859
typedef struct {
869
typedef struct {
860
  UINT16                      Type;
870
  UINT16    Type;
861
  UINT16                      Version;
871
  UINT16    Version;
862
  UINT16                      Length;
872
  UINT16    Length;
863
  UINT16                      PatrolScrubCommand;
873
  UINT16    PatrolScrubCommand;
864
  UINT64                      RequestedAddressRange[2];
874
  UINT64    RequestedAddressRange[2];
865
  UINT64                      ActualAddressRange[2];
875
  UINT64    ActualAddressRange[2];
866
  UINT16                      Flags;
876
  UINT16    Flags;
867
  UINT8                       RequestedSpeed;
877
  UINT8     RequestedSpeed;
868
} EFI_ACPI_5_0_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
878
} EFI_ACPI_5_0_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
869
879
870
///
880
///
871
/// ACPI RASF Patrol Scrub command
881
/// ACPI RASF Patrol Scrub command
872
///
882
///
873
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS   0x01
883
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS  0x01
874
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER   0x02
884
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER  0x02
875
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER    0x03
885
#define EFI_ACPI_5_0_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER   0x03
876
886
877
///
887
///
878
/// Memory Power State Table definition.
888
/// Memory Power State Table definition.
879
///
889
///
880
typedef struct {
890
typedef struct {
881
  EFI_ACPI_DESCRIPTION_HEADER Header;
891
  EFI_ACPI_DESCRIPTION_HEADER    Header;
882
  UINT8                       PlatformCommunicationChannelIdentifier;
892
  UINT8                          PlatformCommunicationChannelIdentifier;
883
  UINT8                       Reserved[3];
893
  UINT8                          Reserved[3];
884
// Memory Power Node Structure
894
  // Memory Power Node Structure
885
// Memory Power State Characteristics
895
  // Memory Power State Characteristics
886
} EFI_ACPI_5_0_MEMORY_POWER_STATUS_TABLE;
896
} EFI_ACPI_5_0_MEMORY_POWER_STATUS_TABLE;
887
897
888
///
898
///
889
/// MPST Version (as defined in ACPI 5.0 spec.)
899
/// MPST Version (as defined in ACPI 5.0 spec.)
890
///
900
///
891
#define EFI_ACPI_5_0_MEMORY_POWER_STATE_TABLE_REVISION 0x01
901
#define EFI_ACPI_5_0_MEMORY_POWER_STATE_TABLE_REVISION  0x01
892
902
893
///
903
///
894
/// MPST Platform Communication Channel Shared Memory Region definition.
904
/// MPST Platform Communication Channel Shared Memory Region definition.
895
///
905
///
896
typedef struct {
906
typedef struct {
897
  UINT32                      Signature;
907
  UINT32    Signature;
898
  UINT16                      Command;
908
  UINT16    Command;
899
  UINT16                      Status;
909
  UINT16    Status;
900
  UINT32                      MemoryPowerCommandRegister;
910
  UINT32    MemoryPowerCommandRegister;
901
  UINT32                      MemoryPowerStatusRegister;
911
  UINT32    MemoryPowerStatusRegister;
902
  UINT32                      PowerStateId;
912
  UINT32    PowerStateId;
903
  UINT32                      MemoryPowerNodeId;
913
  UINT32    MemoryPowerNodeId;
904
  UINT64                      MemoryEnergyConsumed;
914
  UINT64    MemoryEnergyConsumed;
905
  UINT64                      ExpectedAveragePowerComsuned;
915
  UINT64    ExpectedAveragePowerComsuned;
906
} EFI_ACPI_5_0_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
916
} EFI_ACPI_5_0_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
907
917
908
///
918
///
Lines 913-1100 typedef struct { Link Here
913
///
923
///
914
/// ACPI MPST Memory Power command
924
/// ACPI MPST Memory Power command
915
///
925
///
916
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE       0x01
926
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE      0x01
917
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE       0x02
927
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE      0x02
918
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED   0x03
928
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED  0x03
919
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED   0x04
929
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED  0x04
920
930
921
///
931
///
922
/// MPST Memory Power Node Table
932
/// MPST Memory Power Node Table
923
///
933
///
924
typedef struct {
934
typedef struct {
925
  UINT8                                             PowerStateValue;
935
  UINT8    PowerStateValue;
926
  UINT8                                             PowerStateInformationIndex;
936
  UINT8    PowerStateInformationIndex;
927
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE;
937
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE;
928
938
929
typedef struct {
939
typedef struct {
930
  UINT8                                             Flag;
940
  UINT8     Flag;
931
  UINT8                                             Reserved;
941
  UINT8     Reserved;
932
  UINT16                                            MemoryPowerNodeId;
942
  UINT16    MemoryPowerNodeId;
933
  UINT32                                            Length;
943
  UINT32    Length;
934
  UINT64                                            AddressBase;
944
  UINT64    AddressBase;
935
  UINT64                                            AddressLength;
945
  UINT64    AddressLength;
936
  UINT32                                            NumberOfPowerStates;
946
  UINT32    NumberOfPowerStates;
937
  UINT32                                            NumberOfPhysicalComponents;
947
  UINT32    NumberOfPhysicalComponents;
938
//EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
948
  // EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
939
//UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
949
  // UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
940
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE;
950
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE;
941
951
942
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE          0x01
952
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE         0x01
943
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED   0x02
953
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED  0x02
944
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE   0x04
954
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE  0x04
945
955
946
typedef struct {
956
typedef struct {
947
  UINT16                      MemoryPowerNodeCount;
957
  UINT16    MemoryPowerNodeCount;
948
  UINT8                       Reserved[2];
958
  UINT8     Reserved[2];
949
} EFI_ACPI_5_0_MPST_MEMORY_POWER_NODE_TABLE;
959
} EFI_ACPI_5_0_MPST_MEMORY_POWER_NODE_TABLE;
950
960
951
///
961
///
952
/// MPST Memory Power State Characteristics Table
962
/// MPST Memory Power State Characteristics Table
953
///
963
///
954
typedef struct {
964
typedef struct {
955
  UINT8                                             PowerStateStructureID;
965
  UINT8     PowerStateStructureID;
956
  UINT8                                             Flag;
966
  UINT8     Flag;
957
  UINT16                                            Reserved;
967
  UINT16    Reserved;
958
  UINT32                                            AveragePowerConsumedInMPS0;
968
  UINT32    AveragePowerConsumedInMPS0;
959
  UINT32                                            RelativePowerSavingToMPS0;
969
  UINT32    RelativePowerSavingToMPS0;
960
  UINT64                                            ExitLatencyToMPS0;
970
  UINT64    ExitLatencyToMPS0;
961
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
971
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
962
972
963
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED              0x01
973
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED             0x01
964
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY   0x02
974
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY  0x02
965
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT    0x04
975
#define EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT   0x04
966
976
967
typedef struct {
977
typedef struct {
968
  UINT16                      MemoryPowerStateCharacteristicsCount;
978
  UINT16    MemoryPowerStateCharacteristicsCount;
969
  UINT8                       Reserved[2];
979
  UINT8     Reserved[2];
970
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
980
} EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
971
981
972
///
982
///
973
/// Memory Topology Table definition.
983
/// Memory Topology Table definition.
974
///
984
///
975
typedef struct {
985
typedef struct {
976
  EFI_ACPI_DESCRIPTION_HEADER Header;
986
  EFI_ACPI_DESCRIPTION_HEADER    Header;
977
  UINT32                      Reserved;
987
  UINT32                         Reserved;
978
} EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE;
988
} EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE;
979
989
980
///
990
///
981
/// PMTT Version (as defined in ACPI 5.0 spec.)
991
/// PMTT Version (as defined in ACPI 5.0 spec.)
982
///
992
///
983
#define EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE_REVISION 0x01
993
#define EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE_REVISION  0x01
984
994
985
///
995
///
986
/// Common Memory Aggregator Device Structure.
996
/// Common Memory Aggregator Device Structure.
987
///
997
///
988
typedef struct {
998
typedef struct {
989
  UINT8                       Type;
999
  UINT8     Type;
990
  UINT8                       Reserved;
1000
  UINT8     Reserved;
991
  UINT16                      Length;
1001
  UINT16    Length;
992
  UINT16                      Flags;
1002
  UINT16    Flags;
993
  UINT16                      Reserved1;
1003
  UINT16    Reserved1;
994
} EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1004
} EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
995
1005
996
///
1006
///
997
/// Memory Aggregator Device Type
1007
/// Memory Aggregator Device Type
998
///
1008
///
999
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET            0x1
1009
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET             0x0
1000
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER 0x2
1010
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER  0x1
1001
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM              0x3
1011
#define EFI_ACPI_5_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM               0x2
1002
1012
1003
///
1013
///
1004
/// Socket Memory Aggregator Device Structure.
1014
/// Socket Memory Aggregator Device Structure.
1005
///
1015
///
1006
typedef struct {
1016
typedef struct {
1007
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
1017
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
1008
  UINT16                                                       SocketIdentifier;
1018
  UINT16                                                         SocketIdentifier;
1009
  UINT16                                                       Reserved;
1019
  UINT16                                                         Reserved;
1010
//EFI_ACPI_5_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
1020
  // EFI_ACPI_5_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
1011
} EFI_ACPI_5_0_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1021
} EFI_ACPI_5_0_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1012
1022
1013
///
1023
///
1014
/// MemoryController Memory Aggregator Device Structure.
1024
/// MemoryController Memory Aggregator Device Structure.
1015
///
1025
///
1016
typedef struct {
1026
typedef struct {
1017
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
1027
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
1018
  UINT32                                                       ReadLatency;
1028
  UINT32                                                         ReadLatency;
1019
  UINT32                                                       WriteLatency;
1029
  UINT32                                                         WriteLatency;
1020
  UINT32                                                       ReadBandwidth;
1030
  UINT32                                                         ReadBandwidth;
1021
  UINT32                                                       WriteBandwidth;
1031
  UINT32                                                         WriteBandwidth;
1022
  UINT16                                                       OptimalAccessUnit;
1032
  UINT16                                                         OptimalAccessUnit;
1023
  UINT16                                                       OptimalAccessAlignment;
1033
  UINT16                                                         OptimalAccessAlignment;
1024
  UINT16                                                       Reserved;
1034
  UINT16                                                         Reserved;
1025
  UINT16                                                       NumberOfProximityDomains;
1035
  UINT16                                                         NumberOfProximityDomains;
1026
//UINT32                                                       ProximityDomain[NumberOfProximityDomains];
1036
  // UINT32                                                       ProximityDomain[NumberOfProximityDomains];
1027
//EFI_ACPI_5_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
1037
  // EFI_ACPI_5_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
1028
} EFI_ACPI_5_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1038
} EFI_ACPI_5_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1029
1039
1030
///
1040
///
1031
/// DIMM Memory Aggregator Device Structure.
1041
/// DIMM Memory Aggregator Device Structure.
1032
///
1042
///
1033
typedef struct {
1043
typedef struct {
1034
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
1044
  EFI_ACPI_5_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
1035
  UINT16                                                       PhysicalComponentIdentifier;
1045
  UINT16                                                         PhysicalComponentIdentifier;
1036
  UINT16                                                       Reserved;
1046
  UINT16                                                         Reserved;
1037
  UINT32                                                       SizeOfDimm;
1047
  UINT32                                                         SizeOfDimm;
1038
  UINT32                                                       SmbiosHandle;
1048
  UINT32                                                         SmbiosHandle;
1039
} EFI_ACPI_5_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1049
} EFI_ACPI_5_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1040
1050
1041
///
1051
///
1042
/// Boot Graphics Resource Table definition.
1052
/// Boot Graphics Resource Table definition.
1043
///
1053
///
1044
typedef struct {
1054
typedef struct {
1045
  EFI_ACPI_DESCRIPTION_HEADER Header;
1055
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1046
  ///
1056
  ///
1047
  /// 2-bytes (16 bit) version ID. This value must be 1.
1057
  /// 2-bytes (16 bit) version ID. This value must be 1.
1048
  ///
1058
  ///
1049
  UINT16                      Version;
1059
  UINT16                         Version;
1050
  ///
1060
  ///
1051
  /// 1-byte status field indicating current status about the table.
1061
  /// 1-byte status field indicating current status about the table.
1052
  ///     Bits[7:1] = Reserved (must be zero)
1062
  ///     Bits[7:1] = Reserved (must be zero)
1053
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1063
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1054
  ///
1064
  ///
1055
  UINT8                       Status;
1065
  UINT8                          Status;
1056
  ///
1066
  ///
1057
  /// 1-byte enumerated type field indicating format of the image.
1067
  /// 1-byte enumerated type field indicating format of the image.
1058
  ///     0 = Bitmap
1068
  ///     0 = Bitmap
1059
  ///     1 - 255  Reserved (for future use)
1069
  ///     1 - 255  Reserved (for future use)
1060
  ///
1070
  ///
1061
  UINT8                       ImageType;
1071
  UINT8                          ImageType;
1062
  ///
1072
  ///
1063
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1073
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1064
  /// of the image bitmap.
1074
  /// of the image bitmap.
1065
  ///
1075
  ///
1066
  UINT64                      ImageAddress;
1076
  UINT64                         ImageAddress;
1067
  ///
1077
  ///
1068
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1078
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1069
  /// (X, Y) display offset of the top left corner of the boot image.
1079
  /// (X, Y) display offset of the top left corner of the boot image.
1070
  /// The top left corner of the display is at offset (0, 0).
1080
  /// The top left corner of the display is at offset (0, 0).
1071
  ///
1081
  ///
1072
  UINT32                      ImageOffsetX;
1082
  UINT32                         ImageOffsetX;
1073
  ///
1083
  ///
1074
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1084
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1075
  /// (X, Y) display offset of the top left corner of the boot image.
1085
  /// (X, Y) display offset of the top left corner of the boot image.
1076
  /// The top left corner of the display is at offset (0, 0).
1086
  /// The top left corner of the display is at offset (0, 0).
1077
  ///
1087
  ///
1078
  UINT32                      ImageOffsetY;
1088
  UINT32                         ImageOffsetY;
1079
} EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE;
1089
} EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE;
1080
1090
1081
///
1091
///
1082
/// BGRT Revision
1092
/// BGRT Revision
1083
///
1093
///
1084
#define EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION 1
1094
#define EFI_ACPI_5_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION  1
1085
1095
1086
///
1096
///
1087
/// BGRT Version
1097
/// BGRT Version
1088
///
1098
///
1089
#define EFI_ACPI_5_0_BGRT_VERSION         0x01
1099
#define EFI_ACPI_5_0_BGRT_VERSION  0x01
1090
1100
1091
///
1101
///
1092
/// BGRT Status
1102
/// BGRT Status
1093
///
1103
///
1094
#define EFI_ACPI_5_0_BGRT_STATUS_NOT_DISPLAYED 0x00
1104
#define EFI_ACPI_5_0_BGRT_STATUS_NOT_DISPLAYED  0x00
1095
#define EFI_ACPI_5_0_BGRT_STATUS_DISPLAYED     0x01
1105
#define EFI_ACPI_5_0_BGRT_STATUS_DISPLAYED      0x01
1096
#define EFI_ACPI_5_0_BGRT_STATUS_INVALID       EFI_ACPI_5_0_BGRT_STATUS_NOT_DISPLAYED
1106
#define EFI_ACPI_5_0_BGRT_STATUS_INVALID        EFI_ACPI_5_0_BGRT_STATUS_NOT_DISPLAYED
1097
#define EFI_ACPI_5_0_BGRT_STATUS_VALID         EFI_ACPI_5_0_BGRT_STATUS_DISPLAYED
1107
#define EFI_ACPI_5_0_BGRT_STATUS_VALID          EFI_ACPI_5_0_BGRT_STATUS_DISPLAYED
1098
1108
1099
///
1109
///
1100
/// BGRT Image Type
1110
/// BGRT Image Type
Lines 1104-1129 typedef struct { Link Here
1104
///
1114
///
1105
/// FPDT Version (as defined in ACPI 5.0 spec.)
1115
/// FPDT Version (as defined in ACPI 5.0 spec.)
1106
///
1116
///
1107
#define EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION 0x01
1117
#define EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION  0x01
1108
1118
1109
///
1119
///
1110
/// FPDT Performance Record Types
1120
/// FPDT Performance Record Types
1111
///
1121
///
1112
#define EFI_ACPI_5_0_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER      0x0000
1122
#define EFI_ACPI_5_0_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER   0x0000
1113
#define EFI_ACPI_5_0_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER     0x0001
1123
#define EFI_ACPI_5_0_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER  0x0001
1114
1124
1115
///
1125
///
1116
/// FPDT Performance Record Revision
1126
/// FPDT Performance Record Revision
1117
///
1127
///
1118
#define EFI_ACPI_5_0_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER  0x01
1128
#define EFI_ACPI_5_0_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER   0x01
1119
#define EFI_ACPI_5_0_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER 0x01
1129
#define EFI_ACPI_5_0_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER  0x01
1120
1130
1121
///
1131
///
1122
/// FPDT Runtime Performance Record Types
1132
/// FPDT Runtime Performance Record Types
1123
///
1133
///
1124
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME                0x0000
1134
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME            0x0000
1125
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND               0x0001
1135
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND           0x0001
1126
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT      0x0002
1136
#define EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT  0x0002
1127
1137
1128
///
1138
///
1129
/// FPDT Runtime Performance Record Revision
1139
/// FPDT Runtime Performance Record Revision
Lines 1136-1212 typedef struct { Link Here
1136
/// FPDT Performance Record header
1146
/// FPDT Performance Record header
1137
///
1147
///
1138
typedef struct {
1148
typedef struct {
1139
  UINT16           Type;
1149
  UINT16    Type;
1140
  UINT8            Length;
1150
  UINT8     Length;
1141
  UINT8            Revision;
1151
  UINT8     Revision;
1142
} EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER;
1152
} EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER;
1143
1153
1144
///
1154
///
1145
/// FPDT Performance Table header
1155
/// FPDT Performance Table header
1146
///
1156
///
1147
typedef struct {
1157
typedef struct {
1148
  UINT32  Signature;
1158
  UINT32    Signature;
1149
  UINT32  Length;
1159
  UINT32    Length;
1150
} EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER;
1160
} EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER;
1151
1161
1152
///
1162
///
1153
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1163
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1154
///
1164
///
1155
typedef struct {
1165
typedef struct {
1156
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1166
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1157
  UINT32                                          Reserved;
1167
  UINT32                                         Reserved;
1158
  ///
1168
  ///
1159
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1169
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1160
  ///
1170
  ///
1161
  UINT64                                          BootPerformanceTablePointer;
1171
  UINT64                                         BootPerformanceTablePointer;
1162
} EFI_ACPI_5_0_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1172
} EFI_ACPI_5_0_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1163
1173
1164
///
1174
///
1165
/// FPDT S3 Performance Table Pointer Record Structure
1175
/// FPDT S3 Performance Table Pointer Record Structure
1166
///
1176
///
1167
typedef struct {
1177
typedef struct {
1168
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1178
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1169
  UINT32                                          Reserved;
1179
  UINT32                                         Reserved;
1170
  ///
1180
  ///
1171
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1181
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1172
  ///
1182
  ///
1173
  UINT64                                          S3PerformanceTablePointer;
1183
  UINT64                                         S3PerformanceTablePointer;
1174
} EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1184
} EFI_ACPI_5_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1175
1185
1176
///
1186
///
1177
/// FPDT Firmware Basic Boot Performance Record Structure
1187
/// FPDT Firmware Basic Boot Performance Record Structure
1178
///
1188
///
1179
typedef struct {
1189
typedef struct {
1180
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1190
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1181
  UINT32                                          Reserved;
1191
  UINT32                                         Reserved;
1182
  ///
1192
  ///
1183
  /// Timer value logged at the beginning of firmware image execution.
1193
  /// Timer value logged at the beginning of firmware image execution.
1184
  /// This may not always be zero or near zero.
1194
  /// This may not always be zero or near zero.
1185
  ///
1195
  ///
1186
  UINT64                                          ResetEnd;
1196
  UINT64                                         ResetEnd;
1187
  ///
1197
  ///
1188
  /// Timer value logged just prior to loading the OS boot loader into memory.
1198
  /// Timer value logged just prior to loading the OS boot loader into memory.
1189
  /// For non-UEFI compatible boots, this field must be zero.
1199
  /// For non-UEFI compatible boots, this field must be zero.
1190
  ///
1200
  ///
1191
  UINT64                                          OsLoaderLoadImageStart;
1201
  UINT64                                         OsLoaderLoadImageStart;
1192
  ///
1202
  ///
1193
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1203
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1194
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1204
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1195
  /// to the INT 19h handler invocation.
1205
  /// to the INT 19h handler invocation.
1196
  ///
1206
  ///
1197
  UINT64                                          OsLoaderStartImageStart;
1207
  UINT64                                         OsLoaderStartImageStart;
1198
  ///
1208
  ///
1199
  /// Timer value logged at the point when the OS loader calls the
1209
  /// Timer value logged at the point when the OS loader calls the
1200
  /// ExitBootServices function for UEFI compatible firmware.
1210
  /// ExitBootServices function for UEFI compatible firmware.
1201
  /// For non-UEFI compatible boots, this field must be zero.
1211
  /// For non-UEFI compatible boots, this field must be zero.
1202
  ///
1212
  ///
1203
  UINT64                                          ExitBootServicesEntry;
1213
  UINT64                                         ExitBootServicesEntry;
1204
  ///
1214
  ///
1205
  /// Timer value logged at the point just prior to when the OS loader gaining
1215
  /// Timer value logged at the point just prior to when the OS loader gaining
1206
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1216
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1207
  /// For non-UEFI compatible boots, this field must be zero.
1217
  /// For non-UEFI compatible boots, this field must be zero.
1208
  ///
1218
  ///
1209
  UINT64                                          ExitBootServicesExit;
1219
  UINT64                                         ExitBootServicesExit;
1210
} EFI_ACPI_5_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1220
} EFI_ACPI_5_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1211
1221
1212
///
1222
///
Lines 1218-1224 typedef struct { Link Here
1218
// FPDT Firmware Basic Boot Performance Table
1228
// FPDT Firmware Basic Boot Performance Table
1219
//
1229
//
1220
typedef struct {
1230
typedef struct {
1221
  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1231
  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1222
  //
1232
  //
1223
  // one or more Performance Records.
1233
  // one or more Performance Records.
1224
  //
1234
  //
Lines 1233-1239 typedef struct { Link Here
1233
// FPDT Firmware S3 Boot Performance Table
1243
// FPDT Firmware S3 Boot Performance Table
1234
//
1244
//
1235
typedef struct {
1245
typedef struct {
1236
  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1246
  EFI_ACPI_5_0_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1237
  //
1247
  //
1238
  // one or more Performance Records.
1248
  // one or more Performance Records.
1239
  //
1249
  //
Lines 1243-1366 typedef struct { Link Here
1243
/// FPDT Basic S3 Resume Performance Record
1253
/// FPDT Basic S3 Resume Performance Record
1244
///
1254
///
1245
typedef struct {
1255
typedef struct {
1246
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1256
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1247
  ///
1257
  ///
1248
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1258
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1249
  ///
1259
  ///
1250
  UINT32                                          ResumeCount;
1260
  UINT32                                         ResumeCount;
1251
  ///
1261
  ///
1252
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1262
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1253
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1263
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1254
  ///
1264
  ///
1255
  UINT64                                          FullResume;
1265
  UINT64                                         FullResume;
1256
  ///
1266
  ///
1257
  /// Average timer value of all resume cycles logged since the last full boot
1267
  /// Average timer value of all resume cycles logged since the last full boot
1258
  /// sequence, including the most recent resume.  Note that the entire log of
1268
  /// sequence, including the most recent resume.  Note that the entire log of
1259
  /// timer values does not need to be retained in order to calculate this average.
1269
  /// timer values does not need to be retained in order to calculate this average.
1260
  ///
1270
  ///
1261
  UINT64                                          AverageResume;
1271
  UINT64                                         AverageResume;
1262
} EFI_ACPI_5_0_FPDT_S3_RESUME_RECORD;
1272
} EFI_ACPI_5_0_FPDT_S3_RESUME_RECORD;
1263
1273
1264
///
1274
///
1265
/// FPDT Basic S3 Suspend Performance Record
1275
/// FPDT Basic S3 Suspend Performance Record
1266
///
1276
///
1267
typedef struct {
1277
typedef struct {
1268
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1278
  EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1269
  ///
1279
  ///
1270
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1280
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1271
  /// Only the most recent suspend cycle's timer value is retained.
1281
  /// Only the most recent suspend cycle's timer value is retained.
1272
  ///
1282
  ///
1273
  UINT64                                          SuspendStart;
1283
  UINT64                                         SuspendStart;
1274
  ///
1284
  ///
1275
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1285
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1276
  /// mechanism) used to trigger hardware entry to S3.
1286
  /// mechanism) used to trigger hardware entry to S3.
1277
  /// Only the most recent suspend cycle's timer value is retained.
1287
  /// Only the most recent suspend cycle's timer value is retained.
1278
  ///
1288
  ///
1279
  UINT64                                          SuspendEnd;
1289
  UINT64                                         SuspendEnd;
1280
} EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD;
1290
} EFI_ACPI_5_0_FPDT_S3_SUSPEND_RECORD;
1281
1291
1282
///
1292
///
1283
/// Firmware Performance Record Table definition.
1293
/// Firmware Performance Record Table definition.
1284
///
1294
///
1285
typedef struct {
1295
typedef struct {
1286
  EFI_ACPI_DESCRIPTION_HEADER Header;
1296
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1287
} EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1297
} EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1288
1298
1289
///
1299
///
1290
/// Generic Timer Description Table definition.
1300
/// Generic Timer Description Table definition.
1291
///
1301
///
1292
typedef struct {
1302
typedef struct {
1293
  EFI_ACPI_DESCRIPTION_HEADER Header;
1303
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1294
  UINT64                      PhysicalAddress;
1304
  UINT64                         PhysicalAddress;
1295
  UINT32                      GlobalFlags;
1305
  UINT32                         GlobalFlags;
1296
  UINT32                      SecurePL1TimerGSIV;
1306
  UINT32                         SecurePL1TimerGSIV;
1297
  UINT32                      SecurePL1TimerFlags;
1307
  UINT32                         SecurePL1TimerFlags;
1298
  UINT32                      NonSecurePL1TimerGSIV;
1308
  UINT32                         NonSecurePL1TimerGSIV;
1299
  UINT32                      NonSecurePL1TimerFlags;
1309
  UINT32                         NonSecurePL1TimerFlags;
1300
  UINT32                      VirtualTimerGSIV;
1310
  UINT32                         VirtualTimerGSIV;
1301
  UINT32                      VirtualTimerFlags;
1311
  UINT32                         VirtualTimerFlags;
1302
  UINT32                      NonSecurePL2TimerGSIV;
1312
  UINT32                         NonSecurePL2TimerGSIV;
1303
  UINT32                      NonSecurePL2TimerFlags;
1313
  UINT32                         NonSecurePL2TimerFlags;
1304
} EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE;
1314
} EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE;
1305
1315
1306
///
1316
///
1307
/// GTDT Version (as defined in ACPI 5.0 spec.)
1317
/// GTDT Version (as defined in ACPI 5.0 spec.)
1308
///
1318
///
1309
#define EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION 0x01
1319
#define EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION  0x01
1310
1320
1311
///
1321
///
1312
/// Global Flags.  All other bits are reserved and must be 0.
1322
/// Global Flags.  All other bits are reserved and must be 0.
1313
///
1323
///
1314
#define EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_MEMORY_MAPPED_BLOCK_PRESENT   BIT0
1324
#define EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_MEMORY_MAPPED_BLOCK_PRESENT  BIT0
1315
#define EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_INTERRUPT_MODE                BIT1
1325
#define EFI_ACPI_5_0_GTDT_GLOBAL_FLAG_INTERRUPT_MODE               BIT1
1316
1326
1317
///
1327
///
1318
/// Timer Flags.  All other bits are reserved and must be 0.
1328
/// Timer Flags.  All other bits are reserved and must be 0.
1319
///
1329
///
1320
#define EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE          BIT0
1330
#define EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE      BIT0
1321
#define EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1331
#define EFI_ACPI_5_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1322
1332
1323
///
1333
///
1324
/// Boot Error Record Table (BERT)
1334
/// Boot Error Record Table (BERT)
1325
///
1335
///
1326
typedef struct {
1336
typedef struct {
1327
  EFI_ACPI_DESCRIPTION_HEADER Header;
1337
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1328
  UINT32                      BootErrorRegionLength;
1338
  UINT32                         BootErrorRegionLength;
1329
  UINT64                      BootErrorRegion;
1339
  UINT64                         BootErrorRegion;
1330
} EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_HEADER;
1340
} EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_HEADER;
1331
1341
1332
///
1342
///
1333
/// BERT Version (as defined in ACPI 5.0 spec.)
1343
/// BERT Version (as defined in ACPI 5.0 spec.)
1334
///
1344
///
1335
#define EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
1345
#define EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_REVISION  0x01
1336
1346
1337
///
1347
///
1338
/// Boot Error Region Block Status Definition
1348
/// Boot Error Region Block Status Definition
1339
///
1349
///
1340
typedef struct {
1350
typedef struct {
1341
  UINT32       UncorrectableErrorValid:1;
1351
  UINT32    UncorrectableErrorValid     : 1;
1342
  UINT32       CorrectableErrorValid:1;
1352
  UINT32    CorrectableErrorValid       : 1;
1343
  UINT32       MultipleUncorrectableErrors:1;
1353
  UINT32    MultipleUncorrectableErrors : 1;
1344
  UINT32       MultipleCorrectableErrors:1;
1354
  UINT32    MultipleCorrectableErrors   : 1;
1345
  UINT32       ErrorDataEntryCount:10;
1355
  UINT32    ErrorDataEntryCount         : 10;
1346
  UINT32       Reserved:18;
1356
  UINT32    Reserved                    : 18;
1347
} EFI_ACPI_5_0_ERROR_BLOCK_STATUS;
1357
} EFI_ACPI_5_0_ERROR_BLOCK_STATUS;
1348
1358
1349
///
1359
///
1350
/// Boot Error Region Definition
1360
/// Boot Error Region Definition
1351
///
1361
///
1352
typedef struct {
1362
typedef struct {
1353
  EFI_ACPI_5_0_ERROR_BLOCK_STATUS              BlockStatus;
1363
  EFI_ACPI_5_0_ERROR_BLOCK_STATUS    BlockStatus;
1354
  UINT32                                       RawDataOffset;
1364
  UINT32                             RawDataOffset;
1355
  UINT32                                       RawDataLength;
1365
  UINT32                             RawDataLength;
1356
  UINT32                                       DataLength;
1366
  UINT32                             DataLength;
1357
  UINT32                                       ErrorSeverity;
1367
  UINT32                             ErrorSeverity;
1358
} EFI_ACPI_5_0_BOOT_ERROR_REGION_STRUCTURE;
1368
} EFI_ACPI_5_0_BOOT_ERROR_REGION_STRUCTURE;
1359
1369
1360
//
1370
//
1361
// Boot Error Severity types
1371
// Boot Error Severity types
1362
//
1372
//
1363
#define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTABLE  0x00
1373
#define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTABLE  0x00
1374
#define EFI_ACPI_5_0_ERROR_SEVERITY_RECOVERABLE  0x00
1364
#define EFI_ACPI_5_0_ERROR_SEVERITY_FATAL        0x01
1375
#define EFI_ACPI_5_0_ERROR_SEVERITY_FATAL        0x01
1365
#define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTED    0x02
1376
#define EFI_ACPI_5_0_ERROR_SEVERITY_CORRECTED    0x02
1366
#define EFI_ACPI_5_0_ERROR_SEVERITY_NONE         0x03
1377
#define EFI_ACPI_5_0_ERROR_SEVERITY_NONE         0x03
Lines 1369-1382 typedef struct { Link Here
1369
/// Generic Error Data Entry Definition
1380
/// Generic Error Data Entry Definition
1370
///
1381
///
1371
typedef struct {
1382
typedef struct {
1372
  UINT8    SectionType[16];
1383
  UINT8     SectionType[16];
1373
  UINT32   ErrorSeverity;
1384
  UINT32    ErrorSeverity;
1374
  UINT16   Revision;
1385
  UINT16    Revision;
1375
  UINT8    ValidationBits;
1386
  UINT8     ValidationBits;
1376
  UINT8    Flags;
1387
  UINT8     Flags;
1377
  UINT32   ErrorDataLength;
1388
  UINT32    ErrorDataLength;
1378
  UINT8    FruId[16];
1389
  UINT8     FruId[16];
1379
  UINT8    FruText[20];
1390
  UINT8     FruText[20];
1380
} EFI_ACPI_5_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1391
} EFI_ACPI_5_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1381
1392
1382
///
1393
///
Lines 1388-1401 typedef struct { Link Here
1388
/// HEST - Hardware Error Source Table
1399
/// HEST - Hardware Error Source Table
1389
///
1400
///
1390
typedef struct {
1401
typedef struct {
1391
  EFI_ACPI_DESCRIPTION_HEADER Header;
1402
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1392
  UINT32                      ErrorSourceCount;
1403
  UINT32                         ErrorSourceCount;
1393
} EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1404
} EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1394
1405
1395
///
1406
///
1396
/// HEST Version (as defined in ACPI 5.0 spec.)
1407
/// HEST Version (as defined in ACPI 5.0 spec.)
1397
///
1408
///
1398
#define EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
1409
#define EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION  0x01
1399
1410
1400
//
1411
//
1401
// Error Source structure types.
1412
// Error Source structure types.
Lines 1411-1813 typedef struct { Link Here
1411
//
1422
//
1412
// Error Source structure flags.
1423
// Error Source structure flags.
1413
//
1424
//
1414
#define EFI_ACPI_5_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST       (1 << 0)
1425
#define EFI_ACPI_5_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST  (1 << 0)
1415
#define EFI_ACPI_5_0_ERROR_SOURCE_FLAG_GLOBAL               (1 << 1)
1426
#define EFI_ACPI_5_0_ERROR_SOURCE_FLAG_GLOBAL          (1 << 1)
1416
1427
1417
///
1428
///
1418
/// IA-32 Architecture Machine Check Exception Structure Definition
1429
/// IA-32 Architecture Machine Check Exception Structure Definition
1419
///
1430
///
1420
typedef struct {
1431
typedef struct {
1421
  UINT16  Type;
1432
  UINT16    Type;
1422
  UINT16  SourceId;
1433
  UINT16    SourceId;
1423
  UINT8   Reserved0[2];
1434
  UINT8     Reserved0[2];
1424
  UINT8   Flags;
1435
  UINT8     Flags;
1425
  UINT8   Enabled;
1436
  UINT8     Enabled;
1426
  UINT32  NumberOfRecordsToPreAllocate;
1437
  UINT32    NumberOfRecordsToPreAllocate;
1427
  UINT32  MaxSectionsPerRecord;
1438
  UINT32    MaxSectionsPerRecord;
1428
  UINT64  GlobalCapabilityInitData;
1439
  UINT64    GlobalCapabilityInitData;
1429
  UINT64  GlobalControlInitData;
1440
  UINT64    GlobalControlInitData;
1430
  UINT8   NumberOfHardwareBanks;
1441
  UINT8     NumberOfHardwareBanks;
1431
  UINT8   Reserved1[7];
1442
  UINT8     Reserved1[7];
1432
} EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1443
} EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1433
1444
1434
///
1445
///
1435
/// IA-32 Architecture Machine Check Bank Structure Definition
1446
/// IA-32 Architecture Machine Check Bank Structure Definition
1436
///
1447
///
1437
typedef struct {
1448
typedef struct {
1438
  UINT8   BankNumber;
1449
  UINT8     BankNumber;
1439
  UINT8   ClearStatusOnInitialization;
1450
  UINT8     ClearStatusOnInitialization;
1440
  UINT8   StatusDataFormat;
1451
  UINT8     StatusDataFormat;
1441
  UINT8   Reserved0;
1452
  UINT8     Reserved0;
1442
  UINT32  ControlRegisterMsrAddress;
1453
  UINT32    ControlRegisterMsrAddress;
1443
  UINT64  ControlInitData;
1454
  UINT64    ControlInitData;
1444
  UINT32  StatusRegisterMsrAddress;
1455
  UINT32    StatusRegisterMsrAddress;
1445
  UINT32  AddressRegisterMsrAddress;
1456
  UINT32    AddressRegisterMsrAddress;
1446
  UINT32  MiscRegisterMsrAddress;
1457
  UINT32    MiscRegisterMsrAddress;
1447
} EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1458
} EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1448
1459
1449
///
1460
///
1450
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1461
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1451
///
1462
///
1452
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32      0x00
1463
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32     0x00
1453
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64   0x01
1464
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64  0x01
1454
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64     0x02
1465
#define EFI_ACPI_5_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64    0x02
1455
1466
1456
//
1467
//
1457
// Hardware Error Notification types. All other values are reserved
1468
// Hardware Error Notification types. All other values are reserved
1458
//
1469
//
1459
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_POLLED                0x00
1470
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_POLLED              0x00
1460
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT    0x01
1471
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT  0x01
1461
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT       0x02
1472
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT     0x02
1462
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_SCI                   0x03
1473
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_SCI                 0x03
1463
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_NMI                   0x04
1474
#define EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_NMI                 0x04
1464
1475
1465
///
1476
///
1466
/// Hardware Error Notification Configuration Write Enable Structure Definition
1477
/// Hardware Error Notification Configuration Write Enable Structure Definition
1467
///
1478
///
1468
typedef struct {
1479
typedef struct {
1469
  UINT16    Type:1;
1480
  UINT16    Type                           : 1;
1470
  UINT16    PollInterval:1;
1481
  UINT16    PollInterval                   : 1;
1471
  UINT16    SwitchToPollingThresholdValue:1;
1482
  UINT16    SwitchToPollingThresholdValue  : 1;
1472
  UINT16    SwitchToPollingThresholdWindow:1;
1483
  UINT16    SwitchToPollingThresholdWindow : 1;
1473
  UINT16    ErrorThresholdValue:1;
1484
  UINT16    ErrorThresholdValue            : 1;
1474
  UINT16    ErrorThresholdWindow:1;
1485
  UINT16    ErrorThresholdWindow           : 1;
1475
  UINT16    Reserved:10;
1486
  UINT16    Reserved                       : 10;
1476
} EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1487
} EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1477
1488
1478
///
1489
///
1479
/// Hardware Error Notification Structure Definition
1490
/// Hardware Error Notification Structure Definition
1480
///
1491
///
1481
typedef struct {
1492
typedef struct {
1482
  UINT8                                                                          Type;
1493
  UINT8                                                                            Type;
1483
  UINT8                                                                          Length;
1494
  UINT8                                                                            Length;
1484
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE  ConfigurationWriteEnable;
1495
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE    ConfigurationWriteEnable;
1485
  UINT32                                                                         PollInterval;
1496
  UINT32                                                                           PollInterval;
1486
  UINT32                                                                         Vector;
1497
  UINT32                                                                           Vector;
1487
  UINT32                                                                         SwitchToPollingThresholdValue;
1498
  UINT32                                                                           SwitchToPollingThresholdValue;
1488
  UINT32                                                                         SwitchToPollingThresholdWindow;
1499
  UINT32                                                                           SwitchToPollingThresholdWindow;
1489
  UINT32                                                                         ErrorThresholdValue;
1500
  UINT32                                                                           ErrorThresholdValue;
1490
  UINT32                                                                         ErrorThresholdWindow;
1501
  UINT32                                                                           ErrorThresholdWindow;
1491
} EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1502
} EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1492
1503
1493
///
1504
///
1494
/// IA-32 Architecture Corrected Machine Check Structure Definition
1505
/// IA-32 Architecture Corrected Machine Check Structure Definition
1495
///
1506
///
1496
typedef struct {
1507
typedef struct {
1497
  UINT16                                                 Type;
1508
  UINT16                                                Type;
1498
  UINT16                                                 SourceId;
1509
  UINT16                                                SourceId;
1499
  UINT8                                                  Reserved0[2];
1510
  UINT8                                                 Reserved0[2];
1500
  UINT8                                                  Flags;
1511
  UINT8                                                 Flags;
1501
  UINT8                                                  Enabled;
1512
  UINT8                                                 Enabled;
1502
  UINT32                                                 NumberOfRecordsToPreAllocate;
1513
  UINT32                                                NumberOfRecordsToPreAllocate;
1503
  UINT32                                                 MaxSectionsPerRecord;
1514
  UINT32                                                MaxSectionsPerRecord;
1504
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1515
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1505
  UINT8                                                  NumberOfHardwareBanks;
1516
  UINT8                                                 NumberOfHardwareBanks;
1506
  UINT8                                                  Reserved1[3];
1517
  UINT8                                                 Reserved1[3];
1507
} EFI_ACPI_5_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1518
} EFI_ACPI_5_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1508
1519
1509
///
1520
///
1510
/// IA-32 Architecture NMI Error Structure Definition
1521
/// IA-32 Architecture NMI Error Structure Definition
1511
///
1522
///
1512
typedef struct {
1523
typedef struct {
1513
  UINT16  Type;
1524
  UINT16    Type;
1514
  UINT16  SourceId;
1525
  UINT16    SourceId;
1515
  UINT8   Reserved0[2];
1526
  UINT8     Reserved0[2];
1516
  UINT32  NumberOfRecordsToPreAllocate;
1527
  UINT32    NumberOfRecordsToPreAllocate;
1517
  UINT32  MaxSectionsPerRecord;
1528
  UINT32    MaxSectionsPerRecord;
1518
  UINT32  MaxRawDataLength;
1529
  UINT32    MaxRawDataLength;
1519
} EFI_ACPI_5_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1530
} EFI_ACPI_5_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1520
1531
1521
///
1532
///
1522
/// PCI Express Root Port AER Structure Definition
1533
/// PCI Express Root Port AER Structure Definition
1523
///
1534
///
1524
typedef struct {
1535
typedef struct {
1525
  UINT16  Type;
1536
  UINT16    Type;
1526
  UINT16  SourceId;
1537
  UINT16    SourceId;
1527
  UINT8   Reserved0[2];
1538
  UINT8     Reserved0[2];
1528
  UINT8   Flags;
1539
  UINT8     Flags;
1529
  UINT8   Enabled;
1540
  UINT8     Enabled;
1530
  UINT32  NumberOfRecordsToPreAllocate;
1541
  UINT32    NumberOfRecordsToPreAllocate;
1531
  UINT32  MaxSectionsPerRecord;
1542
  UINT32    MaxSectionsPerRecord;
1532
  UINT32  Bus;
1543
  UINT32    Bus;
1533
  UINT16  Device;
1544
  UINT16    Device;
1534
  UINT16  Function;
1545
  UINT16    Function;
1535
  UINT16  DeviceControl;
1546
  UINT16    DeviceControl;
1536
  UINT8   Reserved1[2];
1547
  UINT8     Reserved1[2];
1537
  UINT32  UncorrectableErrorMask;
1548
  UINT32    UncorrectableErrorMask;
1538
  UINT32  UncorrectableErrorSeverity;
1549
  UINT32    UncorrectableErrorSeverity;
1539
  UINT32  CorrectableErrorMask;
1550
  UINT32    CorrectableErrorMask;
1540
  UINT32  AdvancedErrorCapabilitiesAndControl;
1551
  UINT32    AdvancedErrorCapabilitiesAndControl;
1541
  UINT32  RootErrorCommand;
1552
  UINT32    RootErrorCommand;
1542
} EFI_ACPI_5_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1553
} EFI_ACPI_5_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1543
1554
1544
///
1555
///
1545
/// PCI Express Device AER Structure Definition
1556
/// PCI Express Device AER Structure Definition
1546
///
1557
///
1547
typedef struct {
1558
typedef struct {
1548
  UINT16  Type;
1559
  UINT16    Type;
1549
  UINT16  SourceId;
1560
  UINT16    SourceId;
1550
  UINT8   Reserved0[2];
1561
  UINT8     Reserved0[2];
1551
  UINT8   Flags;
1562
  UINT8     Flags;
1552
  UINT8   Enabled;
1563
  UINT8     Enabled;
1553
  UINT32  NumberOfRecordsToPreAllocate;
1564
  UINT32    NumberOfRecordsToPreAllocate;
1554
  UINT32  MaxSectionsPerRecord;
1565
  UINT32    MaxSectionsPerRecord;
1555
  UINT32  Bus;
1566
  UINT32    Bus;
1556
  UINT16  Device;
1567
  UINT16    Device;
1557
  UINT16  Function;
1568
  UINT16    Function;
1558
  UINT16  DeviceControl;
1569
  UINT16    DeviceControl;
1559
  UINT8   Reserved1[2];
1570
  UINT8     Reserved1[2];
1560
  UINT32  UncorrectableErrorMask;
1571
  UINT32    UncorrectableErrorMask;
1561
  UINT32  UncorrectableErrorSeverity;
1572
  UINT32    UncorrectableErrorSeverity;
1562
  UINT32  CorrectableErrorMask;
1573
  UINT32    CorrectableErrorMask;
1563
  UINT32  AdvancedErrorCapabilitiesAndControl;
1574
  UINT32    AdvancedErrorCapabilitiesAndControl;
1564
} EFI_ACPI_5_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1575
} EFI_ACPI_5_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1565
1576
1566
///
1577
///
1567
/// PCI Express Bridge AER Structure Definition
1578
/// PCI Express Bridge AER Structure Definition
1568
///
1579
///
1569
typedef struct {
1580
typedef struct {
1570
  UINT16  Type;
1581
  UINT16    Type;
1571
  UINT16  SourceId;
1582
  UINT16    SourceId;
1572
  UINT8   Reserved0[2];
1583
  UINT8     Reserved0[2];
1573
  UINT8   Flags;
1584
  UINT8     Flags;
1574
  UINT8   Enabled;
1585
  UINT8     Enabled;
1575
  UINT32  NumberOfRecordsToPreAllocate;
1586
  UINT32    NumberOfRecordsToPreAllocate;
1576
  UINT32  MaxSectionsPerRecord;
1587
  UINT32    MaxSectionsPerRecord;
1577
  UINT32  Bus;
1588
  UINT32    Bus;
1578
  UINT16  Device;
1589
  UINT16    Device;
1579
  UINT16  Function;
1590
  UINT16    Function;
1580
  UINT16  DeviceControl;
1591
  UINT16    DeviceControl;
1581
  UINT8   Reserved1[2];
1592
  UINT8     Reserved1[2];
1582
  UINT32  UncorrectableErrorMask;
1593
  UINT32    UncorrectableErrorMask;
1583
  UINT32  UncorrectableErrorSeverity;
1594
  UINT32    UncorrectableErrorSeverity;
1584
  UINT32  CorrectableErrorMask;
1595
  UINT32    CorrectableErrorMask;
1585
  UINT32  AdvancedErrorCapabilitiesAndControl;
1596
  UINT32    AdvancedErrorCapabilitiesAndControl;
1586
  UINT32  SecondaryUncorrectableErrorMask;
1597
  UINT32    SecondaryUncorrectableErrorMask;
1587
  UINT32  SecondaryUncorrectableErrorSeverity;
1598
  UINT32    SecondaryUncorrectableErrorSeverity;
1588
  UINT32  SecondaryAdvancedErrorCapabilitiesAndControl;
1599
  UINT32    SecondaryAdvancedErrorCapabilitiesAndControl;
1589
} EFI_ACPI_5_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1600
} EFI_ACPI_5_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1590
1601
1591
///
1602
///
1592
/// Generic Hardware Error Source Structure Definition
1603
/// Generic Hardware Error Source Structure Definition
1593
///
1604
///
1594
typedef struct {
1605
typedef struct {
1595
  UINT16                                                 Type;
1606
  UINT16                                                Type;
1596
  UINT16                                                 SourceId;
1607
  UINT16                                                SourceId;
1597
  UINT16                                                 RelatedSourceId;
1608
  UINT16                                                RelatedSourceId;
1598
  UINT8                                                  Flags;
1609
  UINT8                                                 Flags;
1599
  UINT8                                                  Enabled;
1610
  UINT8                                                 Enabled;
1600
  UINT32                                                 NumberOfRecordsToPreAllocate;
1611
  UINT32                                                NumberOfRecordsToPreAllocate;
1601
  UINT32                                                 MaxSectionsPerRecord;
1612
  UINT32                                                MaxSectionsPerRecord;
1602
  UINT32                                                 MaxRawDataLength;
1613
  UINT32                                                MaxRawDataLength;
1603
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE                 ErrorStatusAddress;
1614
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE                ErrorStatusAddress;
1604
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1615
  EFI_ACPI_5_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1605
  UINT32                                                 ErrorStatusBlockLength;
1616
  UINT32                                                ErrorStatusBlockLength;
1606
} EFI_ACPI_5_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1617
} EFI_ACPI_5_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1607
1618
1608
///
1619
///
1609
/// Generic Error Status Definition
1620
/// Generic Error Status Definition
1610
///
1621
///
1611
typedef struct {
1622
typedef struct {
1612
  EFI_ACPI_5_0_ERROR_BLOCK_STATUS              BlockStatus;
1623
  EFI_ACPI_5_0_ERROR_BLOCK_STATUS    BlockStatus;
1613
  UINT32                                       RawDataOffset;
1624
  UINT32                             RawDataOffset;
1614
  UINT32                                       RawDataLength;
1625
  UINT32                             RawDataLength;
1615
  UINT32                                       DataLength;
1626
  UINT32                             DataLength;
1616
  UINT32                                       ErrorSeverity;
1627
  UINT32                             ErrorSeverity;
1617
} EFI_ACPI_5_0_GENERIC_ERROR_STATUS_STRUCTURE;
1628
} EFI_ACPI_5_0_GENERIC_ERROR_STATUS_STRUCTURE;
1618
1629
1619
///
1630
///
1620
/// ERST - Error Record Serialization Table
1631
/// ERST - Error Record Serialization Table
1621
///
1632
///
1622
typedef struct {
1633
typedef struct {
1623
  EFI_ACPI_DESCRIPTION_HEADER Header;
1634
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1624
  UINT32                      SerializationHeaderSize;
1635
  UINT32                         SerializationHeaderSize;
1625
  UINT8                       Reserved0[4];
1636
  UINT8                          Reserved0[4];
1626
  UINT32                      InstructionEntryCount;
1637
  UINT32                         InstructionEntryCount;
1627
} EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1638
} EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1628
1639
1629
///
1640
///
1630
/// ERST Version (as defined in ACPI 5.0 spec.)
1641
/// ERST Version (as defined in ACPI 5.0 spec.)
1631
///
1642
///
1632
#define EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
1643
#define EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION  0x01
1633
1644
1634
///
1645
///
1635
/// ERST Serialization Actions
1646
/// ERST Serialization Actions
1636
///
1647
///
1637
#define EFI_ACPI_5_0_ERST_BEGIN_WRITE_OPERATION                    0x00
1648
#define EFI_ACPI_5_0_ERST_BEGIN_WRITE_OPERATION                   0x00
1638
#define EFI_ACPI_5_0_ERST_BEGIN_READ_OPERATION                     0x01
1649
#define EFI_ACPI_5_0_ERST_BEGIN_READ_OPERATION                    0x01
1639
#define EFI_ACPI_5_0_ERST_BEGIN_CLEAR_OPERATION                    0x02
1650
#define EFI_ACPI_5_0_ERST_BEGIN_CLEAR_OPERATION                   0x02
1640
#define EFI_ACPI_5_0_ERST_END_OPERATION                            0x03
1651
#define EFI_ACPI_5_0_ERST_END_OPERATION                           0x03
1641
#define EFI_ACPI_5_0_ERST_SET_RECORD_OFFSET                        0x04
1652
#define EFI_ACPI_5_0_ERST_SET_RECORD_OFFSET                       0x04
1642
#define EFI_ACPI_5_0_ERST_EXECUTE_OPERATION                        0x05
1653
#define EFI_ACPI_5_0_ERST_EXECUTE_OPERATION                       0x05
1643
#define EFI_ACPI_5_0_ERST_CHECK_BUSY_STATUS                        0x06
1654
#define EFI_ACPI_5_0_ERST_CHECK_BUSY_STATUS                       0x06
1644
#define EFI_ACPI_5_0_ERST_GET_COMMAND_STATUS                       0x07
1655
#define EFI_ACPI_5_0_ERST_GET_COMMAND_STATUS                      0x07
1645
#define EFI_ACPI_5_0_ERST_GET_RECORD_IDENTIFIER                    0x08
1656
#define EFI_ACPI_5_0_ERST_GET_RECORD_IDENTIFIER                   0x08
1646
#define EFI_ACPI_5_0_ERST_SET_RECORD_IDENTIFIER                    0x09
1657
#define EFI_ACPI_5_0_ERST_SET_RECORD_IDENTIFIER                   0x09
1647
#define EFI_ACPI_5_0_ERST_GET_RECORD_COUNT                         0x0A
1658
#define EFI_ACPI_5_0_ERST_GET_RECORD_COUNT                        0x0A
1648
#define EFI_ACPI_5_0_ERST_BEGIN_DUMMY_WRITE_OPERATION              0x0B
1659
#define EFI_ACPI_5_0_ERST_BEGIN_DUMMY_WRITE_OPERATION             0x0B
1649
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE              0x0D
1660
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE             0x0D
1650
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH       0x0E
1661
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH      0x0E
1651
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES   0x0F
1662
#define EFI_ACPI_5_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES  0x0F
1652
1663
1653
///
1664
///
1654
/// ERST Action Command Status
1665
/// ERST Action Command Status
1655
///
1666
///
1656
#define EFI_ACPI_5_0_ERST_STATUS_SUCCESS                           0x00
1667
#define EFI_ACPI_5_0_ERST_STATUS_SUCCESS                 0x00
1657
#define EFI_ACPI_5_0_ERST_STATUS_NOT_ENOUGH_SPACE                  0x01
1668
#define EFI_ACPI_5_0_ERST_STATUS_NOT_ENOUGH_SPACE        0x01
1658
#define EFI_ACPI_5_0_ERST_STATUS_HARDWARE_NOT_AVAILABLE            0x02
1669
#define EFI_ACPI_5_0_ERST_STATUS_HARDWARE_NOT_AVAILABLE  0x02
1659
#define EFI_ACPI_5_0_ERST_STATUS_FAILED                            0x03
1670
#define EFI_ACPI_5_0_ERST_STATUS_FAILED                  0x03
1660
#define EFI_ACPI_5_0_ERST_STATUS_RECORD_STORE_EMPTY                0x04
1671
#define EFI_ACPI_5_0_ERST_STATUS_RECORD_STORE_EMPTY      0x04
1661
#define EFI_ACPI_5_0_ERST_STATUS_RECORD_NOT_FOUND                  0x05
1672
#define EFI_ACPI_5_0_ERST_STATUS_RECORD_NOT_FOUND        0x05
1662
1673
1663
///
1674
///
1664
/// ERST Serialization Instructions
1675
/// ERST Serialization Instructions
1665
///
1676
///
1666
#define EFI_ACPI_5_0_ERST_READ_REGISTER                            0x00
1677
#define EFI_ACPI_5_0_ERST_READ_REGISTER                  0x00
1667
#define EFI_ACPI_5_0_ERST_READ_REGISTER_VALUE                      0x01
1678
#define EFI_ACPI_5_0_ERST_READ_REGISTER_VALUE            0x01
1668
#define EFI_ACPI_5_0_ERST_WRITE_REGISTER                           0x02
1679
#define EFI_ACPI_5_0_ERST_WRITE_REGISTER                 0x02
1669
#define EFI_ACPI_5_0_ERST_WRITE_REGISTER_VALUE                     0x03
1680
#define EFI_ACPI_5_0_ERST_WRITE_REGISTER_VALUE           0x03
1670
#define EFI_ACPI_5_0_ERST_NOOP                                     0x04
1681
#define EFI_ACPI_5_0_ERST_NOOP                           0x04
1671
#define EFI_ACPI_5_0_ERST_LOAD_VAR1                                0x05
1682
#define EFI_ACPI_5_0_ERST_LOAD_VAR1                      0x05
1672
#define EFI_ACPI_5_0_ERST_LOAD_VAR2                                0x06
1683
#define EFI_ACPI_5_0_ERST_LOAD_VAR2                      0x06
1673
#define EFI_ACPI_5_0_ERST_STORE_VAR1                               0x07
1684
#define EFI_ACPI_5_0_ERST_STORE_VAR1                     0x07
1674
#define EFI_ACPI_5_0_ERST_ADD                                      0x08
1685
#define EFI_ACPI_5_0_ERST_ADD                            0x08
1675
#define EFI_ACPI_5_0_ERST_SUBTRACT                                 0x09
1686
#define EFI_ACPI_5_0_ERST_SUBTRACT                       0x09
1676
#define EFI_ACPI_5_0_ERST_ADD_VALUE                                0x0A
1687
#define EFI_ACPI_5_0_ERST_ADD_VALUE                      0x0A
1677
#define EFI_ACPI_5_0_ERST_SUBTRACT_VALUE                           0x0B
1688
#define EFI_ACPI_5_0_ERST_SUBTRACT_VALUE                 0x0B
1678
#define EFI_ACPI_5_0_ERST_STALL                                    0x0C
1689
#define EFI_ACPI_5_0_ERST_STALL                          0x0C
1679
#define EFI_ACPI_5_0_ERST_STALL_WHILE_TRUE                         0x0D
1690
#define EFI_ACPI_5_0_ERST_STALL_WHILE_TRUE               0x0D
1680
#define EFI_ACPI_5_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE            0x0E
1691
#define EFI_ACPI_5_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE  0x0E
1681
#define EFI_ACPI_5_0_ERST_GOTO                                     0x0F
1692
#define EFI_ACPI_5_0_ERST_GOTO                           0x0F
1682
#define EFI_ACPI_5_0_ERST_SET_SRC_ADDRESS_BASE                     0x10
1693
#define EFI_ACPI_5_0_ERST_SET_SRC_ADDRESS_BASE           0x10
1683
#define EFI_ACPI_5_0_ERST_SET_DST_ADDRESS_BASE                     0x11
1694
#define EFI_ACPI_5_0_ERST_SET_DST_ADDRESS_BASE           0x11
1684
#define EFI_ACPI_5_0_ERST_MOVE_DATA                                0x12
1695
#define EFI_ACPI_5_0_ERST_MOVE_DATA                      0x12
1685
1696
1686
///
1697
///
1687
/// ERST Instruction Flags
1698
/// ERST Instruction Flags
1688
///
1699
///
1689
#define EFI_ACPI_5_0_ERST_PRESERVE_REGISTER                        0x01
1700
#define EFI_ACPI_5_0_ERST_PRESERVE_REGISTER  0x01
1690
1701
1691
///
1702
///
1692
/// ERST Serialization Instruction Entry
1703
/// ERST Serialization Instruction Entry
1693
///
1704
///
1694
typedef struct {
1705
typedef struct {
1695
  UINT8                                    SerializationAction;
1706
  UINT8                                     SerializationAction;
1696
  UINT8                                    Instruction;
1707
  UINT8                                     Instruction;
1697
  UINT8                                    Flags;
1708
  UINT8                                     Flags;
1698
  UINT8                                    Reserved0;
1709
  UINT8                                     Reserved0;
1699
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1710
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1700
  UINT64                                   Value;
1711
  UINT64                                    Value;
1701
  UINT64                                   Mask;
1712
  UINT64                                    Mask;
1702
} EFI_ACPI_5_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1713
} EFI_ACPI_5_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1703
1714
1704
///
1715
///
1705
/// EINJ - Error Injection Table
1716
/// EINJ - Error Injection Table
1706
///
1717
///
1707
typedef struct {
1718
typedef struct {
1708
  EFI_ACPI_DESCRIPTION_HEADER Header;
1719
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1709
  UINT32                      InjectionHeaderSize;
1720
  UINT32                         InjectionHeaderSize;
1710
  UINT8                       InjectionFlags;
1721
  UINT8                          InjectionFlags;
1711
  UINT8                       Reserved0[3];
1722
  UINT8                          Reserved0[3];
1712
  UINT32                      InjectionEntryCount;
1723
  UINT32                         InjectionEntryCount;
1713
} EFI_ACPI_5_0_ERROR_INJECTION_TABLE_HEADER;
1724
} EFI_ACPI_5_0_ERROR_INJECTION_TABLE_HEADER;
1714
1725
1715
///
1726
///
1716
/// EINJ Version (as defined in ACPI 5.0 spec.)
1727
/// EINJ Version (as defined in ACPI 5.0 spec.)
1717
///
1728
///
1718
#define EFI_ACPI_5_0_ERROR_INJECTION_TABLE_REVISION 0x01
1729
#define EFI_ACPI_5_0_ERROR_INJECTION_TABLE_REVISION  0x01
1719
1730
1720
///
1731
///
1721
/// EINJ Error Injection Actions
1732
/// EINJ Error Injection Actions
1722
///
1733
///
1723
#define EFI_ACPI_5_0_EINJ_BEGIN_INJECTION_OPERATION                0x00
1734
#define EFI_ACPI_5_0_EINJ_BEGIN_INJECTION_OPERATION       0x00
1724
#define EFI_ACPI_5_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE           0x01
1735
#define EFI_ACPI_5_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE  0x01
1725
#define EFI_ACPI_5_0_EINJ_SET_ERROR_TYPE                           0x02
1736
#define EFI_ACPI_5_0_EINJ_SET_ERROR_TYPE                  0x02
1726
#define EFI_ACPI_5_0_EINJ_GET_ERROR_TYPE                           0x03
1737
#define EFI_ACPI_5_0_EINJ_GET_ERROR_TYPE                  0x03
1727
#define EFI_ACPI_5_0_EINJ_END_OPERATION                            0x04
1738
#define EFI_ACPI_5_0_EINJ_END_OPERATION                   0x04
1728
#define EFI_ACPI_5_0_EINJ_EXECUTE_OPERATION                        0x05
1739
#define EFI_ACPI_5_0_EINJ_EXECUTE_OPERATION               0x05
1729
#define EFI_ACPI_5_0_EINJ_CHECK_BUSY_STATUS                        0x06
1740
#define EFI_ACPI_5_0_EINJ_CHECK_BUSY_STATUS               0x06
1730
#define EFI_ACPI_5_0_EINJ_GET_COMMAND_STATUS                       0x07
1741
#define EFI_ACPI_5_0_EINJ_GET_COMMAND_STATUS              0x07
1731
#define EFI_ACPI_5_0_EINJ_TRIGGER_ERROR                            0xFF
1742
#define EFI_ACPI_5_0_EINJ_TRIGGER_ERROR                   0xFF
1732
1743
1733
///
1744
///
1734
/// EINJ Action Command Status
1745
/// EINJ Action Command Status
1735
///
1746
///
1736
#define EFI_ACPI_5_0_EINJ_STATUS_SUCCESS                           0x00
1747
#define EFI_ACPI_5_0_EINJ_STATUS_SUCCESS          0x00
1737
#define EFI_ACPI_5_0_EINJ_STATUS_UNKNOWN_FAILURE                   0x01
1748
#define EFI_ACPI_5_0_EINJ_STATUS_UNKNOWN_FAILURE  0x01
1738
#define EFI_ACPI_5_0_EINJ_STATUS_INVALID_ACCESS                    0x02
1749
#define EFI_ACPI_5_0_EINJ_STATUS_INVALID_ACCESS   0x02
1739
1750
1740
///
1751
///
1741
/// EINJ Error Type Definition
1752
/// EINJ Error Type Definition
1742
///
1753
///
1743
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_CORRECTABLE                 (1 << 0)
1754
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_CORRECTABLE               (1 << 0)
1744
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL      (1 << 1)
1755
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL    (1 << 1)
1745
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL         (1 << 2)
1756
#define EFI_ACPI_5_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL       (1 << 2)
1746
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_CORRECTABLE                    (1 << 3)
1757
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_CORRECTABLE                  (1 << 3)
1747
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL         (1 << 4)
1758
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL       (1 << 4)
1748
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL            (1 << 5)
1759
#define EFI_ACPI_5_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL          (1 << 5)
1749
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE               (1 << 6)
1760
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE             (1 << 6)
1750
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL    (1 << 7)
1761
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL  (1 << 7)
1751
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL       (1 << 8)
1762
#define EFI_ACPI_5_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL     (1 << 8)
1752
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_CORRECTABLE                  (1 << 9)
1763
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_CORRECTABLE                (1 << 9)
1753
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL       (1 << 10)
1764
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL     (1 << 10)
1754
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL          (1 << 11)
1765
#define EFI_ACPI_5_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL        (1 << 11)
1755
1766
1756
///
1767
///
1757
/// EINJ Injection Instructions
1768
/// EINJ Injection Instructions
1758
///
1769
///
1759
#define EFI_ACPI_5_0_EINJ_READ_REGISTER                            0x00
1770
#define EFI_ACPI_5_0_EINJ_READ_REGISTER         0x00
1760
#define EFI_ACPI_5_0_EINJ_READ_REGISTER_VALUE                      0x01
1771
#define EFI_ACPI_5_0_EINJ_READ_REGISTER_VALUE   0x01
1761
#define EFI_ACPI_5_0_EINJ_WRITE_REGISTER                           0x02
1772
#define EFI_ACPI_5_0_EINJ_WRITE_REGISTER        0x02
1762
#define EFI_ACPI_5_0_EINJ_WRITE_REGISTER_VALUE                     0x03
1773
#define EFI_ACPI_5_0_EINJ_WRITE_REGISTER_VALUE  0x03
1763
#define EFI_ACPI_5_0_EINJ_NOOP                                     0x04
1774
#define EFI_ACPI_5_0_EINJ_NOOP                  0x04
1764
1775
1765
///
1776
///
1766
/// EINJ Instruction Flags
1777
/// EINJ Instruction Flags
1767
///
1778
///
1768
#define EFI_ACPI_5_0_EINJ_PRESERVE_REGISTER                        0x01
1779
#define EFI_ACPI_5_0_EINJ_PRESERVE_REGISTER  0x01
1769
1780
1770
///
1781
///
1771
/// EINJ Injection Instruction Entry
1782
/// EINJ Injection Instruction Entry
1772
///
1783
///
1773
typedef struct {
1784
typedef struct {
1774
  UINT8                                    InjectionAction;
1785
  UINT8                                     InjectionAction;
1775
  UINT8                                    Instruction;
1786
  UINT8                                     Instruction;
1776
  UINT8                                    Flags;
1787
  UINT8                                     Flags;
1777
  UINT8                                    Reserved0;
1788
  UINT8                                     Reserved0;
1778
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1789
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1779
  UINT64                                   Value;
1790
  UINT64                                    Value;
1780
  UINT64                                   Mask;
1791
  UINT64                                    Mask;
1781
} EFI_ACPI_5_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1792
} EFI_ACPI_5_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1782
1793
1783
///
1794
///
1784
/// EINJ Trigger Action Table
1795
/// EINJ Trigger Action Table
1785
///
1796
///
1786
typedef struct {
1797
typedef struct {
1787
  UINT32  HeaderSize;
1798
  UINT32    HeaderSize;
1788
  UINT32  Revision;
1799
  UINT32    Revision;
1789
  UINT32  TableSize;
1800
  UINT32    TableSize;
1790
  UINT32  EntryCount;
1801
  UINT32    EntryCount;
1791
} EFI_ACPI_5_0_EINJ_TRIGGER_ACTION_TABLE;
1802
} EFI_ACPI_5_0_EINJ_TRIGGER_ACTION_TABLE;
1792
1803
1793
///
1804
///
1794
/// Platform Communications Channel Table (PCCT)
1805
/// Platform Communications Channel Table (PCCT)
1795
///
1806
///
1796
typedef struct {
1807
typedef struct {
1797
  EFI_ACPI_DESCRIPTION_HEADER Header;
1808
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1798
  UINT32                      Flags;
1809
  UINT32                         Flags;
1799
  UINT64                      Reserved;
1810
  UINT64                         Reserved;
1800
} EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
1811
} EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
1801
1812
1802
///
1813
///
1803
/// PCCT Version (as defined in ACPI 5.0 spec.)
1814
/// PCCT Version (as defined in ACPI 5.0 spec.)
1804
///
1815
///
1805
#define EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION 0x01
1816
#define EFI_ACPI_5_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION  0x01
1806
1817
1807
///
1818
///
1808
/// PCCT Global Flags
1819
/// PCCT Global Flags
1809
///
1820
///
1810
#define EFI_ACPI_5_0_PCCT_FLAGS_SCI_DOORBELL                      BIT0
1821
#define EFI_ACPI_5_0_PCCT_FLAGS_SCI_DOORBELL  BIT0
1811
1822
1812
//
1823
//
1813
// PCCT Subspace type
1824
// PCCT Subspace type
Lines 1818-1842 typedef struct { Link Here
1818
/// PCC Subspace Structure Header
1829
/// PCC Subspace Structure Header
1819
///
1830
///
1820
typedef struct {
1831
typedef struct {
1821
  UINT8        Type;
1832
  UINT8    Type;
1822
  UINT8        Length;
1833
  UINT8    Length;
1823
} EFI_ACPI_5_0_PCCT_SUBSPACE_HEADER;
1834
} EFI_ACPI_5_0_PCCT_SUBSPACE_HEADER;
1824
1835
1825
///
1836
///
1826
/// Generic Communications Subspace Structure
1837
/// Generic Communications Subspace Structure
1827
///
1838
///
1828
typedef struct {
1839
typedef struct {
1829
  UINT8                                    Type;
1840
  UINT8                                     Type;
1830
  UINT8                                    Length;
1841
  UINT8                                     Length;
1831
  UINT8                                    Reserved[6];
1842
  UINT8                                     Reserved[6];
1832
  UINT64                                   BaseAddress;
1843
  UINT64                                    BaseAddress;
1833
  UINT64                                   AddressLength;
1844
  UINT64                                    AddressLength;
1834
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE   DoorbellRegister;
1845
  EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE    DoorbellRegister;
1835
  UINT64                                   DoorbellPreserve;
1846
  UINT64                                    DoorbellPreserve;
1836
  UINT64                                   DoorbellWrite;
1847
  UINT64                                    DoorbellWrite;
1837
  UINT32                                   NominalLatency;
1848
  UINT32                                    NominalLatency;
1838
  UINT32                                   MaximumPeriodicAccessRate;
1849
  UINT32                                    MaximumPeriodicAccessRate;
1839
  UINT16                                   MinimumRequestTurnaroundTime;
1850
  UINT16                                    MinimumRequestTurnaroundTime;
1840
} EFI_ACPI_5_0_PCCT_SUBSPACE_GENERIC;
1851
} EFI_ACPI_5_0_PCCT_SUBSPACE_GENERIC;
1841
1852
1842
///
1853
///
Lines 1844-1861 typedef struct { Link Here
1844
///
1855
///
1845
1856
1846
typedef struct {
1857
typedef struct {
1847
  UINT8                                    Command;
1858
  UINT8    Command;
1848
  UINT8                                    Reserved:7;
1859
  UINT8    Reserved    : 7;
1849
  UINT8                                    GenerateSci:1;
1860
  UINT8    GenerateSci : 1;
1850
} EFI_ACPI_5_0_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
1861
} EFI_ACPI_5_0_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
1851
1862
1852
typedef struct {
1863
typedef struct {
1853
  UINT8                                    CommandComplete:1;
1864
  UINT8    CommandComplete      : 1;
1854
  UINT8                                    SciDoorbell:1;
1865
  UINT8    SciDoorbell          : 1;
1855
  UINT8                                    Error:1;
1866
  UINT8    Error                : 1;
1856
  UINT8                                    PlatformNotification:1;
1867
  UINT8    PlatformNotification : 1;
1857
  UINT8                                    Reserved:4;
1868
  UINT8    Reserved             : 4;
1858
  UINT8                                    Reserved1;
1869
  UINT8    Reserved1;
1859
} EFI_ACPI_5_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
1870
} EFI_ACPI_5_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
1860
1871
1861
typedef struct {
1872
typedef struct {
Lines 2097-2103 typedef struct { Link Here
2097
/// "WAET" Windows ACPI Emulated Devices Table
2108
/// "WAET" Windows ACPI Emulated Devices Table
2098
///
2109
///
2099
#define EFI_ACPI_5_0_WINDOWS_ACPI_EMULATED_DEVICES_TABLE_SIGNATURE  SIGNATURE_32('W', 'A', 'E', 'T')
2110
#define EFI_ACPI_5_0_WINDOWS_ACPI_EMULATED_DEVICES_TABLE_SIGNATURE  SIGNATURE_32('W', 'A', 'E', 'T')
2100
#define EFI_ACPI_5_0_WINDOWS_ACPI_ENLIGHTENMENT_TABLE_SIGNATURE  EFI_ACPI_5_0_WINDOWS_ACPI_EMULATED_DEVICES_TABLE_SIGNATURE
2111
#define EFI_ACPI_5_0_WINDOWS_ACPI_ENLIGHTENMENT_TABLE_SIGNATURE     EFI_ACPI_5_0_WINDOWS_ACPI_EMULATED_DEVICES_TABLE_SIGNATURE
2101
2112
2102
///
2113
///
2103
/// "WDAT" Watchdog Action Table
2114
/// "WDAT" Watchdog Action Table
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi51.h (-807 / +823 lines)
Lines 2-8 Link Here
2
  ACPI 5.1 definitions from the ACPI Specification Revision 5.1 Errata B January, 2016.
2
  ACPI 5.1 definitions from the ACPI Specification Revision 5.1 Errata B January, 2016.
3
3
4
  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
4
  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
5
  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
5
  Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>
6
  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
6
  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
7
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
7
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
8
  SPDX-License-Identifier: BSD-2-Clause-Patent
8
  SPDX-License-Identifier: BSD-2-Clause-Patent
Lines 13-18 Link Here
13
13
14
#include <IndustryStandard/Acpi50.h>
14
#include <IndustryStandard/Acpi50.h>
15
15
16
///
17
/// _PSD Revision for ACPI 5.1
18
///
19
#define EFI_ACPI_5_1_AML_PSD_REVISION  0
20
21
///
22
/// _CPC Revision for ACPI 5.1
23
///
24
#define EFI_ACPI_5_1_AML_CPC_REVISION  2
25
16
//
26
//
17
// Ensure proper structure formats
27
// Ensure proper structure formats
18
//
28
//
Lines 22-42 Link Here
22
/// ACPI 5.1 Generic Address Space definition
32
/// ACPI 5.1 Generic Address Space definition
23
///
33
///
24
typedef struct {
34
typedef struct {
25
  UINT8   AddressSpaceId;
35
  UINT8     AddressSpaceId;
26
  UINT8   RegisterBitWidth;
36
  UINT8     RegisterBitWidth;
27
  UINT8   RegisterBitOffset;
37
  UINT8     RegisterBitOffset;
28
  UINT8   AccessSize;
38
  UINT8     AccessSize;
29
  UINT64  Address;
39
  UINT64    Address;
30
} EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE;
40
} EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE;
31
41
32
//
42
//
33
// Generic Address Space Address IDs
43
// Generic Address Space Address IDs
34
//
44
//
35
#define EFI_ACPI_5_1_SYSTEM_MEMORY              0
45
#define EFI_ACPI_5_1_SYSTEM_MEMORY                   0
36
#define EFI_ACPI_5_1_SYSTEM_IO                  1
46
#define EFI_ACPI_5_1_SYSTEM_IO                       1
37
#define EFI_ACPI_5_1_PCI_CONFIGURATION_SPACE    2
47
#define EFI_ACPI_5_1_PCI_CONFIGURATION_SPACE         2
38
#define EFI_ACPI_5_1_EMBEDDED_CONTROLLER        3
48
#define EFI_ACPI_5_1_EMBEDDED_CONTROLLER             3
39
#define EFI_ACPI_5_1_SMBUS                      4
49
#define EFI_ACPI_5_1_SMBUS                           4
40
#define EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL  0x0A
50
#define EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL  0x0A
41
#define EFI_ACPI_5_1_FUNCTIONAL_FIXED_HARDWARE       0x7F
51
#define EFI_ACPI_5_1_FUNCTIONAL_FIXED_HARDWARE       0x7F
42
52
Lines 57-85 typedef struct { Link Here
57
/// Root System Description Pointer Structure
67
/// Root System Description Pointer Structure
58
///
68
///
59
typedef struct {
69
typedef struct {
60
  UINT64  Signature;
70
  UINT64    Signature;
61
  UINT8   Checksum;
71
  UINT8     Checksum;
62
  UINT8   OemId[6];
72
  UINT8     OemId[6];
63
  UINT8   Revision;
73
  UINT8     Revision;
64
  UINT32  RsdtAddress;
74
  UINT32    RsdtAddress;
65
  UINT32  Length;
75
  UINT32    Length;
66
  UINT64  XsdtAddress;
76
  UINT64    XsdtAddress;
67
  UINT8   ExtendedChecksum;
77
  UINT8     ExtendedChecksum;
68
  UINT8   Reserved[3];
78
  UINT8     Reserved[3];
69
} EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_POINTER;
79
} EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_POINTER;
70
80
71
///
81
///
72
/// RSD_PTR Revision (as defined in ACPI 5.1 spec.)
82
/// RSD_PTR Revision (as defined in ACPI 5.1 spec.)
73
///
83
///
74
#define EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 5.1) says current value is 2
84
#define EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02 ///< ACPISpec (Revision 5.1) says current value is 2
75
85
76
///
86
///
77
/// Common table header, this prefaces all ACPI tables, including FACS, but
87
/// Common table header, this prefaces all ACPI tables, including FACS, but
78
/// excluding the RSD PTR structure
88
/// excluding the RSD PTR structure
79
///
89
///
80
typedef struct {
90
typedef struct {
81
  UINT32  Signature;
91
  UINT32    Signature;
82
  UINT32  Length;
92
  UINT32    Length;
83
} EFI_ACPI_5_1_COMMON_HEADER;
93
} EFI_ACPI_5_1_COMMON_HEADER;
84
94
85
//
95
//
Lines 91-97 typedef struct { Link Here
91
///
101
///
92
/// RSDT Revision (as defined in ACPI 5.1 spec.)
102
/// RSDT Revision (as defined in ACPI 5.1 spec.)
93
///
103
///
94
#define EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
104
#define EFI_ACPI_5_1_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
95
105
96
//
106
//
97
// Extended System Description Table
107
// Extended System Description Table
Lines 102-174 typedef struct { Link Here
102
///
112
///
103
/// XSDT Revision (as defined in ACPI 5.1 spec.)
113
/// XSDT Revision (as defined in ACPI 5.1 spec.)
104
///
114
///
105
#define EFI_ACPI_5_1_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
115
#define EFI_ACPI_5_1_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
106
116
107
///
117
///
108
/// Fixed ACPI Description Table Structure (FADT)
118
/// Fixed ACPI Description Table Structure (FADT)
109
///
119
///
110
typedef struct {
120
typedef struct {
111
  EFI_ACPI_DESCRIPTION_HEADER             Header;
121
  EFI_ACPI_DESCRIPTION_HEADER               Header;
112
  UINT32                                  FirmwareCtrl;
122
  UINT32                                    FirmwareCtrl;
113
  UINT32                                  Dsdt;
123
  UINT32                                    Dsdt;
114
  UINT8                                   Reserved0;
124
  UINT8                                     Reserved0;
115
  UINT8                                   PreferredPmProfile;
125
  UINT8                                     PreferredPmProfile;
116
  UINT16                                  SciInt;
126
  UINT16                                    SciInt;
117
  UINT32                                  SmiCmd;
127
  UINT32                                    SmiCmd;
118
  UINT8                                   AcpiEnable;
128
  UINT8                                     AcpiEnable;
119
  UINT8                                   AcpiDisable;
129
  UINT8                                     AcpiDisable;
120
  UINT8                                   S4BiosReq;
130
  UINT8                                     S4BiosReq;
121
  UINT8                                   PstateCnt;
131
  UINT8                                     PstateCnt;
122
  UINT32                                  Pm1aEvtBlk;
132
  UINT32                                    Pm1aEvtBlk;
123
  UINT32                                  Pm1bEvtBlk;
133
  UINT32                                    Pm1bEvtBlk;
124
  UINT32                                  Pm1aCntBlk;
134
  UINT32                                    Pm1aCntBlk;
125
  UINT32                                  Pm1bCntBlk;
135
  UINT32                                    Pm1bCntBlk;
126
  UINT32                                  Pm2CntBlk;
136
  UINT32                                    Pm2CntBlk;
127
  UINT32                                  PmTmrBlk;
137
  UINT32                                    PmTmrBlk;
128
  UINT32                                  Gpe0Blk;
138
  UINT32                                    Gpe0Blk;
129
  UINT32                                  Gpe1Blk;
139
  UINT32                                    Gpe1Blk;
130
  UINT8                                   Pm1EvtLen;
140
  UINT8                                     Pm1EvtLen;
131
  UINT8                                   Pm1CntLen;
141
  UINT8                                     Pm1CntLen;
132
  UINT8                                   Pm2CntLen;
142
  UINT8                                     Pm2CntLen;
133
  UINT8                                   PmTmrLen;
143
  UINT8                                     PmTmrLen;
134
  UINT8                                   Gpe0BlkLen;
144
  UINT8                                     Gpe0BlkLen;
135
  UINT8                                   Gpe1BlkLen;
145
  UINT8                                     Gpe1BlkLen;
136
  UINT8                                   Gpe1Base;
146
  UINT8                                     Gpe1Base;
137
  UINT8                                   CstCnt;
147
  UINT8                                     CstCnt;
138
  UINT16                                  PLvl2Lat;
148
  UINT16                                    PLvl2Lat;
139
  UINT16                                  PLvl3Lat;
149
  UINT16                                    PLvl3Lat;
140
  UINT16                                  FlushSize;
150
  UINT16                                    FlushSize;
141
  UINT16                                  FlushStride;
151
  UINT16                                    FlushStride;
142
  UINT8                                   DutyOffset;
152
  UINT8                                     DutyOffset;
143
  UINT8                                   DutyWidth;
153
  UINT8                                     DutyWidth;
144
  UINT8                                   DayAlrm;
154
  UINT8                                     DayAlrm;
145
  UINT8                                   MonAlrm;
155
  UINT8                                     MonAlrm;
146
  UINT8                                   Century;
156
  UINT8                                     Century;
147
  UINT16                                  IaPcBootArch;
157
  UINT16                                    IaPcBootArch;
148
  UINT8                                   Reserved1;
158
  UINT8                                     Reserved1;
149
  UINT32                                  Flags;
159
  UINT32                                    Flags;
150
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  ResetReg;
160
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    ResetReg;
151
  UINT8                                   ResetValue;
161
  UINT8                                     ResetValue;
152
  UINT16                                  ArmBootArch;
162
  UINT16                                    ArmBootArch;
153
  UINT8                                   MinorVersion;
163
  UINT8                                     MinorVersion;
154
  UINT64                                  XFirmwareCtrl;
164
  UINT64                                    XFirmwareCtrl;
155
  UINT64                                  XDsdt;
165
  UINT64                                    XDsdt;
156
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
166
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
157
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
167
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
158
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
168
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
159
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
169
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
160
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
170
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
161
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
171
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
162
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
172
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
163
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
173
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
164
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  SleepControlReg;
174
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    SleepControlReg;
165
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg;
175
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    SleepStatusReg;
166
} EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE;
176
} EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE;
167
177
168
///
178
///
169
/// FADT Version (as defined in ACPI 5.1 spec.)
179
/// FADT Version (as defined in ACPI 5.1 spec.)
170
///
180
///
171
#define EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x05
181
#define EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_REVISION        0x05
172
#define EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION  0x01
182
#define EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION  0x01
173
183
174
//
184
//
Lines 188-249 typedef struct { Link Here
188
// Fixed ACPI Description Table Boot Architecture Flags
198
// Fixed ACPI Description Table Boot Architecture Flags
189
// All other bits are reserved and must be set to 0.
199
// All other bits are reserved and must be set to 0.
190
//
200
//
191
#define EFI_ACPI_5_1_LEGACY_DEVICES              BIT0
201
#define EFI_ACPI_5_1_LEGACY_DEVICES        BIT0
192
#define EFI_ACPI_5_1_8042                        BIT1
202
#define EFI_ACPI_5_1_8042                  BIT1
193
#define EFI_ACPI_5_1_VGA_NOT_PRESENT             BIT2
203
#define EFI_ACPI_5_1_VGA_NOT_PRESENT       BIT2
194
#define EFI_ACPI_5_1_MSI_NOT_SUPPORTED           BIT3
204
#define EFI_ACPI_5_1_MSI_NOT_SUPPORTED     BIT3
195
#define EFI_ACPI_5_1_PCIE_ASPM_CONTROLS          BIT4
205
#define EFI_ACPI_5_1_PCIE_ASPM_CONTROLS    BIT4
196
#define EFI_ACPI_5_1_CMOS_RTC_NOT_PRESENT        BIT5
206
#define EFI_ACPI_5_1_CMOS_RTC_NOT_PRESENT  BIT5
197
207
198
//
208
//
199
// Fixed ACPI Description Table Arm Boot Architecture Flags
209
// Fixed ACPI Description Table Arm Boot Architecture Flags
200
// All other bits are reserved and must be set to 0.
210
// All other bits are reserved and must be set to 0.
201
//
211
//
202
#define EFI_ACPI_5_1_ARM_PSCI_COMPLIANT              BIT0
212
#define EFI_ACPI_5_1_ARM_PSCI_COMPLIANT  BIT0
203
#define EFI_ACPI_5_1_ARM_PSCI_USE_HVC                BIT1
213
#define EFI_ACPI_5_1_ARM_PSCI_USE_HVC    BIT1
204
214
205
//
215
//
206
// Fixed ACPI Description Table Fixed Feature Flags
216
// Fixed ACPI Description Table Fixed Feature Flags
207
// All other bits are reserved and must be set to 0.
217
// All other bits are reserved and must be set to 0.
208
//
218
//
209
#define EFI_ACPI_5_1_WBINVD                                 BIT0
219
#define EFI_ACPI_5_1_WBINVD                                BIT0
210
#define EFI_ACPI_5_1_WBINVD_FLUSH                           BIT1
220
#define EFI_ACPI_5_1_WBINVD_FLUSH                          BIT1
211
#define EFI_ACPI_5_1_PROC_C1                                BIT2
221
#define EFI_ACPI_5_1_PROC_C1                               BIT2
212
#define EFI_ACPI_5_1_P_LVL2_UP                              BIT3
222
#define EFI_ACPI_5_1_P_LVL2_UP                             BIT3
213
#define EFI_ACPI_5_1_PWR_BUTTON                             BIT4
223
#define EFI_ACPI_5_1_PWR_BUTTON                            BIT4
214
#define EFI_ACPI_5_1_SLP_BUTTON                             BIT5
224
#define EFI_ACPI_5_1_SLP_BUTTON                            BIT5
215
#define EFI_ACPI_5_1_FIX_RTC                                BIT6
225
#define EFI_ACPI_5_1_FIX_RTC                               BIT6
216
#define EFI_ACPI_5_1_RTC_S4                                 BIT7
226
#define EFI_ACPI_5_1_RTC_S4                                BIT7
217
#define EFI_ACPI_5_1_TMR_VAL_EXT                            BIT8
227
#define EFI_ACPI_5_1_TMR_VAL_EXT                           BIT8
218
#define EFI_ACPI_5_1_DCK_CAP                                BIT9
228
#define EFI_ACPI_5_1_DCK_CAP                               BIT9
219
#define EFI_ACPI_5_1_RESET_REG_SUP                          BIT10
229
#define EFI_ACPI_5_1_RESET_REG_SUP                         BIT10
220
#define EFI_ACPI_5_1_SEALED_CASE                            BIT11
230
#define EFI_ACPI_5_1_SEALED_CASE                           BIT11
221
#define EFI_ACPI_5_1_HEADLESS                               BIT12
231
#define EFI_ACPI_5_1_HEADLESS                              BIT12
222
#define EFI_ACPI_5_1_CPU_SW_SLP                             BIT13
232
#define EFI_ACPI_5_1_CPU_SW_SLP                            BIT13
223
#define EFI_ACPI_5_1_PCI_EXP_WAK                            BIT14
233
#define EFI_ACPI_5_1_PCI_EXP_WAK                           BIT14
224
#define EFI_ACPI_5_1_USE_PLATFORM_CLOCK                     BIT15
234
#define EFI_ACPI_5_1_USE_PLATFORM_CLOCK                    BIT15
225
#define EFI_ACPI_5_1_S4_RTC_STS_VALID                       BIT16
235
#define EFI_ACPI_5_1_S4_RTC_STS_VALID                      BIT16
226
#define EFI_ACPI_5_1_REMOTE_POWER_ON_CAPABLE                BIT17
236
#define EFI_ACPI_5_1_REMOTE_POWER_ON_CAPABLE               BIT17
227
#define EFI_ACPI_5_1_FORCE_APIC_CLUSTER_MODEL               BIT18
237
#define EFI_ACPI_5_1_FORCE_APIC_CLUSTER_MODEL              BIT18
228
#define EFI_ACPI_5_1_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
238
#define EFI_ACPI_5_1_FORCE_APIC_PHYSICAL_DESTINATION_MODE  BIT19
229
#define EFI_ACPI_5_1_HW_REDUCED_ACPI                        BIT20
239
#define EFI_ACPI_5_1_HW_REDUCED_ACPI                       BIT20
230
#define EFI_ACPI_5_1_LOW_POWER_S0_IDLE_CAPABLE              BIT21
240
#define EFI_ACPI_5_1_LOW_POWER_S0_IDLE_CAPABLE             BIT21
231
241
232
///
242
///
233
/// Firmware ACPI Control Structure
243
/// Firmware ACPI Control Structure
234
///
244
///
235
typedef struct {
245
typedef struct {
236
  UINT32  Signature;
246
  UINT32    Signature;
237
  UINT32  Length;
247
  UINT32    Length;
238
  UINT32  HardwareSignature;
248
  UINT32    HardwareSignature;
239
  UINT32  FirmwareWakingVector;
249
  UINT32    FirmwareWakingVector;
240
  UINT32  GlobalLock;
250
  UINT32    GlobalLock;
241
  UINT32  Flags;
251
  UINT32    Flags;
242
  UINT64  XFirmwareWakingVector;
252
  UINT64    XFirmwareWakingVector;
243
  UINT8   Version;
253
  UINT8     Version;
244
  UINT8   Reserved0[3];
254
  UINT8     Reserved0[3];
245
  UINT32  OspmFlags;
255
  UINT32    OspmFlags;
246
  UINT8   Reserved1[24];
256
  UINT8     Reserved1[24];
247
} EFI_ACPI_5_1_FIRMWARE_ACPI_CONTROL_STRUCTURE;
257
} EFI_ACPI_5_1_FIRMWARE_ACPI_CONTROL_STRUCTURE;
248
258
249
///
259
///
Lines 255-268 typedef struct { Link Here
255
/// Firmware Control Structure Feature Flags
265
/// Firmware Control Structure Feature Flags
256
/// All other bits are reserved and must be set to 0.
266
/// All other bits are reserved and must be set to 0.
257
///
267
///
258
#define EFI_ACPI_5_1_S4BIOS_F                     BIT0
268
#define EFI_ACPI_5_1_S4BIOS_F                BIT0
259
#define EFI_ACPI_5_1_64BIT_WAKE_SUPPORTED_F       BIT1
269
#define EFI_ACPI_5_1_64BIT_WAKE_SUPPORTED_F  BIT1
260
270
261
///
271
///
262
/// OSPM Enabled Firmware Control Structure Flags
272
/// OSPM Enabled Firmware Control Structure Flags
263
/// All other bits are reserved and must be set to 0.
273
/// All other bits are reserved and must be set to 0.
264
///
274
///
265
#define EFI_ACPI_5_1_OSPM_64BIT_WAKE_F            BIT0
275
#define EFI_ACPI_5_1_OSPM_64BIT_WAKE_F  BIT0
266
276
267
//
277
//
268
// Differentiated System Description Table,
278
// Differentiated System Description Table,
Lines 271-299 typedef struct { Link Here
271
// no definition needed as they are common description table header, the same with
281
// no definition needed as they are common description table header, the same with
272
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
282
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
273
//
283
//
274
#define EFI_ACPI_5_1_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
284
#define EFI_ACPI_5_1_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x02
275
#define EFI_ACPI_5_1_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
285
#define EFI_ACPI_5_1_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION       0x02
276
286
277
///
287
///
278
/// Multiple APIC Description Table header definition.  The rest of the table
288
/// Multiple APIC Description Table header definition.  The rest of the table
279
/// must be defined in a platform specific manner.
289
/// must be defined in a platform specific manner.
280
///
290
///
281
typedef struct {
291
typedef struct {
282
  EFI_ACPI_DESCRIPTION_HEADER Header;
292
  EFI_ACPI_DESCRIPTION_HEADER    Header;
283
  UINT32                      LocalApicAddress;
293
  UINT32                         LocalApicAddress;
284
  UINT32                      Flags;
294
  UINT32                         Flags;
285
} EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
295
} EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
286
296
287
///
297
///
288
/// MADT Revision (as defined in ACPI 5.1 spec.)
298
/// MADT Revision (as defined in ACPI 5.1 spec.)
289
///
299
///
290
#define EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
300
#define EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x03
291
301
292
///
302
///
293
/// Multiple APIC Flags
303
/// Multiple APIC Flags
294
/// All other bits are reserved and must be set to 0.
304
/// All other bits are reserved and must be set to 0.
295
///
305
///
296
#define EFI_ACPI_5_1_PCAT_COMPAT         BIT0
306
#define EFI_ACPI_5_1_PCAT_COMPAT  BIT0
297
307
298
//
308
//
299
// Multiple APIC Description Table APIC structure types
309
// Multiple APIC Description Table APIC structure types
Lines 324-380 typedef struct { Link Here
324
/// Processor Local APIC Structure Definition
334
/// Processor Local APIC Structure Definition
325
///
335
///
326
typedef struct {
336
typedef struct {
327
  UINT8   Type;
337
  UINT8     Type;
328
  UINT8   Length;
338
  UINT8     Length;
329
  UINT8   AcpiProcessorId;
339
  UINT8     AcpiProcessorId;
330
  UINT8   ApicId;
340
  UINT8     ApicId;
331
  UINT32  Flags;
341
  UINT32    Flags;
332
} EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_STRUCTURE;
342
} EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_STRUCTURE;
333
343
334
///
344
///
335
/// Local APIC Flags.  All other bits are reserved and must be 0.
345
/// Local APIC Flags.  All other bits are reserved and must be 0.
336
///
346
///
337
#define EFI_ACPI_5_1_LOCAL_APIC_ENABLED        BIT0
347
#define EFI_ACPI_5_1_LOCAL_APIC_ENABLED  BIT0
338
348
339
///
349
///
340
/// IO APIC Structure
350
/// IO APIC Structure
341
///
351
///
342
typedef struct {
352
typedef struct {
343
  UINT8   Type;
353
  UINT8     Type;
344
  UINT8   Length;
354
  UINT8     Length;
345
  UINT8   IoApicId;
355
  UINT8     IoApicId;
346
  UINT8   Reserved;
356
  UINT8     Reserved;
347
  UINT32  IoApicAddress;
357
  UINT32    IoApicAddress;
348
  UINT32  GlobalSystemInterruptBase;
358
  UINT32    GlobalSystemInterruptBase;
349
} EFI_ACPI_5_1_IO_APIC_STRUCTURE;
359
} EFI_ACPI_5_1_IO_APIC_STRUCTURE;
350
360
351
///
361
///
352
/// Interrupt Source Override Structure
362
/// Interrupt Source Override Structure
353
///
363
///
354
typedef struct {
364
typedef struct {
355
  UINT8   Type;
365
  UINT8     Type;
356
  UINT8   Length;
366
  UINT8     Length;
357
  UINT8   Bus;
367
  UINT8     Bus;
358
  UINT8   Source;
368
  UINT8     Source;
359
  UINT32  GlobalSystemInterrupt;
369
  UINT32    GlobalSystemInterrupt;
360
  UINT16  Flags;
370
  UINT16    Flags;
361
} EFI_ACPI_5_1_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
371
} EFI_ACPI_5_1_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
362
372
363
///
373
///
364
/// Platform Interrupt Sources Structure Definition
374
/// Platform Interrupt Sources Structure Definition
365
///
375
///
366
typedef struct {
376
typedef struct {
367
  UINT8   Type;
377
  UINT8     Type;
368
  UINT8   Length;
378
  UINT8     Length;
369
  UINT16  Flags;
379
  UINT16    Flags;
370
  UINT8   InterruptType;
380
  UINT8     InterruptType;
371
  UINT8   ProcessorId;
381
  UINT8     ProcessorId;
372
  UINT8   ProcessorEid;
382
  UINT8     ProcessorEid;
373
  UINT8   IoSapicVector;
383
  UINT8     IoSapicVector;
374
  UINT32  GlobalSystemInterrupt;
384
  UINT32    GlobalSystemInterrupt;
375
  UINT32  PlatformInterruptSourceFlags;
385
  UINT32    PlatformInterruptSourceFlags;
376
  UINT8   CpeiProcessorOverride;
386
  UINT8     CpeiProcessorOverride;
377
  UINT8   Reserved[31];
387
  UINT8     Reserved[31];
378
} EFI_ACPI_5_1_PLATFORM_INTERRUPT_APIC_STRUCTURE;
388
} EFI_ACPI_5_1_PLATFORM_INTERRUPT_APIC_STRUCTURE;
379
389
380
//
390
//
Lines 388-430 typedef struct { Link Here
388
/// Non-Maskable Interrupt Source Structure
398
/// Non-Maskable Interrupt Source Structure
389
///
399
///
390
typedef struct {
400
typedef struct {
391
  UINT8   Type;
401
  UINT8     Type;
392
  UINT8   Length;
402
  UINT8     Length;
393
  UINT16  Flags;
403
  UINT16    Flags;
394
  UINT32  GlobalSystemInterrupt;
404
  UINT32    GlobalSystemInterrupt;
395
} EFI_ACPI_5_1_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
405
} EFI_ACPI_5_1_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
396
406
397
///
407
///
398
/// Local APIC NMI Structure
408
/// Local APIC NMI Structure
399
///
409
///
400
typedef struct {
410
typedef struct {
401
  UINT8   Type;
411
  UINT8     Type;
402
  UINT8   Length;
412
  UINT8     Length;
403
  UINT8   AcpiProcessorId;
413
  UINT8     AcpiProcessorId;
404
  UINT16  Flags;
414
  UINT16    Flags;
405
  UINT8   LocalApicLint;
415
  UINT8     LocalApicLint;
406
} EFI_ACPI_5_1_LOCAL_APIC_NMI_STRUCTURE;
416
} EFI_ACPI_5_1_LOCAL_APIC_NMI_STRUCTURE;
407
417
408
///
418
///
409
/// Local APIC Address Override Structure
419
/// Local APIC Address Override Structure
410
///
420
///
411
typedef struct {
421
typedef struct {
412
  UINT8   Type;
422
  UINT8     Type;
413
  UINT8   Length;
423
  UINT8     Length;
414
  UINT16  Reserved;
424
  UINT16    Reserved;
415
  UINT64  LocalApicAddress;
425
  UINT64    LocalApicAddress;
416
} EFI_ACPI_5_1_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
426
} EFI_ACPI_5_1_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
417
427
418
///
428
///
419
/// IO SAPIC Structure
429
/// IO SAPIC Structure
420
///
430
///
421
typedef struct {
431
typedef struct {
422
  UINT8   Type;
432
  UINT8     Type;
423
  UINT8   Length;
433
  UINT8     Length;
424
  UINT8   IoApicId;
434
  UINT8     IoApicId;
425
  UINT8   Reserved;
435
  UINT8     Reserved;
426
  UINT32  GlobalSystemInterruptBase;
436
  UINT32    GlobalSystemInterruptBase;
427
  UINT64  IoSapicAddress;
437
  UINT64    IoSapicAddress;
428
} EFI_ACPI_5_1_IO_SAPIC_STRUCTURE;
438
} EFI_ACPI_5_1_IO_SAPIC_STRUCTURE;
429
439
430
///
440
///
Lines 432-586 typedef struct { Link Here
432
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
442
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
433
///
443
///
434
typedef struct {
444
typedef struct {
435
  UINT8   Type;
445
  UINT8     Type;
436
  UINT8   Length;
446
  UINT8     Length;
437
  UINT8   AcpiProcessorId;
447
  UINT8     AcpiProcessorId;
438
  UINT8   LocalSapicId;
448
  UINT8     LocalSapicId;
439
  UINT8   LocalSapicEid;
449
  UINT8     LocalSapicEid;
440
  UINT8   Reserved[3];
450
  UINT8     Reserved[3];
441
  UINT32  Flags;
451
  UINT32    Flags;
442
  UINT32  ACPIProcessorUIDValue;
452
  UINT32    ACPIProcessorUIDValue;
443
} EFI_ACPI_5_1_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
453
} EFI_ACPI_5_1_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
444
454
445
///
455
///
446
/// Platform Interrupt Sources Structure
456
/// Platform Interrupt Sources Structure
447
///
457
///
448
typedef struct {
458
typedef struct {
449
  UINT8   Type;
459
  UINT8     Type;
450
  UINT8   Length;
460
  UINT8     Length;
451
  UINT16  Flags;
461
  UINT16    Flags;
452
  UINT8   InterruptType;
462
  UINT8     InterruptType;
453
  UINT8   ProcessorId;
463
  UINT8     ProcessorId;
454
  UINT8   ProcessorEid;
464
  UINT8     ProcessorEid;
455
  UINT8   IoSapicVector;
465
  UINT8     IoSapicVector;
456
  UINT32  GlobalSystemInterrupt;
466
  UINT32    GlobalSystemInterrupt;
457
  UINT32  PlatformInterruptSourceFlags;
467
  UINT32    PlatformInterruptSourceFlags;
458
} EFI_ACPI_5_1_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
468
} EFI_ACPI_5_1_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
459
469
460
///
470
///
461
/// Platform Interrupt Source Flags.
471
/// Platform Interrupt Source Flags.
462
/// All other bits are reserved and must be set to 0.
472
/// All other bits are reserved and must be set to 0.
463
///
473
///
464
#define EFI_ACPI_5_1_CPEI_PROCESSOR_OVERRIDE          BIT0
474
#define EFI_ACPI_5_1_CPEI_PROCESSOR_OVERRIDE  BIT0
465
475
466
///
476
///
467
/// Processor Local x2APIC Structure Definition
477
/// Processor Local x2APIC Structure Definition
468
///
478
///
469
typedef struct {
479
typedef struct {
470
  UINT8   Type;
480
  UINT8     Type;
471
  UINT8   Length;
481
  UINT8     Length;
472
  UINT8   Reserved[2];
482
  UINT8     Reserved[2];
473
  UINT32  X2ApicId;
483
  UINT32    X2ApicId;
474
  UINT32  Flags;
484
  UINT32    Flags;
475
  UINT32  AcpiProcessorUid;
485
  UINT32    AcpiProcessorUid;
476
} EFI_ACPI_5_1_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
486
} EFI_ACPI_5_1_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
477
487
478
///
488
///
479
/// Local x2APIC NMI Structure
489
/// Local x2APIC NMI Structure
480
///
490
///
481
typedef struct {
491
typedef struct {
482
  UINT8   Type;
492
  UINT8     Type;
483
  UINT8   Length;
493
  UINT8     Length;
484
  UINT16  Flags;
494
  UINT16    Flags;
485
  UINT32  AcpiProcessorUid;
495
  UINT32    AcpiProcessorUid;
486
  UINT8   LocalX2ApicLint;
496
  UINT8     LocalX2ApicLint;
487
  UINT8   Reserved[3];
497
  UINT8     Reserved[3];
488
} EFI_ACPI_5_1_LOCAL_X2APIC_NMI_STRUCTURE;
498
} EFI_ACPI_5_1_LOCAL_X2APIC_NMI_STRUCTURE;
489
499
490
///
500
///
491
/// GIC Structure
501
/// GIC Structure
492
///
502
///
493
typedef struct {
503
typedef struct {
494
  UINT8   Type;
504
  UINT8     Type;
495
  UINT8   Length;
505
  UINT8     Length;
496
  UINT16  Reserved;
506
  UINT16    Reserved;
497
  UINT32  CPUInterfaceNumber;
507
  UINT32    CPUInterfaceNumber;
498
  UINT32  AcpiProcessorUid;
508
  UINT32    AcpiProcessorUid;
499
  UINT32  Flags;
509
  UINT32    Flags;
500
  UINT32  ParkingProtocolVersion;
510
  UINT32    ParkingProtocolVersion;
501
  UINT32  PerformanceInterruptGsiv;
511
  UINT32    PerformanceInterruptGsiv;
502
  UINT64  ParkedAddress;
512
  UINT64    ParkedAddress;
503
  UINT64  PhysicalBaseAddress;
513
  UINT64    PhysicalBaseAddress;
504
  UINT64  GICV;
514
  UINT64    GICV;
505
  UINT64  GICH;
515
  UINT64    GICH;
506
  UINT32  VGICMaintenanceInterrupt;
516
  UINT32    VGICMaintenanceInterrupt;
507
  UINT64  GICRBaseAddress;
517
  UINT64    GICRBaseAddress;
508
  UINT64  MPIDR;
518
  UINT64    MPIDR;
509
} EFI_ACPI_5_1_GIC_STRUCTURE;
519
} EFI_ACPI_5_1_GIC_STRUCTURE;
510
520
511
///
521
///
512
/// GIC Flags.  All other bits are reserved and must be 0.
522
/// GIC Flags.  All other bits are reserved and must be 0.
513
///
523
///
514
#define EFI_ACPI_5_1_GIC_ENABLED                              BIT0
524
#define EFI_ACPI_5_1_GIC_ENABLED                            BIT0
515
#define EFI_ACPI_5_1_PERFORMANCE_INTERRUPT_MODEL              BIT1
525
#define EFI_ACPI_5_1_PERFORMANCE_INTERRUPT_MODEL            BIT1
516
#define EFI_ACPI_5_1_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS    BIT2
526
#define EFI_ACPI_5_1_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS  BIT2
517
527
518
///
528
///
519
/// GIC Distributor Structure
529
/// GIC Distributor Structure
520
///
530
///
521
typedef struct {
531
typedef struct {
522
  UINT8   Type;
532
  UINT8     Type;
523
  UINT8   Length;
533
  UINT8     Length;
524
  UINT16  Reserved1;
534
  UINT16    Reserved1;
525
  UINT32  GicId;
535
  UINT32    GicId;
526
  UINT64  PhysicalBaseAddress;
536
  UINT64    PhysicalBaseAddress;
527
  UINT32  SystemVectorBase;
537
  UINT32    SystemVectorBase;
528
  UINT8   GicVersion;
538
  UINT8     GicVersion;
529
  UINT8   Reserved2[3];
539
  UINT8     Reserved2[3];
530
} EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE;
540
} EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE;
531
541
532
///
542
///
533
/// GIC Version
543
/// GIC Version
534
///
544
///
535
#define EFI_ACPI_5_1_GIC_V1                                   0x01
545
#define EFI_ACPI_5_1_GIC_V1  0x01
536
#define EFI_ACPI_5_1_GIC_V2                                   0x02
546
#define EFI_ACPI_5_1_GIC_V2  0x02
537
#define EFI_ACPI_5_1_GIC_V3                                   0x03
547
#define EFI_ACPI_5_1_GIC_V3  0x03
538
#define EFI_ACPI_5_1_GIC_V4                                   0x04
548
#define EFI_ACPI_5_1_GIC_V4  0x04
539
549
540
///
550
///
541
/// GIC MSI Frame Structure
551
/// GIC MSI Frame Structure
542
///
552
///
543
typedef struct {
553
typedef struct {
544
  UINT8   Type;
554
  UINT8     Type;
545
  UINT8   Length;
555
  UINT8     Length;
546
  UINT16  Reserved1;
556
  UINT16    Reserved1;
547
  UINT32  GicMsiFrameId;
557
  UINT32    GicMsiFrameId;
548
  UINT64  PhysicalBaseAddress;
558
  UINT64    PhysicalBaseAddress;
549
  UINT32  Flags;
559
  UINT32    Flags;
550
  UINT16  SPICount;
560
  UINT16    SPICount;
551
  UINT16  SPIBase;
561
  UINT16    SPIBase;
552
} EFI_ACPI_5_1_GIC_MSI_FRAME_STRUCTURE;
562
} EFI_ACPI_5_1_GIC_MSI_FRAME_STRUCTURE;
553
563
554
///
564
///
555
/// GIC MSI Frame Flags.  All other bits are reserved and must be 0.
565
/// GIC MSI Frame Flags.  All other bits are reserved and must be 0.
556
///
566
///
557
#define EFI_ACPI_5_1_SPI_COUNT_BASE_SELECT                    BIT0
567
#define EFI_ACPI_5_1_SPI_COUNT_BASE_SELECT  BIT0
558
568
559
///
569
///
560
/// GICR Structure
570
/// GICR Structure
561
///
571
///
562
typedef struct {
572
typedef struct {
563
  UINT8   Type;
573
  UINT8     Type;
564
  UINT8   Length;
574
  UINT8     Length;
565
  UINT16  Reserved;
575
  UINT16    Reserved;
566
  UINT64  DiscoveryRangeBaseAddress;
576
  UINT64    DiscoveryRangeBaseAddress;
567
  UINT32  DiscoveryRangeLength;
577
  UINT32    DiscoveryRangeLength;
568
} EFI_ACPI_5_1_GICR_STRUCTURE;
578
} EFI_ACPI_5_1_GICR_STRUCTURE;
569
579
570
///
580
///
571
/// Smart Battery Description Table (SBST)
581
/// Smart Battery Description Table (SBST)
572
///
582
///
573
typedef struct {
583
typedef struct {
574
  EFI_ACPI_DESCRIPTION_HEADER Header;
584
  EFI_ACPI_DESCRIPTION_HEADER    Header;
575
  UINT32                      WarningEnergyLevel;
585
  UINT32                         WarningEnergyLevel;
576
  UINT32                      LowEnergyLevel;
586
  UINT32                         LowEnergyLevel;
577
  UINT32                      CriticalEnergyLevel;
587
  UINT32                         CriticalEnergyLevel;
578
} EFI_ACPI_5_1_SMART_BATTERY_DESCRIPTION_TABLE;
588
} EFI_ACPI_5_1_SMART_BATTERY_DESCRIPTION_TABLE;
579
589
580
///
590
///
581
/// SBST Version (as defined in ACPI 5.1 spec.)
591
/// SBST Version (as defined in ACPI 5.1 spec.)
582
///
592
///
583
#define EFI_ACPI_5_1_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
593
#define EFI_ACPI_5_1_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
584
594
585
///
595
///
586
/// Embedded Controller Boot Resources Table (ECDT)
596
/// Embedded Controller Boot Resources Table (ECDT)
Lines 588-598 typedef struct { Link Here
588
/// a fully qualified reference to the name space object.
598
/// a fully qualified reference to the name space object.
589
///
599
///
590
typedef struct {
600
typedef struct {
591
  EFI_ACPI_DESCRIPTION_HEADER             Header;
601
  EFI_ACPI_DESCRIPTION_HEADER               Header;
592
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  EcControl;
602
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    EcControl;
593
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE  EcData;
603
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    EcData;
594
  UINT32                                  Uid;
604
  UINT32                                    Uid;
595
  UINT8                                   GpeBit;
605
  UINT8                                     GpeBit;
596
} EFI_ACPI_5_1_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
606
} EFI_ACPI_5_1_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
597
607
598
///
608
///
Lines 605-613 typedef struct { Link Here
605
/// must be defined in a platform specific manner.
615
/// must be defined in a platform specific manner.
606
///
616
///
607
typedef struct {
617
typedef struct {
608
  EFI_ACPI_DESCRIPTION_HEADER Header;
618
  EFI_ACPI_DESCRIPTION_HEADER    Header;
609
  UINT32                      Reserved1;  ///< Must be set to 1
619
  UINT32                         Reserved1; ///< Must be set to 1
610
  UINT64                      Reserved2;
620
  UINT64                         Reserved2;
611
} EFI_ACPI_5_1_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
621
} EFI_ACPI_5_1_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
612
622
613
///
623
///
Lines 629-711 typedef struct { Link Here
629
/// Processor Local APIC/SAPIC Affinity Structure Definition
639
/// Processor Local APIC/SAPIC Affinity Structure Definition
630
///
640
///
631
typedef struct {
641
typedef struct {
632
  UINT8   Type;
642
  UINT8     Type;
633
  UINT8   Length;
643
  UINT8     Length;
634
  UINT8   ProximityDomain7To0;
644
  UINT8     ProximityDomain7To0;
635
  UINT8   ApicId;
645
  UINT8     ApicId;
636
  UINT32  Flags;
646
  UINT32    Flags;
637
  UINT8   LocalSapicEid;
647
  UINT8     LocalSapicEid;
638
  UINT8   ProximityDomain31To8[3];
648
  UINT8     ProximityDomain31To8[3];
639
  UINT32  ClockDomain;
649
  UINT32    ClockDomain;
640
} EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
650
} EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
641
651
642
///
652
///
643
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
653
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
644
///
654
///
645
#define EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
655
#define EFI_ACPI_5_1_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED  (1 << 0)
646
656
647
///
657
///
648
/// Memory Affinity Structure Definition
658
/// Memory Affinity Structure Definition
649
///
659
///
650
typedef struct {
660
typedef struct {
651
  UINT8   Type;
661
  UINT8     Type;
652
  UINT8   Length;
662
  UINT8     Length;
653
  UINT32  ProximityDomain;
663
  UINT32    ProximityDomain;
654
  UINT16  Reserved1;
664
  UINT16    Reserved1;
655
  UINT32  AddressBaseLow;
665
  UINT32    AddressBaseLow;
656
  UINT32  AddressBaseHigh;
666
  UINT32    AddressBaseHigh;
657
  UINT32  LengthLow;
667
  UINT32    LengthLow;
658
  UINT32  LengthHigh;
668
  UINT32    LengthHigh;
659
  UINT32  Reserved2;
669
  UINT32    Reserved2;
660
  UINT32  Flags;
670
  UINT32    Flags;
661
  UINT64  Reserved3;
671
  UINT64    Reserved3;
662
} EFI_ACPI_5_1_MEMORY_AFFINITY_STRUCTURE;
672
} EFI_ACPI_5_1_MEMORY_AFFINITY_STRUCTURE;
663
673
664
//
674
//
665
// Memory Flags.  All other bits are reserved and must be 0.
675
// Memory Flags.  All other bits are reserved and must be 0.
666
//
676
//
667
#define EFI_ACPI_5_1_MEMORY_ENABLED       (1 << 0)
677
#define EFI_ACPI_5_1_MEMORY_ENABLED        (1 << 0)
668
#define EFI_ACPI_5_1_MEMORY_HOT_PLUGGABLE (1 << 1)
678
#define EFI_ACPI_5_1_MEMORY_HOT_PLUGGABLE  (1 << 1)
669
#define EFI_ACPI_5_1_MEMORY_NONVOLATILE   (1 << 2)
679
#define EFI_ACPI_5_1_MEMORY_NONVOLATILE    (1 << 2)
670
680
671
///
681
///
672
/// Processor Local x2APIC Affinity Structure Definition
682
/// Processor Local x2APIC Affinity Structure Definition
673
///
683
///
674
typedef struct {
684
typedef struct {
675
  UINT8   Type;
685
  UINT8     Type;
676
  UINT8   Length;
686
  UINT8     Length;
677
  UINT8   Reserved1[2];
687
  UINT8     Reserved1[2];
678
  UINT32  ProximityDomain;
688
  UINT32    ProximityDomain;
679
  UINT32  X2ApicId;
689
  UINT32    X2ApicId;
680
  UINT32  Flags;
690
  UINT32    Flags;
681
  UINT32  ClockDomain;
691
  UINT32    ClockDomain;
682
  UINT8   Reserved2[4];
692
  UINT8     Reserved2[4];
683
} EFI_ACPI_5_1_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
693
} EFI_ACPI_5_1_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
684
694
685
///
695
///
686
/// GICC Affinity Structure Definition
696
/// GICC Affinity Structure Definition
687
///
697
///
688
typedef struct {
698
typedef struct {
689
  UINT8   Type;
699
  UINT8     Type;
690
  UINT8   Length;
700
  UINT8     Length;
691
  UINT32  ProximityDomain;
701
  UINT32    ProximityDomain;
692
  UINT32  AcpiProcessorUid;
702
  UINT32    AcpiProcessorUid;
693
  UINT32  Flags;
703
  UINT32    Flags;
694
  UINT32  ClockDomain;
704
  UINT32    ClockDomain;
695
} EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE;
705
} EFI_ACPI_5_1_GICC_AFFINITY_STRUCTURE;
696
706
697
///
707
///
698
/// GICC Flags.  All other bits are reserved and must be 0.
708
/// GICC Flags.  All other bits are reserved and must be 0.
699
///
709
///
700
#define EFI_ACPI_5_1_GICC_ENABLED (1 << 0)
710
#define EFI_ACPI_5_1_GICC_ENABLED  (1 << 0)
701
711
702
///
712
///
703
/// System Locality Distance Information Table (SLIT).
713
/// System Locality Distance Information Table (SLIT).
704
/// The rest of the table is a matrix.
714
/// The rest of the table is a matrix.
705
///
715
///
706
typedef struct {
716
typedef struct {
707
  EFI_ACPI_DESCRIPTION_HEADER Header;
717
  EFI_ACPI_DESCRIPTION_HEADER    Header;
708
  UINT64                      NumberOfSystemLocalities;
718
  UINT64                         NumberOfSystemLocalities;
709
} EFI_ACPI_5_1_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
719
} EFI_ACPI_5_1_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
710
720
711
///
721
///
Lines 717-730 typedef struct { Link Here
717
/// Corrected Platform Error Polling Table (CPEP)
727
/// Corrected Platform Error Polling Table (CPEP)
718
///
728
///
719
typedef struct {
729
typedef struct {
720
  EFI_ACPI_DESCRIPTION_HEADER Header;
730
  EFI_ACPI_DESCRIPTION_HEADER    Header;
721
  UINT8                       Reserved[8];
731
  UINT8                          Reserved[8];
722
} EFI_ACPI_5_1_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
732
} EFI_ACPI_5_1_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
723
733
724
///
734
///
725
/// CPEP Version (as defined in ACPI 5.1 spec.)
735
/// CPEP Version (as defined in ACPI 5.1 spec.)
726
///
736
///
727
#define EFI_ACPI_5_1_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
737
#define EFI_ACPI_5_1_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION  0x01
728
738
729
//
739
//
730
// CPEP processor structure types.
740
// CPEP processor structure types.
Lines 735-800 typedef struct { Link Here
735
/// Corrected Platform Error Polling Processor Structure Definition
745
/// Corrected Platform Error Polling Processor Structure Definition
736
///
746
///
737
typedef struct {
747
typedef struct {
738
  UINT8   Type;
748
  UINT8     Type;
739
  UINT8   Length;
749
  UINT8     Length;
740
  UINT8   ProcessorId;
750
  UINT8     ProcessorId;
741
  UINT8   ProcessorEid;
751
  UINT8     ProcessorEid;
742
  UINT32  PollingInterval;
752
  UINT32    PollingInterval;
743
} EFI_ACPI_5_1_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
753
} EFI_ACPI_5_1_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
744
754
745
///
755
///
746
/// Maximum System Characteristics Table (MSCT)
756
/// Maximum System Characteristics Table (MSCT)
747
///
757
///
748
typedef struct {
758
typedef struct {
749
  EFI_ACPI_DESCRIPTION_HEADER Header;
759
  EFI_ACPI_DESCRIPTION_HEADER    Header;
750
  UINT32                      OffsetProxDomInfo;
760
  UINT32                         OffsetProxDomInfo;
751
  UINT32                      MaximumNumberOfProximityDomains;
761
  UINT32                         MaximumNumberOfProximityDomains;
752
  UINT32                      MaximumNumberOfClockDomains;
762
  UINT32                         MaximumNumberOfClockDomains;
753
  UINT64                      MaximumPhysicalAddress;
763
  UINT64                         MaximumPhysicalAddress;
754
} EFI_ACPI_5_1_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
764
} EFI_ACPI_5_1_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
755
765
756
///
766
///
757
/// MSCT Version (as defined in ACPI 5.1 spec.)
767
/// MSCT Version (as defined in ACPI 5.1 spec.)
758
///
768
///
759
#define EFI_ACPI_5_1_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
769
#define EFI_ACPI_5_1_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION  0x01
760
770
761
///
771
///
762
/// Maximum Proximity Domain Information Structure Definition
772
/// Maximum Proximity Domain Information Structure Definition
763
///
773
///
764
typedef struct {
774
typedef struct {
765
  UINT8   Revision;
775
  UINT8     Revision;
766
  UINT8   Length;
776
  UINT8     Length;
767
  UINT32  ProximityDomainRangeLow;
777
  UINT32    ProximityDomainRangeLow;
768
  UINT32  ProximityDomainRangeHigh;
778
  UINT32    ProximityDomainRangeHigh;
769
  UINT32  MaximumProcessorCapacity;
779
  UINT32    MaximumProcessorCapacity;
770
  UINT64  MaximumMemoryCapacity;
780
  UINT64    MaximumMemoryCapacity;
771
} EFI_ACPI_5_1_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
781
} EFI_ACPI_5_1_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
772
782
773
///
783
///
774
/// ACPI RAS Feature Table definition.
784
/// ACPI RAS Feature Table definition.
775
///
785
///
776
typedef struct {
786
typedef struct {
777
  EFI_ACPI_DESCRIPTION_HEADER Header;
787
  EFI_ACPI_DESCRIPTION_HEADER    Header;
778
  UINT8                       PlatformCommunicationChannelIdentifier[12];
788
  UINT8                          PlatformCommunicationChannelIdentifier[12];
779
} EFI_ACPI_5_1_RAS_FEATURE_TABLE;
789
} EFI_ACPI_5_1_RAS_FEATURE_TABLE;
780
790
781
///
791
///
782
/// RASF Version (as defined in ACPI 5.1 spec.)
792
/// RASF Version (as defined in ACPI 5.1 spec.)
783
///
793
///
784
#define EFI_ACPI_5_1_RAS_FEATURE_TABLE_REVISION 0x01
794
#define EFI_ACPI_5_1_RAS_FEATURE_TABLE_REVISION  0x01
785
795
786
///
796
///
787
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
797
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
788
///
798
///
789
typedef struct {
799
typedef struct {
790
  UINT32                      Signature;
800
  UINT32    Signature;
791
  UINT16                      Command;
801
  UINT16    Command;
792
  UINT16                      Status;
802
  UINT16    Status;
793
  UINT16                      Version;
803
  UINT16    Version;
794
  UINT8                       RASCapabilities[16];
804
  UINT8     RASCapabilities[16];
795
  UINT8                       SetRASCapabilities[16];
805
  UINT8     SetRASCapabilities[16];
796
  UINT16                      NumberOfRASFParameterBlocks;
806
  UINT16    NumberOfRASFParameterBlocks;
797
  UINT32                      SetRASCapabilitiesStatus;
807
  UINT32    SetRASCapabilitiesStatus;
798
} EFI_ACPI_5_1_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
808
} EFI_ACPI_5_1_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
799
809
800
///
810
///
Lines 812-863 typedef struct { Link Here
812
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
822
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
813
///
823
///
814
typedef struct {
824
typedef struct {
815
  UINT16                      Type;
825
  UINT16    Type;
816
  UINT16                      Version;
826
  UINT16    Version;
817
  UINT16                      Length;
827
  UINT16    Length;
818
  UINT16                      PatrolScrubCommand;
828
  UINT16    PatrolScrubCommand;
819
  UINT64                      RequestedAddressRange[2];
829
  UINT64    RequestedAddressRange[2];
820
  UINT64                      ActualAddressRange[2];
830
  UINT64    ActualAddressRange[2];
821
  UINT16                      Flags;
831
  UINT16    Flags;
822
  UINT8                       RequestedSpeed;
832
  UINT8     RequestedSpeed;
823
} EFI_ACPI_5_1_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
833
} EFI_ACPI_5_1_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
824
834
825
///
835
///
826
/// ACPI RASF Patrol Scrub command
836
/// ACPI RASF Patrol Scrub command
827
///
837
///
828
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS   0x01
838
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS  0x01
829
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER   0x02
839
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER  0x02
830
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER    0x03
840
#define EFI_ACPI_5_1_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER   0x03
831
841
832
///
842
///
833
/// Memory Power State Table definition.
843
/// Memory Power State Table definition.
834
///
844
///
835
typedef struct {
845
typedef struct {
836
  EFI_ACPI_DESCRIPTION_HEADER Header;
846
  EFI_ACPI_DESCRIPTION_HEADER    Header;
837
  UINT8                       PlatformCommunicationChannelIdentifier;
847
  UINT8                          PlatformCommunicationChannelIdentifier;
838
  UINT8                       Reserved[3];
848
  UINT8                          Reserved[3];
839
// Memory Power Node Structure
849
  // Memory Power Node Structure
840
// Memory Power State Characteristics
850
  // Memory Power State Characteristics
841
} EFI_ACPI_5_1_MEMORY_POWER_STATUS_TABLE;
851
} EFI_ACPI_5_1_MEMORY_POWER_STATUS_TABLE;
842
852
843
///
853
///
844
/// MPST Version (as defined in ACPI 5.1 spec.)
854
/// MPST Version (as defined in ACPI 5.1 spec.)
845
///
855
///
846
#define EFI_ACPI_5_1_MEMORY_POWER_STATE_TABLE_REVISION 0x01
856
#define EFI_ACPI_5_1_MEMORY_POWER_STATE_TABLE_REVISION  0x01
847
857
848
///
858
///
849
/// MPST Platform Communication Channel Shared Memory Region definition.
859
/// MPST Platform Communication Channel Shared Memory Region definition.
850
///
860
///
851
typedef struct {
861
typedef struct {
852
  UINT32                      Signature;
862
  UINT32    Signature;
853
  UINT16                      Command;
863
  UINT16    Command;
854
  UINT16                      Status;
864
  UINT16    Status;
855
  UINT32                      MemoryPowerCommandRegister;
865
  UINT32    MemoryPowerCommandRegister;
856
  UINT32                      MemoryPowerStatusRegister;
866
  UINT32    MemoryPowerStatusRegister;
857
  UINT32                      PowerStateId;
867
  UINT32    PowerStateId;
858
  UINT32                      MemoryPowerNodeId;
868
  UINT32    MemoryPowerNodeId;
859
  UINT64                      MemoryEnergyConsumed;
869
  UINT64    MemoryEnergyConsumed;
860
  UINT64                      ExpectedAveragePowerComsuned;
870
  UINT64    ExpectedAveragePowerComsuned;
861
} EFI_ACPI_5_1_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
871
} EFI_ACPI_5_1_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
862
872
863
///
873
///
Lines 868-1053 typedef struct { Link Here
868
///
878
///
869
/// ACPI MPST Memory Power command
879
/// ACPI MPST Memory Power command
870
///
880
///
871
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE       0x01
881
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE      0x01
872
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE       0x02
882
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE      0x02
873
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED   0x03
883
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED  0x03
874
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED   0x04
884
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED  0x04
875
885
876
///
886
///
877
/// MPST Memory Power Node Table
887
/// MPST Memory Power Node Table
878
///
888
///
879
typedef struct {
889
typedef struct {
880
  UINT8                                             PowerStateValue;
890
  UINT8    PowerStateValue;
881
  UINT8                                             PowerStateInformationIndex;
891
  UINT8    PowerStateInformationIndex;
882
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE;
892
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE;
883
893
884
typedef struct {
894
typedef struct {
885
  UINT8                                             Flag;
895
  UINT8     Flag;
886
  UINT8                                             Reserved;
896
  UINT8     Reserved;
887
  UINT16                                            MemoryPowerNodeId;
897
  UINT16    MemoryPowerNodeId;
888
  UINT32                                            Length;
898
  UINT32    Length;
889
  UINT64                                            AddressBase;
899
  UINT64    AddressBase;
890
  UINT64                                            AddressLength;
900
  UINT64    AddressLength;
891
  UINT32                                            NumberOfPowerStates;
901
  UINT32    NumberOfPowerStates;
892
  UINT32                                            NumberOfPhysicalComponents;
902
  UINT32    NumberOfPhysicalComponents;
893
//EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
903
  // EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
894
//UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
904
  // UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
895
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE;
905
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE;
896
906
897
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE          0x01
907
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE         0x01
898
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED   0x02
908
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED  0x02
899
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE   0x04
909
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE  0x04
900
910
901
typedef struct {
911
typedef struct {
902
  UINT16                      MemoryPowerNodeCount;
912
  UINT16    MemoryPowerNodeCount;
903
  UINT8                       Reserved[2];
913
  UINT8     Reserved[2];
904
} EFI_ACPI_5_1_MPST_MEMORY_POWER_NODE_TABLE;
914
} EFI_ACPI_5_1_MPST_MEMORY_POWER_NODE_TABLE;
905
915
906
///
916
///
907
/// MPST Memory Power State Characteristics Table
917
/// MPST Memory Power State Characteristics Table
908
///
918
///
909
typedef struct {
919
typedef struct {
910
  UINT8                                             PowerStateStructureID;
920
  UINT8     PowerStateStructureID;
911
  UINT8                                             Flag;
921
  UINT8     Flag;
912
  UINT16                                            Reserved;
922
  UINT16    Reserved;
913
  UINT32                                            AveragePowerConsumedInMPS0;
923
  UINT32    AveragePowerConsumedInMPS0;
914
  UINT32                                            RelativePowerSavingToMPS0;
924
  UINT32    RelativePowerSavingToMPS0;
915
  UINT64                                            ExitLatencyToMPS0;
925
  UINT64    ExitLatencyToMPS0;
916
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
926
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
917
927
918
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED              0x01
928
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED             0x01
919
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY   0x02
929
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY  0x02
920
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT    0x04
930
#define EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT   0x04
921
931
922
typedef struct {
932
typedef struct {
923
  UINT16                      MemoryPowerStateCharacteristicsCount;
933
  UINT16    MemoryPowerStateCharacteristicsCount;
924
  UINT8                       Reserved[2];
934
  UINT8     Reserved[2];
925
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
935
} EFI_ACPI_5_1_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
926
936
927
///
937
///
928
/// Memory Topology Table definition.
938
/// Memory Topology Table definition.
929
///
939
///
930
typedef struct {
940
typedef struct {
931
  EFI_ACPI_DESCRIPTION_HEADER Header;
941
  EFI_ACPI_DESCRIPTION_HEADER    Header;
932
  UINT32                      Reserved;
942
  UINT32                         Reserved;
933
} EFI_ACPI_5_1_MEMORY_TOPOLOGY_TABLE;
943
} EFI_ACPI_5_1_MEMORY_TOPOLOGY_TABLE;
934
944
935
///
945
///
936
/// PMTT Version (as defined in ACPI 5.1 spec.)
946
/// PMTT Version (as defined in ACPI 5.1 spec.)
937
///
947
///
938
#define EFI_ACPI_5_1_MEMORY_TOPOLOGY_TABLE_REVISION 0x01
948
#define EFI_ACPI_5_1_MEMORY_TOPOLOGY_TABLE_REVISION  0x01
939
949
940
///
950
///
941
/// Common Memory Aggregator Device Structure.
951
/// Common Memory Aggregator Device Structure.
942
///
952
///
943
typedef struct {
953
typedef struct {
944
  UINT8                       Type;
954
  UINT8     Type;
945
  UINT8                       Reserved;
955
  UINT8     Reserved;
946
  UINT16                      Length;
956
  UINT16    Length;
947
  UINT16                      Flags;
957
  UINT16    Flags;
948
  UINT16                      Reserved1;
958
  UINT16    Reserved1;
949
} EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
959
} EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
950
960
951
///
961
///
952
/// Memory Aggregator Device Type
962
/// Memory Aggregator Device Type
953
///
963
///
954
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET            0x1
964
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET             0x0
955
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER 0x2
965
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER  0x1
956
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM              0x3
966
#define EFI_ACPI_5_1_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM               0x2
957
967
958
///
968
///
959
/// Socket Memory Aggregator Device Structure.
969
/// Socket Memory Aggregator Device Structure.
960
///
970
///
961
typedef struct {
971
typedef struct {
962
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
972
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
963
  UINT16                                                       SocketIdentifier;
973
  UINT16                                                         SocketIdentifier;
964
  UINT16                                                       Reserved;
974
  UINT16                                                         Reserved;
965
//EFI_ACPI_5_1_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
975
  // EFI_ACPI_5_1_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
966
} EFI_ACPI_5_1_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
976
} EFI_ACPI_5_1_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
967
977
968
///
978
///
969
/// MemoryController Memory Aggregator Device Structure.
979
/// MemoryController Memory Aggregator Device Structure.
970
///
980
///
971
typedef struct {
981
typedef struct {
972
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
982
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
973
  UINT32                                                       ReadLatency;
983
  UINT32                                                         ReadLatency;
974
  UINT32                                                       WriteLatency;
984
  UINT32                                                         WriteLatency;
975
  UINT32                                                       ReadBandwidth;
985
  UINT32                                                         ReadBandwidth;
976
  UINT32                                                       WriteBandwidth;
986
  UINT32                                                         WriteBandwidth;
977
  UINT16                                                       OptimalAccessUnit;
987
  UINT16                                                         OptimalAccessUnit;
978
  UINT16                                                       OptimalAccessAlignment;
988
  UINT16                                                         OptimalAccessAlignment;
979
  UINT16                                                       Reserved;
989
  UINT16                                                         Reserved;
980
  UINT16                                                       NumberOfProximityDomains;
990
  UINT16                                                         NumberOfProximityDomains;
981
//UINT32                                                       ProximityDomain[NumberOfProximityDomains];
991
  // UINT32                                                       ProximityDomain[NumberOfProximityDomains];
982
//EFI_ACPI_5_1_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
992
  // EFI_ACPI_5_1_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
983
} EFI_ACPI_5_1_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
993
} EFI_ACPI_5_1_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
984
994
985
///
995
///
986
/// DIMM Memory Aggregator Device Structure.
996
/// DIMM Memory Aggregator Device Structure.
987
///
997
///
988
typedef struct {
998
typedef struct {
989
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
999
  EFI_ACPI_5_1_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
990
  UINT16                                                       PhysicalComponentIdentifier;
1000
  UINT16                                                         PhysicalComponentIdentifier;
991
  UINT16                                                       Reserved;
1001
  UINT16                                                         Reserved;
992
  UINT32                                                       SizeOfDimm;
1002
  UINT32                                                         SizeOfDimm;
993
  UINT32                                                       SmbiosHandle;
1003
  UINT32                                                         SmbiosHandle;
994
} EFI_ACPI_5_1_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1004
} EFI_ACPI_5_1_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
995
1005
996
///
1006
///
997
/// Boot Graphics Resource Table definition.
1007
/// Boot Graphics Resource Table definition.
998
///
1008
///
999
typedef struct {
1009
typedef struct {
1000
  EFI_ACPI_DESCRIPTION_HEADER Header;
1010
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1001
  ///
1011
  ///
1002
  /// 2-bytes (16 bit) version ID. This value must be 1.
1012
  /// 2-bytes (16 bit) version ID. This value must be 1.
1003
  ///
1013
  ///
1004
  UINT16                      Version;
1014
  UINT16                         Version;
1005
  ///
1015
  ///
1006
  /// 1-byte status field indicating current status about the table.
1016
  /// 1-byte status field indicating current status about the table.
1007
  ///     Bits[7:1] = Reserved (must be zero)
1017
  ///     Bits[7:1] = Reserved (must be zero)
1008
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1018
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1009
  ///
1019
  ///
1010
  UINT8                       Status;
1020
  UINT8                          Status;
1011
  ///
1021
  ///
1012
  /// 1-byte enumerated type field indicating format of the image.
1022
  /// 1-byte enumerated type field indicating format of the image.
1013
  ///     0 = Bitmap
1023
  ///     0 = Bitmap
1014
  ///     1 - 255  Reserved (for future use)
1024
  ///     1 - 255  Reserved (for future use)
1015
  ///
1025
  ///
1016
  UINT8                       ImageType;
1026
  UINT8                          ImageType;
1017
  ///
1027
  ///
1018
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1028
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1019
  /// of the image bitmap.
1029
  /// of the image bitmap.
1020
  ///
1030
  ///
1021
  UINT64                      ImageAddress;
1031
  UINT64                         ImageAddress;
1022
  ///
1032
  ///
1023
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1033
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1024
  /// (X, Y) display offset of the top left corner of the boot image.
1034
  /// (X, Y) display offset of the top left corner of the boot image.
1025
  /// The top left corner of the display is at offset (0, 0).
1035
  /// The top left corner of the display is at offset (0, 0).
1026
  ///
1036
  ///
1027
  UINT32                      ImageOffsetX;
1037
  UINT32                         ImageOffsetX;
1028
  ///
1038
  ///
1029
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1039
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1030
  /// (X, Y) display offset of the top left corner of the boot image.
1040
  /// (X, Y) display offset of the top left corner of the boot image.
1031
  /// The top left corner of the display is at offset (0, 0).
1041
  /// The top left corner of the display is at offset (0, 0).
1032
  ///
1042
  ///
1033
  UINT32                      ImageOffsetY;
1043
  UINT32                         ImageOffsetY;
1034
} EFI_ACPI_5_1_BOOT_GRAPHICS_RESOURCE_TABLE;
1044
} EFI_ACPI_5_1_BOOT_GRAPHICS_RESOURCE_TABLE;
1035
1045
1036
///
1046
///
1037
/// BGRT Revision
1047
/// BGRT Revision
1038
///
1048
///
1039
#define EFI_ACPI_5_1_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION 1
1049
#define EFI_ACPI_5_1_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION  1
1040
1050
1041
///
1051
///
1042
/// BGRT Version
1052
/// BGRT Version
1043
///
1053
///
1044
#define EFI_ACPI_5_1_BGRT_VERSION         0x01
1054
#define EFI_ACPI_5_1_BGRT_VERSION  0x01
1045
1055
1046
///
1056
///
1047
/// BGRT Status
1057
/// BGRT Status
1048
///
1058
///
1049
#define EFI_ACPI_5_1_BGRT_STATUS_NOT_DISPLAYED 0x00
1059
#define EFI_ACPI_5_1_BGRT_STATUS_NOT_DISPLAYED  0x00
1050
#define EFI_ACPI_5_1_BGRT_STATUS_DISPLAYED     0x01
1060
#define EFI_ACPI_5_1_BGRT_STATUS_DISPLAYED      0x01
1051
1061
1052
///
1062
///
1053
/// BGRT Image Type
1063
/// BGRT Image Type
Lines 1057-1082 typedef struct { Link Here
1057
///
1067
///
1058
/// FPDT Version (as defined in ACPI 5.1 spec.)
1068
/// FPDT Version (as defined in ACPI 5.1 spec.)
1059
///
1069
///
1060
#define EFI_ACPI_5_1_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION 0x01
1070
#define EFI_ACPI_5_1_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION  0x01
1061
1071
1062
///
1072
///
1063
/// FPDT Performance Record Types
1073
/// FPDT Performance Record Types
1064
///
1074
///
1065
#define EFI_ACPI_5_1_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER      0x0000
1075
#define EFI_ACPI_5_1_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER   0x0000
1066
#define EFI_ACPI_5_1_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER     0x0001
1076
#define EFI_ACPI_5_1_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER  0x0001
1067
1077
1068
///
1078
///
1069
/// FPDT Performance Record Revision
1079
/// FPDT Performance Record Revision
1070
///
1080
///
1071
#define EFI_ACPI_5_1_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER  0x01
1081
#define EFI_ACPI_5_1_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER   0x01
1072
#define EFI_ACPI_5_1_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER 0x01
1082
#define EFI_ACPI_5_1_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER  0x01
1073
1083
1074
///
1084
///
1075
/// FPDT Runtime Performance Record Types
1085
/// FPDT Runtime Performance Record Types
1076
///
1086
///
1077
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME                0x0000
1087
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME            0x0000
1078
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND               0x0001
1088
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND           0x0001
1079
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT      0x0002
1089
#define EFI_ACPI_5_1_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT  0x0002
1080
1090
1081
///
1091
///
1082
/// FPDT Runtime Performance Record Revision
1092
/// FPDT Runtime Performance Record Revision
Lines 1089-1165 typedef struct { Link Here
1089
/// FPDT Performance Record header
1099
/// FPDT Performance Record header
1090
///
1100
///
1091
typedef struct {
1101
typedef struct {
1092
  UINT16           Type;
1102
  UINT16    Type;
1093
  UINT8            Length;
1103
  UINT8     Length;
1094
  UINT8            Revision;
1104
  UINT8     Revision;
1095
} EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER;
1105
} EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER;
1096
1106
1097
///
1107
///
1098
/// FPDT Performance Table header
1108
/// FPDT Performance Table header
1099
///
1109
///
1100
typedef struct {
1110
typedef struct {
1101
  UINT32  Signature;
1111
  UINT32    Signature;
1102
  UINT32  Length;
1112
  UINT32    Length;
1103
} EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER;
1113
} EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER;
1104
1114
1105
///
1115
///
1106
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1116
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1107
///
1117
///
1108
typedef struct {
1118
typedef struct {
1109
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1119
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1110
  UINT32                                          Reserved;
1120
  UINT32                                         Reserved;
1111
  ///
1121
  ///
1112
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1122
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1113
  ///
1123
  ///
1114
  UINT64                                          BootPerformanceTablePointer;
1124
  UINT64                                         BootPerformanceTablePointer;
1115
} EFI_ACPI_5_1_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1125
} EFI_ACPI_5_1_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1116
1126
1117
///
1127
///
1118
/// FPDT S3 Performance Table Pointer Record Structure
1128
/// FPDT S3 Performance Table Pointer Record Structure
1119
///
1129
///
1120
typedef struct {
1130
typedef struct {
1121
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1131
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1122
  UINT32                                          Reserved;
1132
  UINT32                                         Reserved;
1123
  ///
1133
  ///
1124
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1134
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1125
  ///
1135
  ///
1126
  UINT64                                          S3PerformanceTablePointer;
1136
  UINT64                                         S3PerformanceTablePointer;
1127
} EFI_ACPI_5_1_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1137
} EFI_ACPI_5_1_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1128
1138
1129
///
1139
///
1130
/// FPDT Firmware Basic Boot Performance Record Structure
1140
/// FPDT Firmware Basic Boot Performance Record Structure
1131
///
1141
///
1132
typedef struct {
1142
typedef struct {
1133
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1143
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1134
  UINT32                                          Reserved;
1144
  UINT32                                         Reserved;
1135
  ///
1145
  ///
1136
  /// Timer value logged at the beginning of firmware image execution.
1146
  /// Timer value logged at the beginning of firmware image execution.
1137
  /// This may not always be zero or near zero.
1147
  /// This may not always be zero or near zero.
1138
  ///
1148
  ///
1139
  UINT64                                          ResetEnd;
1149
  UINT64                                         ResetEnd;
1140
  ///
1150
  ///
1141
  /// Timer value logged just prior to loading the OS boot loader into memory.
1151
  /// Timer value logged just prior to loading the OS boot loader into memory.
1142
  /// For non-UEFI compatible boots, this field must be zero.
1152
  /// For non-UEFI compatible boots, this field must be zero.
1143
  ///
1153
  ///
1144
  UINT64                                          OsLoaderLoadImageStart;
1154
  UINT64                                         OsLoaderLoadImageStart;
1145
  ///
1155
  ///
1146
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1156
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1147
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1157
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1148
  /// to the INT 19h handler invocation.
1158
  /// to the INT 19h handler invocation.
1149
  ///
1159
  ///
1150
  UINT64                                          OsLoaderStartImageStart;
1160
  UINT64                                         OsLoaderStartImageStart;
1151
  ///
1161
  ///
1152
  /// Timer value logged at the point when the OS loader calls the
1162
  /// Timer value logged at the point when the OS loader calls the
1153
  /// ExitBootServices function for UEFI compatible firmware.
1163
  /// ExitBootServices function for UEFI compatible firmware.
1154
  /// For non-UEFI compatible boots, this field must be zero.
1164
  /// For non-UEFI compatible boots, this field must be zero.
1155
  ///
1165
  ///
1156
  UINT64                                          ExitBootServicesEntry;
1166
  UINT64                                         ExitBootServicesEntry;
1157
  ///
1167
  ///
1158
  /// Timer value logged at the point just prior to when the OS loader gaining
1168
  /// Timer value logged at the point just prior to when the OS loader gaining
1159
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1169
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1160
  /// For non-UEFI compatible boots, this field must be zero.
1170
  /// For non-UEFI compatible boots, this field must be zero.
1161
  ///
1171
  ///
1162
  UINT64                                          ExitBootServicesExit;
1172
  UINT64                                         ExitBootServicesExit;
1163
} EFI_ACPI_5_1_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1173
} EFI_ACPI_5_1_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1164
1174
1165
///
1175
///
Lines 1171-1177 typedef struct { Link Here
1171
// FPDT Firmware Basic Boot Performance Table
1181
// FPDT Firmware Basic Boot Performance Table
1172
//
1182
//
1173
typedef struct {
1183
typedef struct {
1174
  EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1184
  EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1175
  //
1185
  //
1176
  // one or more Performance Records.
1186
  // one or more Performance Records.
1177
  //
1187
  //
Lines 1186-1192 typedef struct { Link Here
1186
// FPDT Firmware S3 Boot Performance Table
1196
// FPDT Firmware S3 Boot Performance Table
1187
//
1197
//
1188
typedef struct {
1198
typedef struct {
1189
  EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1199
  EFI_ACPI_5_1_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1190
  //
1200
  //
1191
  // one or more Performance Records.
1201
  // one or more Performance Records.
1192
  //
1202
  //
Lines 1196-1398 typedef struct { Link Here
1196
/// FPDT Basic S3 Resume Performance Record
1206
/// FPDT Basic S3 Resume Performance Record
1197
///
1207
///
1198
typedef struct {
1208
typedef struct {
1199
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1209
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1200
  ///
1210
  ///
1201
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1211
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1202
  ///
1212
  ///
1203
  UINT32                                          ResumeCount;
1213
  UINT32                                         ResumeCount;
1204
  ///
1214
  ///
1205
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1215
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1206
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1216
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1207
  ///
1217
  ///
1208
  UINT64                                          FullResume;
1218
  UINT64                                         FullResume;
1209
  ///
1219
  ///
1210
  /// Average timer value of all resume cycles logged since the last full boot
1220
  /// Average timer value of all resume cycles logged since the last full boot
1211
  /// sequence, including the most recent resume.  Note that the entire log of
1221
  /// sequence, including the most recent resume.  Note that the entire log of
1212
  /// timer values does not need to be retained in order to calculate this average.
1222
  /// timer values does not need to be retained in order to calculate this average.
1213
  ///
1223
  ///
1214
  UINT64                                          AverageResume;
1224
  UINT64                                         AverageResume;
1215
} EFI_ACPI_5_1_FPDT_S3_RESUME_RECORD;
1225
} EFI_ACPI_5_1_FPDT_S3_RESUME_RECORD;
1216
1226
1217
///
1227
///
1218
/// FPDT Basic S3 Suspend Performance Record
1228
/// FPDT Basic S3 Suspend Performance Record
1219
///
1229
///
1220
typedef struct {
1230
typedef struct {
1221
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1231
  EFI_ACPI_5_1_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1222
  ///
1232
  ///
1223
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1233
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1224
  /// Only the most recent suspend cycle's timer value is retained.
1234
  /// Only the most recent suspend cycle's timer value is retained.
1225
  ///
1235
  ///
1226
  UINT64                                          SuspendStart;
1236
  UINT64                                         SuspendStart;
1227
  ///
1237
  ///
1228
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1238
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1229
  /// mechanism) used to trigger hardware entry to S3.
1239
  /// mechanism) used to trigger hardware entry to S3.
1230
  /// Only the most recent suspend cycle's timer value is retained.
1240
  /// Only the most recent suspend cycle's timer value is retained.
1231
  ///
1241
  ///
1232
  UINT64                                          SuspendEnd;
1242
  UINT64                                         SuspendEnd;
1233
} EFI_ACPI_5_1_FPDT_S3_SUSPEND_RECORD;
1243
} EFI_ACPI_5_1_FPDT_S3_SUSPEND_RECORD;
1234
1244
1235
///
1245
///
1236
/// Firmware Performance Record Table definition.
1246
/// Firmware Performance Record Table definition.
1237
///
1247
///
1238
typedef struct {
1248
typedef struct {
1239
  EFI_ACPI_DESCRIPTION_HEADER Header;
1249
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1240
} EFI_ACPI_5_1_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1250
} EFI_ACPI_5_1_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1241
1251
1242
///
1252
///
1243
/// Generic Timer Description Table definition.
1253
/// Generic Timer Description Table definition.
1244
///
1254
///
1245
typedef struct {
1255
typedef struct {
1246
  EFI_ACPI_DESCRIPTION_HEADER Header;
1256
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1247
  UINT64                      CntControlBasePhysicalAddress;
1257
  UINT64                         CntControlBasePhysicalAddress;
1248
  UINT32                      Reserved;
1258
  UINT32                         Reserved;
1249
  UINT32                      SecurePL1TimerGSIV;
1259
  UINT32                         SecurePL1TimerGSIV;
1250
  UINT32                      SecurePL1TimerFlags;
1260
  UINT32                         SecurePL1TimerFlags;
1251
  UINT32                      NonSecurePL1TimerGSIV;
1261
  UINT32                         NonSecurePL1TimerGSIV;
1252
  UINT32                      NonSecurePL1TimerFlags;
1262
  UINT32                         NonSecurePL1TimerFlags;
1253
  UINT32                      VirtualTimerGSIV;
1263
  UINT32                         VirtualTimerGSIV;
1254
  UINT32                      VirtualTimerFlags;
1264
  UINT32                         VirtualTimerFlags;
1255
  UINT32                      NonSecurePL2TimerGSIV;
1265
  UINT32                         NonSecurePL2TimerGSIV;
1256
  UINT32                      NonSecurePL2TimerFlags;
1266
  UINT32                         NonSecurePL2TimerFlags;
1257
  UINT64                      CntReadBasePhysicalAddress;
1267
  UINT64                         CntReadBasePhysicalAddress;
1258
  UINT32                      PlatformTimerCount;
1268
  UINT32                         PlatformTimerCount;
1259
  UINT32                      PlatformTimerOffset;
1269
  UINT32                         PlatformTimerOffset;
1260
} EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE;
1270
} EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE;
1261
1271
1262
///
1272
///
1263
/// GTDT Version (as defined in ACPI 5.1 spec.)
1273
/// GTDT Version (as defined in ACPI 5.1 spec.)
1264
///
1274
///
1265
#define EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION 0x02
1275
#define EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION  0x02
1266
1276
1267
///
1277
///
1268
/// Timer Flags.  All other bits are reserved and must be 0.
1278
/// Timer Flags.  All other bits are reserved and must be 0.
1269
///
1279
///
1270
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE          BIT0
1280
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE      BIT0
1271
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1281
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1272
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY          BIT2
1282
#define EFI_ACPI_5_1_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY      BIT2
1273
1283
1274
///
1284
///
1275
/// Platform Timer Type
1285
/// Platform Timer Type
1276
///
1286
///
1277
#define EFI_ACPI_5_1_GTDT_GT_BLOCK                       0
1287
#define EFI_ACPI_5_1_GTDT_GT_BLOCK               0
1278
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG          1
1288
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG  1
1279
1289
1280
///
1290
///
1281
/// GT Block Structure
1291
/// GT Block Structure
1282
///
1292
///
1283
typedef struct {
1293
typedef struct {
1284
  UINT8   Type;
1294
  UINT8     Type;
1285
  UINT16  Length;
1295
  UINT16    Length;
1286
  UINT8   Reserved;
1296
  UINT8     Reserved;
1287
  UINT64  CntCtlBase;
1297
  UINT64    CntCtlBase;
1288
  UINT32  GTBlockTimerCount;
1298
  UINT32    GTBlockTimerCount;
1289
  UINT32  GTBlockTimerOffset;
1299
  UINT32    GTBlockTimerOffset;
1290
} EFI_ACPI_5_1_GTDT_GT_BLOCK_STRUCTURE;
1300
} EFI_ACPI_5_1_GTDT_GT_BLOCK_STRUCTURE;
1291
1301
1292
///
1302
///
1293
/// GT Block Timer Structure
1303
/// GT Block Timer Structure
1294
///
1304
///
1295
typedef struct {
1305
typedef struct {
1296
  UINT8   GTFrameNumber;
1306
  UINT8     GTFrameNumber;
1297
  UINT8   Reserved[3];
1307
  UINT8     Reserved[3];
1298
  UINT64  CntBaseX;
1308
  UINT64    CntBaseX;
1299
  UINT64  CntEL0BaseX;
1309
  UINT64    CntEL0BaseX;
1300
  UINT32  GTxPhysicalTimerGSIV;
1310
  UINT32    GTxPhysicalTimerGSIV;
1301
  UINT32  GTxPhysicalTimerFlags;
1311
  UINT32    GTxPhysicalTimerFlags;
1302
  UINT32  GTxVirtualTimerGSIV;
1312
  UINT32    GTxVirtualTimerGSIV;
1303
  UINT32  GTxVirtualTimerFlags;
1313
  UINT32    GTxVirtualTimerFlags;
1304
  UINT32  GTxCommonFlags;
1314
  UINT32    GTxCommonFlags;
1305
} EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_STRUCTURE;
1315
} EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_STRUCTURE;
1306
1316
1307
///
1317
///
1308
/// GT Block Physical Timers and Virtual Timers Flags.  All other bits are reserved and must be 0.
1318
/// GT Block Physical Timers and Virtual Timers Flags.  All other bits are reserved and must be 0.
1309
///
1319
///
1310
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MODE          BIT0
1320
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MODE      BIT0
1311
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1321
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1312
1322
1313
///
1323
///
1314
/// Common Flags Flags.  All other bits are reserved and must be 0.
1324
/// Common Flags Flags.  All other bits are reserved and must be 0.
1315
///
1325
///
1316
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER              BIT0
1326
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER          BIT0
1317
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY      BIT1
1327
#define EFI_ACPI_5_1_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY  BIT1
1318
1328
1319
///
1329
///
1320
/// SBSA Generic Watchdog Structure
1330
/// SBSA Generic Watchdog Structure
1321
///
1331
///
1322
typedef struct {
1332
typedef struct {
1323
  UINT8   Type;
1333
  UINT8     Type;
1324
  UINT16  Length;
1334
  UINT16    Length;
1325
  UINT8   Reserved;
1335
  UINT8     Reserved;
1326
  UINT64  RefreshFramePhysicalAddress;
1336
  UINT64    RefreshFramePhysicalAddress;
1327
  UINT64  WatchdogControlFramePhysicalAddress;
1337
  UINT64    WatchdogControlFramePhysicalAddress;
1328
  UINT32  WatchdogTimerGSIV;
1338
  UINT32    WatchdogTimerGSIV;
1329
  UINT32  WatchdogTimerFlags;
1339
  UINT32    WatchdogTimerFlags;
1330
} EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE;
1340
} EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE;
1331
1341
1332
///
1342
///
1333
/// SBSA Generic Watchdog Timer Flags.  All other bits are reserved and must be 0.
1343
/// SBSA Generic Watchdog Timer Flags.  All other bits are reserved and must be 0.
1334
///
1344
///
1335
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE          BIT0
1345
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE      BIT0
1336
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1346
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1337
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER                  BIT2
1347
#define EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER              BIT2
1338
1348
1339
///
1349
///
1340
/// Boot Error Record Table (BERT)
1350
/// Boot Error Record Table (BERT)
1341
///
1351
///
1342
typedef struct {
1352
typedef struct {
1343
  EFI_ACPI_DESCRIPTION_HEADER Header;
1353
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1344
  UINT32                      BootErrorRegionLength;
1354
  UINT32                         BootErrorRegionLength;
1345
  UINT64                      BootErrorRegion;
1355
  UINT64                         BootErrorRegion;
1346
} EFI_ACPI_5_1_BOOT_ERROR_RECORD_TABLE_HEADER;
1356
} EFI_ACPI_5_1_BOOT_ERROR_RECORD_TABLE_HEADER;
1347
1357
1348
///
1358
///
1349
/// BERT Version (as defined in ACPI 5.1 spec.)
1359
/// BERT Version (as defined in ACPI 5.1 spec.)
1350
///
1360
///
1351
#define EFI_ACPI_5_1_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
1361
#define EFI_ACPI_5_1_BOOT_ERROR_RECORD_TABLE_REVISION  0x01
1352
1362
1353
///
1363
///
1354
/// Boot Error Region Block Status Definition
1364
/// Boot Error Region Block Status Definition
1355
///
1365
///
1356
typedef struct {
1366
typedef struct {
1357
  UINT32       UncorrectableErrorValid:1;
1367
  UINT32    UncorrectableErrorValid     : 1;
1358
  UINT32       CorrectableErrorValid:1;
1368
  UINT32    CorrectableErrorValid       : 1;
1359
  UINT32       MultipleUncorrectableErrors:1;
1369
  UINT32    MultipleUncorrectableErrors : 1;
1360
  UINT32       MultipleCorrectableErrors:1;
1370
  UINT32    MultipleCorrectableErrors   : 1;
1361
  UINT32       ErrorDataEntryCount:10;
1371
  UINT32    ErrorDataEntryCount         : 10;
1362
  UINT32       Reserved:18;
1372
  UINT32    Reserved                    : 18;
1363
} EFI_ACPI_5_1_ERROR_BLOCK_STATUS;
1373
} EFI_ACPI_5_1_ERROR_BLOCK_STATUS;
1364
1374
1365
///
1375
///
1366
/// Boot Error Region Definition
1376
/// Boot Error Region Definition
1367
///
1377
///
1368
typedef struct {
1378
typedef struct {
1369
  EFI_ACPI_5_1_ERROR_BLOCK_STATUS              BlockStatus;
1379
  EFI_ACPI_5_1_ERROR_BLOCK_STATUS    BlockStatus;
1370
  UINT32                                       RawDataOffset;
1380
  UINT32                             RawDataOffset;
1371
  UINT32                                       RawDataLength;
1381
  UINT32                             RawDataLength;
1372
  UINT32                                       DataLength;
1382
  UINT32                             DataLength;
1373
  UINT32                                       ErrorSeverity;
1383
  UINT32                             ErrorSeverity;
1374
} EFI_ACPI_5_1_BOOT_ERROR_REGION_STRUCTURE;
1384
} EFI_ACPI_5_1_BOOT_ERROR_REGION_STRUCTURE;
1375
1385
1376
//
1386
//
1377
// Boot Error Severity types
1387
// Boot Error Severity types
1378
//
1388
//
1379
#define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTABLE  0x00
1389
#define EFI_ACPI_5_1_ERROR_SEVERITY_RECOVERABLE  0x00
1380
#define EFI_ACPI_5_1_ERROR_SEVERITY_FATAL        0x01
1390
#define EFI_ACPI_5_1_ERROR_SEVERITY_FATAL        0x01
1381
#define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTED    0x02
1391
#define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTED    0x02
1382
#define EFI_ACPI_5_1_ERROR_SEVERITY_NONE         0x03
1392
#define EFI_ACPI_5_1_ERROR_SEVERITY_NONE         0x03
1393
//
1394
// The term 'Correctable' is no longer being used as an error severity of the
1395
// reported error since ACPI Specification Version 5.1 Errata B.
1396
// The below macro is considered as deprecated and should no longer be used.
1397
//
1398
#define EFI_ACPI_5_1_ERROR_SEVERITY_CORRECTABLE  0x00
1383
1399
1384
///
1400
///
1385
/// Generic Error Data Entry Definition
1401
/// Generic Error Data Entry Definition
1386
///
1402
///
1387
typedef struct {
1403
typedef struct {
1388
  UINT8    SectionType[16];
1404
  UINT8     SectionType[16];
1389
  UINT32   ErrorSeverity;
1405
  UINT32    ErrorSeverity;
1390
  UINT16   Revision;
1406
  UINT16    Revision;
1391
  UINT8    ValidationBits;
1407
  UINT8     ValidationBits;
1392
  UINT8    Flags;
1408
  UINT8     Flags;
1393
  UINT32   ErrorDataLength;
1409
  UINT32    ErrorDataLength;
1394
  UINT8    FruId[16];
1410
  UINT8     FruId[16];
1395
  UINT8    FruText[20];
1411
  UINT8     FruText[20];
1396
} EFI_ACPI_5_1_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1412
} EFI_ACPI_5_1_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1397
1413
1398
///
1414
///
Lines 1404-1417 typedef struct { Link Here
1404
/// HEST - Hardware Error Source Table
1420
/// HEST - Hardware Error Source Table
1405
///
1421
///
1406
typedef struct {
1422
typedef struct {
1407
  EFI_ACPI_DESCRIPTION_HEADER Header;
1423
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1408
  UINT32                      ErrorSourceCount;
1424
  UINT32                         ErrorSourceCount;
1409
} EFI_ACPI_5_1_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1425
} EFI_ACPI_5_1_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1410
1426
1411
///
1427
///
1412
/// HEST Version (as defined in ACPI 5.1 spec.)
1428
/// HEST Version (as defined in ACPI 5.1 spec.)
1413
///
1429
///
1414
#define EFI_ACPI_5_1_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
1430
#define EFI_ACPI_5_1_HARDWARE_ERROR_SOURCE_TABLE_REVISION  0x01
1415
1431
1416
//
1432
//
1417
// Error Source structure types.
1433
// Error Source structure types.
Lines 1427-1829 typedef struct { Link Here
1427
//
1443
//
1428
// Error Source structure flags.
1444
// Error Source structure flags.
1429
//
1445
//
1430
#define EFI_ACPI_5_1_ERROR_SOURCE_FLAG_FIRMWARE_FIRST       (1 << 0)
1446
#define EFI_ACPI_5_1_ERROR_SOURCE_FLAG_FIRMWARE_FIRST  (1 << 0)
1431
#define EFI_ACPI_5_1_ERROR_SOURCE_FLAG_GLOBAL               (1 << 1)
1447
#define EFI_ACPI_5_1_ERROR_SOURCE_FLAG_GLOBAL          (1 << 1)
1432
1448
1433
///
1449
///
1434
/// IA-32 Architecture Machine Check Exception Structure Definition
1450
/// IA-32 Architecture Machine Check Exception Structure Definition
1435
///
1451
///
1436
typedef struct {
1452
typedef struct {
1437
  UINT16  Type;
1453
  UINT16    Type;
1438
  UINT16  SourceId;
1454
  UINT16    SourceId;
1439
  UINT8   Reserved0[2];
1455
  UINT8     Reserved0[2];
1440
  UINT8   Flags;
1456
  UINT8     Flags;
1441
  UINT8   Enabled;
1457
  UINT8     Enabled;
1442
  UINT32  NumberOfRecordsToPreAllocate;
1458
  UINT32    NumberOfRecordsToPreAllocate;
1443
  UINT32  MaxSectionsPerRecord;
1459
  UINT32    MaxSectionsPerRecord;
1444
  UINT64  GlobalCapabilityInitData;
1460
  UINT64    GlobalCapabilityInitData;
1445
  UINT64  GlobalControlInitData;
1461
  UINT64    GlobalControlInitData;
1446
  UINT8   NumberOfHardwareBanks;
1462
  UINT8     NumberOfHardwareBanks;
1447
  UINT8   Reserved1[7];
1463
  UINT8     Reserved1[7];
1448
} EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1464
} EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1449
1465
1450
///
1466
///
1451
/// IA-32 Architecture Machine Check Bank Structure Definition
1467
/// IA-32 Architecture Machine Check Bank Structure Definition
1452
///
1468
///
1453
typedef struct {
1469
typedef struct {
1454
  UINT8   BankNumber;
1470
  UINT8     BankNumber;
1455
  UINT8   ClearStatusOnInitialization;
1471
  UINT8     ClearStatusOnInitialization;
1456
  UINT8   StatusDataFormat;
1472
  UINT8     StatusDataFormat;
1457
  UINT8   Reserved0;
1473
  UINT8     Reserved0;
1458
  UINT32  ControlRegisterMsrAddress;
1474
  UINT32    ControlRegisterMsrAddress;
1459
  UINT64  ControlInitData;
1475
  UINT64    ControlInitData;
1460
  UINT32  StatusRegisterMsrAddress;
1476
  UINT32    StatusRegisterMsrAddress;
1461
  UINT32  AddressRegisterMsrAddress;
1477
  UINT32    AddressRegisterMsrAddress;
1462
  UINT32  MiscRegisterMsrAddress;
1478
  UINT32    MiscRegisterMsrAddress;
1463
} EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1479
} EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1464
1480
1465
///
1481
///
1466
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1482
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1467
///
1483
///
1468
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32      0x00
1484
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32     0x00
1469
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64   0x01
1485
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64  0x01
1470
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64     0x02
1486
#define EFI_ACPI_5_1_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64    0x02
1471
1487
1472
//
1488
//
1473
// Hardware Error Notification types. All other values are reserved
1489
// Hardware Error Notification types. All other values are reserved
1474
//
1490
//
1475
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_POLLED                0x00
1491
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_POLLED              0x00
1476
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT    0x01
1492
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT  0x01
1477
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT       0x02
1493
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT     0x02
1478
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_SCI                   0x03
1494
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_SCI                 0x03
1479
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_NMI                   0x04
1495
#define EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_NMI                 0x04
1480
1496
1481
///
1497
///
1482
/// Hardware Error Notification Configuration Write Enable Structure Definition
1498
/// Hardware Error Notification Configuration Write Enable Structure Definition
1483
///
1499
///
1484
typedef struct {
1500
typedef struct {
1485
  UINT16    Type:1;
1501
  UINT16    Type                           : 1;
1486
  UINT16    PollInterval:1;
1502
  UINT16    PollInterval                   : 1;
1487
  UINT16    SwitchToPollingThresholdValue:1;
1503
  UINT16    SwitchToPollingThresholdValue  : 1;
1488
  UINT16    SwitchToPollingThresholdWindow:1;
1504
  UINT16    SwitchToPollingThresholdWindow : 1;
1489
  UINT16    ErrorThresholdValue:1;
1505
  UINT16    ErrorThresholdValue            : 1;
1490
  UINT16    ErrorThresholdWindow:1;
1506
  UINT16    ErrorThresholdWindow           : 1;
1491
  UINT16    Reserved:10;
1507
  UINT16    Reserved                       : 10;
1492
} EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1508
} EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1493
1509
1494
///
1510
///
1495
/// Hardware Error Notification Structure Definition
1511
/// Hardware Error Notification Structure Definition
1496
///
1512
///
1497
typedef struct {
1513
typedef struct {
1498
  UINT8                                                                          Type;
1514
  UINT8                                                                            Type;
1499
  UINT8                                                                          Length;
1515
  UINT8                                                                            Length;
1500
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE  ConfigurationWriteEnable;
1516
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE    ConfigurationWriteEnable;
1501
  UINT32                                                                         PollInterval;
1517
  UINT32                                                                           PollInterval;
1502
  UINT32                                                                         Vector;
1518
  UINT32                                                                           Vector;
1503
  UINT32                                                                         SwitchToPollingThresholdValue;
1519
  UINT32                                                                           SwitchToPollingThresholdValue;
1504
  UINT32                                                                         SwitchToPollingThresholdWindow;
1520
  UINT32                                                                           SwitchToPollingThresholdWindow;
1505
  UINT32                                                                         ErrorThresholdValue;
1521
  UINT32                                                                           ErrorThresholdValue;
1506
  UINT32                                                                         ErrorThresholdWindow;
1522
  UINT32                                                                           ErrorThresholdWindow;
1507
} EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1523
} EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1508
1524
1509
///
1525
///
1510
/// IA-32 Architecture Corrected Machine Check Structure Definition
1526
/// IA-32 Architecture Corrected Machine Check Structure Definition
1511
///
1527
///
1512
typedef struct {
1528
typedef struct {
1513
  UINT16                                                 Type;
1529
  UINT16                                                Type;
1514
  UINT16                                                 SourceId;
1530
  UINT16                                                SourceId;
1515
  UINT8                                                  Reserved0[2];
1531
  UINT8                                                 Reserved0[2];
1516
  UINT8                                                  Flags;
1532
  UINT8                                                 Flags;
1517
  UINT8                                                  Enabled;
1533
  UINT8                                                 Enabled;
1518
  UINT32                                                 NumberOfRecordsToPreAllocate;
1534
  UINT32                                                NumberOfRecordsToPreAllocate;
1519
  UINT32                                                 MaxSectionsPerRecord;
1535
  UINT32                                                MaxSectionsPerRecord;
1520
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1536
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1521
  UINT8                                                  NumberOfHardwareBanks;
1537
  UINT8                                                 NumberOfHardwareBanks;
1522
  UINT8                                                  Reserved1[3];
1538
  UINT8                                                 Reserved1[3];
1523
} EFI_ACPI_5_1_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1539
} EFI_ACPI_5_1_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1524
1540
1525
///
1541
///
1526
/// IA-32 Architecture NMI Error Structure Definition
1542
/// IA-32 Architecture NMI Error Structure Definition
1527
///
1543
///
1528
typedef struct {
1544
typedef struct {
1529
  UINT16  Type;
1545
  UINT16    Type;
1530
  UINT16  SourceId;
1546
  UINT16    SourceId;
1531
  UINT8   Reserved0[2];
1547
  UINT8     Reserved0[2];
1532
  UINT32  NumberOfRecordsToPreAllocate;
1548
  UINT32    NumberOfRecordsToPreAllocate;
1533
  UINT32  MaxSectionsPerRecord;
1549
  UINT32    MaxSectionsPerRecord;
1534
  UINT32  MaxRawDataLength;
1550
  UINT32    MaxRawDataLength;
1535
} EFI_ACPI_5_1_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1551
} EFI_ACPI_5_1_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1536
1552
1537
///
1553
///
1538
/// PCI Express Root Port AER Structure Definition
1554
/// PCI Express Root Port AER Structure Definition
1539
///
1555
///
1540
typedef struct {
1556
typedef struct {
1541
  UINT16  Type;
1557
  UINT16    Type;
1542
  UINT16  SourceId;
1558
  UINT16    SourceId;
1543
  UINT8   Reserved0[2];
1559
  UINT8     Reserved0[2];
1544
  UINT8   Flags;
1560
  UINT8     Flags;
1545
  UINT8   Enabled;
1561
  UINT8     Enabled;
1546
  UINT32  NumberOfRecordsToPreAllocate;
1562
  UINT32    NumberOfRecordsToPreAllocate;
1547
  UINT32  MaxSectionsPerRecord;
1563
  UINT32    MaxSectionsPerRecord;
1548
  UINT32  Bus;
1564
  UINT32    Bus;
1549
  UINT16  Device;
1565
  UINT16    Device;
1550
  UINT16  Function;
1566
  UINT16    Function;
1551
  UINT16  DeviceControl;
1567
  UINT16    DeviceControl;
1552
  UINT8   Reserved1[2];
1568
  UINT8     Reserved1[2];
1553
  UINT32  UncorrectableErrorMask;
1569
  UINT32    UncorrectableErrorMask;
1554
  UINT32  UncorrectableErrorSeverity;
1570
  UINT32    UncorrectableErrorSeverity;
1555
  UINT32  CorrectableErrorMask;
1571
  UINT32    CorrectableErrorMask;
1556
  UINT32  AdvancedErrorCapabilitiesAndControl;
1572
  UINT32    AdvancedErrorCapabilitiesAndControl;
1557
  UINT32  RootErrorCommand;
1573
  UINT32    RootErrorCommand;
1558
} EFI_ACPI_5_1_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1574
} EFI_ACPI_5_1_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1559
1575
1560
///
1576
///
1561
/// PCI Express Device AER Structure Definition
1577
/// PCI Express Device AER Structure Definition
1562
///
1578
///
1563
typedef struct {
1579
typedef struct {
1564
  UINT16  Type;
1580
  UINT16    Type;
1565
  UINT16  SourceId;
1581
  UINT16    SourceId;
1566
  UINT8   Reserved0[2];
1582
  UINT8     Reserved0[2];
1567
  UINT8   Flags;
1583
  UINT8     Flags;
1568
  UINT8   Enabled;
1584
  UINT8     Enabled;
1569
  UINT32  NumberOfRecordsToPreAllocate;
1585
  UINT32    NumberOfRecordsToPreAllocate;
1570
  UINT32  MaxSectionsPerRecord;
1586
  UINT32    MaxSectionsPerRecord;
1571
  UINT32  Bus;
1587
  UINT32    Bus;
1572
  UINT16  Device;
1588
  UINT16    Device;
1573
  UINT16  Function;
1589
  UINT16    Function;
1574
  UINT16  DeviceControl;
1590
  UINT16    DeviceControl;
1575
  UINT8   Reserved1[2];
1591
  UINT8     Reserved1[2];
1576
  UINT32  UncorrectableErrorMask;
1592
  UINT32    UncorrectableErrorMask;
1577
  UINT32  UncorrectableErrorSeverity;
1593
  UINT32    UncorrectableErrorSeverity;
1578
  UINT32  CorrectableErrorMask;
1594
  UINT32    CorrectableErrorMask;
1579
  UINT32  AdvancedErrorCapabilitiesAndControl;
1595
  UINT32    AdvancedErrorCapabilitiesAndControl;
1580
} EFI_ACPI_5_1_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1596
} EFI_ACPI_5_1_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1581
1597
1582
///
1598
///
1583
/// PCI Express Bridge AER Structure Definition
1599
/// PCI Express Bridge AER Structure Definition
1584
///
1600
///
1585
typedef struct {
1601
typedef struct {
1586
  UINT16  Type;
1602
  UINT16    Type;
1587
  UINT16  SourceId;
1603
  UINT16    SourceId;
1588
  UINT8   Reserved0[2];
1604
  UINT8     Reserved0[2];
1589
  UINT8   Flags;
1605
  UINT8     Flags;
1590
  UINT8   Enabled;
1606
  UINT8     Enabled;
1591
  UINT32  NumberOfRecordsToPreAllocate;
1607
  UINT32    NumberOfRecordsToPreAllocate;
1592
  UINT32  MaxSectionsPerRecord;
1608
  UINT32    MaxSectionsPerRecord;
1593
  UINT32  Bus;
1609
  UINT32    Bus;
1594
  UINT16  Device;
1610
  UINT16    Device;
1595
  UINT16  Function;
1611
  UINT16    Function;
1596
  UINT16  DeviceControl;
1612
  UINT16    DeviceControl;
1597
  UINT8   Reserved1[2];
1613
  UINT8     Reserved1[2];
1598
  UINT32  UncorrectableErrorMask;
1614
  UINT32    UncorrectableErrorMask;
1599
  UINT32  UncorrectableErrorSeverity;
1615
  UINT32    UncorrectableErrorSeverity;
1600
  UINT32  CorrectableErrorMask;
1616
  UINT32    CorrectableErrorMask;
1601
  UINT32  AdvancedErrorCapabilitiesAndControl;
1617
  UINT32    AdvancedErrorCapabilitiesAndControl;
1602
  UINT32  SecondaryUncorrectableErrorMask;
1618
  UINT32    SecondaryUncorrectableErrorMask;
1603
  UINT32  SecondaryUncorrectableErrorSeverity;
1619
  UINT32    SecondaryUncorrectableErrorSeverity;
1604
  UINT32  SecondaryAdvancedErrorCapabilitiesAndControl;
1620
  UINT32    SecondaryAdvancedErrorCapabilitiesAndControl;
1605
} EFI_ACPI_5_1_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1621
} EFI_ACPI_5_1_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1606
1622
1607
///
1623
///
1608
/// Generic Hardware Error Source Structure Definition
1624
/// Generic Hardware Error Source Structure Definition
1609
///
1625
///
1610
typedef struct {
1626
typedef struct {
1611
  UINT16                                                 Type;
1627
  UINT16                                                Type;
1612
  UINT16                                                 SourceId;
1628
  UINT16                                                SourceId;
1613
  UINT16                                                 RelatedSourceId;
1629
  UINT16                                                RelatedSourceId;
1614
  UINT8                                                  Flags;
1630
  UINT8                                                 Flags;
1615
  UINT8                                                  Enabled;
1631
  UINT8                                                 Enabled;
1616
  UINT32                                                 NumberOfRecordsToPreAllocate;
1632
  UINT32                                                NumberOfRecordsToPreAllocate;
1617
  UINT32                                                 MaxSectionsPerRecord;
1633
  UINT32                                                MaxSectionsPerRecord;
1618
  UINT32                                                 MaxRawDataLength;
1634
  UINT32                                                MaxRawDataLength;
1619
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE                 ErrorStatusAddress;
1635
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE                ErrorStatusAddress;
1620
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1636
  EFI_ACPI_5_1_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1621
  UINT32                                                 ErrorStatusBlockLength;
1637
  UINT32                                                ErrorStatusBlockLength;
1622
} EFI_ACPI_5_1_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1638
} EFI_ACPI_5_1_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1623
1639
1624
///
1640
///
1625
/// Generic Error Status Definition
1641
/// Generic Error Status Definition
1626
///
1642
///
1627
typedef struct {
1643
typedef struct {
1628
  EFI_ACPI_5_1_ERROR_BLOCK_STATUS              BlockStatus;
1644
  EFI_ACPI_5_1_ERROR_BLOCK_STATUS    BlockStatus;
1629
  UINT32                                       RawDataOffset;
1645
  UINT32                             RawDataOffset;
1630
  UINT32                                       RawDataLength;
1646
  UINT32                             RawDataLength;
1631
  UINT32                                       DataLength;
1647
  UINT32                             DataLength;
1632
  UINT32                                       ErrorSeverity;
1648
  UINT32                             ErrorSeverity;
1633
} EFI_ACPI_5_1_GENERIC_ERROR_STATUS_STRUCTURE;
1649
} EFI_ACPI_5_1_GENERIC_ERROR_STATUS_STRUCTURE;
1634
1650
1635
///
1651
///
1636
/// ERST - Error Record Serialization Table
1652
/// ERST - Error Record Serialization Table
1637
///
1653
///
1638
typedef struct {
1654
typedef struct {
1639
  EFI_ACPI_DESCRIPTION_HEADER Header;
1655
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1640
  UINT32                      SerializationHeaderSize;
1656
  UINT32                         SerializationHeaderSize;
1641
  UINT8                       Reserved0[4];
1657
  UINT8                          Reserved0[4];
1642
  UINT32                      InstructionEntryCount;
1658
  UINT32                         InstructionEntryCount;
1643
} EFI_ACPI_5_1_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1659
} EFI_ACPI_5_1_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1644
1660
1645
///
1661
///
1646
/// ERST Version (as defined in ACPI 5.1 spec.)
1662
/// ERST Version (as defined in ACPI 5.1 spec.)
1647
///
1663
///
1648
#define EFI_ACPI_5_1_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
1664
#define EFI_ACPI_5_1_ERROR_RECORD_SERIALIZATION_TABLE_REVISION  0x01
1649
1665
1650
///
1666
///
1651
/// ERST Serialization Actions
1667
/// ERST Serialization Actions
1652
///
1668
///
1653
#define EFI_ACPI_5_1_ERST_BEGIN_WRITE_OPERATION                    0x00
1669
#define EFI_ACPI_5_1_ERST_BEGIN_WRITE_OPERATION                   0x00
1654
#define EFI_ACPI_5_1_ERST_BEGIN_READ_OPERATION                     0x01
1670
#define EFI_ACPI_5_1_ERST_BEGIN_READ_OPERATION                    0x01
1655
#define EFI_ACPI_5_1_ERST_BEGIN_CLEAR_OPERATION                    0x02
1671
#define EFI_ACPI_5_1_ERST_BEGIN_CLEAR_OPERATION                   0x02
1656
#define EFI_ACPI_5_1_ERST_END_OPERATION                            0x03
1672
#define EFI_ACPI_5_1_ERST_END_OPERATION                           0x03
1657
#define EFI_ACPI_5_1_ERST_SET_RECORD_OFFSET                        0x04
1673
#define EFI_ACPI_5_1_ERST_SET_RECORD_OFFSET                       0x04
1658
#define EFI_ACPI_5_1_ERST_EXECUTE_OPERATION                        0x05
1674
#define EFI_ACPI_5_1_ERST_EXECUTE_OPERATION                       0x05
1659
#define EFI_ACPI_5_1_ERST_CHECK_BUSY_STATUS                        0x06
1675
#define EFI_ACPI_5_1_ERST_CHECK_BUSY_STATUS                       0x06
1660
#define EFI_ACPI_5_1_ERST_GET_COMMAND_STATUS                       0x07
1676
#define EFI_ACPI_5_1_ERST_GET_COMMAND_STATUS                      0x07
1661
#define EFI_ACPI_5_1_ERST_GET_RECORD_IDENTIFIER                    0x08
1677
#define EFI_ACPI_5_1_ERST_GET_RECORD_IDENTIFIER                   0x08
1662
#define EFI_ACPI_5_1_ERST_SET_RECORD_IDENTIFIER                    0x09
1678
#define EFI_ACPI_5_1_ERST_SET_RECORD_IDENTIFIER                   0x09
1663
#define EFI_ACPI_5_1_ERST_GET_RECORD_COUNT                         0x0A
1679
#define EFI_ACPI_5_1_ERST_GET_RECORD_COUNT                        0x0A
1664
#define EFI_ACPI_5_1_ERST_BEGIN_DUMMY_WRITE_OPERATION              0x0B
1680
#define EFI_ACPI_5_1_ERST_BEGIN_DUMMY_WRITE_OPERATION             0x0B
1665
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE              0x0D
1681
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE             0x0D
1666
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH       0x0E
1682
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH      0x0E
1667
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES   0x0F
1683
#define EFI_ACPI_5_1_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES  0x0F
1668
1684
1669
///
1685
///
1670
/// ERST Action Command Status
1686
/// ERST Action Command Status
1671
///
1687
///
1672
#define EFI_ACPI_5_1_ERST_STATUS_SUCCESS                           0x00
1688
#define EFI_ACPI_5_1_ERST_STATUS_SUCCESS                 0x00
1673
#define EFI_ACPI_5_1_ERST_STATUS_NOT_ENOUGH_SPACE                  0x01
1689
#define EFI_ACPI_5_1_ERST_STATUS_NOT_ENOUGH_SPACE        0x01
1674
#define EFI_ACPI_5_1_ERST_STATUS_HARDWARE_NOT_AVAILABLE            0x02
1690
#define EFI_ACPI_5_1_ERST_STATUS_HARDWARE_NOT_AVAILABLE  0x02
1675
#define EFI_ACPI_5_1_ERST_STATUS_FAILED                            0x03
1691
#define EFI_ACPI_5_1_ERST_STATUS_FAILED                  0x03
1676
#define EFI_ACPI_5_1_ERST_STATUS_RECORD_STORE_EMPTY                0x04
1692
#define EFI_ACPI_5_1_ERST_STATUS_RECORD_STORE_EMPTY      0x04
1677
#define EFI_ACPI_5_1_ERST_STATUS_RECORD_NOT_FOUND                  0x05
1693
#define EFI_ACPI_5_1_ERST_STATUS_RECORD_NOT_FOUND        0x05
1678
1694
1679
///
1695
///
1680
/// ERST Serialization Instructions
1696
/// ERST Serialization Instructions
1681
///
1697
///
1682
#define EFI_ACPI_5_1_ERST_READ_REGISTER                            0x00
1698
#define EFI_ACPI_5_1_ERST_READ_REGISTER                  0x00
1683
#define EFI_ACPI_5_1_ERST_READ_REGISTER_VALUE                      0x01
1699
#define EFI_ACPI_5_1_ERST_READ_REGISTER_VALUE            0x01
1684
#define EFI_ACPI_5_1_ERST_WRITE_REGISTER                           0x02
1700
#define EFI_ACPI_5_1_ERST_WRITE_REGISTER                 0x02
1685
#define EFI_ACPI_5_1_ERST_WRITE_REGISTER_VALUE                     0x03
1701
#define EFI_ACPI_5_1_ERST_WRITE_REGISTER_VALUE           0x03
1686
#define EFI_ACPI_5_1_ERST_NOOP                                     0x04
1702
#define EFI_ACPI_5_1_ERST_NOOP                           0x04
1687
#define EFI_ACPI_5_1_ERST_LOAD_VAR1                                0x05
1703
#define EFI_ACPI_5_1_ERST_LOAD_VAR1                      0x05
1688
#define EFI_ACPI_5_1_ERST_LOAD_VAR2                                0x06
1704
#define EFI_ACPI_5_1_ERST_LOAD_VAR2                      0x06
1689
#define EFI_ACPI_5_1_ERST_STORE_VAR1                               0x07
1705
#define EFI_ACPI_5_1_ERST_STORE_VAR1                     0x07
1690
#define EFI_ACPI_5_1_ERST_ADD                                      0x08
1706
#define EFI_ACPI_5_1_ERST_ADD                            0x08
1691
#define EFI_ACPI_5_1_ERST_SUBTRACT                                 0x09
1707
#define EFI_ACPI_5_1_ERST_SUBTRACT                       0x09
1692
#define EFI_ACPI_5_1_ERST_ADD_VALUE                                0x0A
1708
#define EFI_ACPI_5_1_ERST_ADD_VALUE                      0x0A
1693
#define EFI_ACPI_5_1_ERST_SUBTRACT_VALUE                           0x0B
1709
#define EFI_ACPI_5_1_ERST_SUBTRACT_VALUE                 0x0B
1694
#define EFI_ACPI_5_1_ERST_STALL                                    0x0C
1710
#define EFI_ACPI_5_1_ERST_STALL                          0x0C
1695
#define EFI_ACPI_5_1_ERST_STALL_WHILE_TRUE                         0x0D
1711
#define EFI_ACPI_5_1_ERST_STALL_WHILE_TRUE               0x0D
1696
#define EFI_ACPI_5_1_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE            0x0E
1712
#define EFI_ACPI_5_1_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE  0x0E
1697
#define EFI_ACPI_5_1_ERST_GOTO                                     0x0F
1713
#define EFI_ACPI_5_1_ERST_GOTO                           0x0F
1698
#define EFI_ACPI_5_1_ERST_SET_SRC_ADDRESS_BASE                     0x10
1714
#define EFI_ACPI_5_1_ERST_SET_SRC_ADDRESS_BASE           0x10
1699
#define EFI_ACPI_5_1_ERST_SET_DST_ADDRESS_BASE                     0x11
1715
#define EFI_ACPI_5_1_ERST_SET_DST_ADDRESS_BASE           0x11
1700
#define EFI_ACPI_5_1_ERST_MOVE_DATA                                0x12
1716
#define EFI_ACPI_5_1_ERST_MOVE_DATA                      0x12
1701
1717
1702
///
1718
///
1703
/// ERST Instruction Flags
1719
/// ERST Instruction Flags
1704
///
1720
///
1705
#define EFI_ACPI_5_1_ERST_PRESERVE_REGISTER                        0x01
1721
#define EFI_ACPI_5_1_ERST_PRESERVE_REGISTER  0x01
1706
1722
1707
///
1723
///
1708
/// ERST Serialization Instruction Entry
1724
/// ERST Serialization Instruction Entry
1709
///
1725
///
1710
typedef struct {
1726
typedef struct {
1711
  UINT8                                    SerializationAction;
1727
  UINT8                                     SerializationAction;
1712
  UINT8                                    Instruction;
1728
  UINT8                                     Instruction;
1713
  UINT8                                    Flags;
1729
  UINT8                                     Flags;
1714
  UINT8                                    Reserved0;
1730
  UINT8                                     Reserved0;
1715
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1731
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1716
  UINT64                                   Value;
1732
  UINT64                                    Value;
1717
  UINT64                                   Mask;
1733
  UINT64                                    Mask;
1718
} EFI_ACPI_5_1_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1734
} EFI_ACPI_5_1_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1719
1735
1720
///
1736
///
1721
/// EINJ - Error Injection Table
1737
/// EINJ - Error Injection Table
1722
///
1738
///
1723
typedef struct {
1739
typedef struct {
1724
  EFI_ACPI_DESCRIPTION_HEADER Header;
1740
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1725
  UINT32                      InjectionHeaderSize;
1741
  UINT32                         InjectionHeaderSize;
1726
  UINT8                       InjectionFlags;
1742
  UINT8                          InjectionFlags;
1727
  UINT8                       Reserved0[3];
1743
  UINT8                          Reserved0[3];
1728
  UINT32                      InjectionEntryCount;
1744
  UINT32                         InjectionEntryCount;
1729
} EFI_ACPI_5_1_ERROR_INJECTION_TABLE_HEADER;
1745
} EFI_ACPI_5_1_ERROR_INJECTION_TABLE_HEADER;
1730
1746
1731
///
1747
///
1732
/// EINJ Version (as defined in ACPI 5.1 spec.)
1748
/// EINJ Version (as defined in ACPI 5.1 spec.)
1733
///
1749
///
1734
#define EFI_ACPI_5_1_ERROR_INJECTION_TABLE_REVISION 0x01
1750
#define EFI_ACPI_5_1_ERROR_INJECTION_TABLE_REVISION  0x01
1735
1751
1736
///
1752
///
1737
/// EINJ Error Injection Actions
1753
/// EINJ Error Injection Actions
1738
///
1754
///
1739
#define EFI_ACPI_5_1_EINJ_BEGIN_INJECTION_OPERATION                0x00
1755
#define EFI_ACPI_5_1_EINJ_BEGIN_INJECTION_OPERATION       0x00
1740
#define EFI_ACPI_5_1_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE           0x01
1756
#define EFI_ACPI_5_1_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE  0x01
1741
#define EFI_ACPI_5_1_EINJ_SET_ERROR_TYPE                           0x02
1757
#define EFI_ACPI_5_1_EINJ_SET_ERROR_TYPE                  0x02
1742
#define EFI_ACPI_5_1_EINJ_GET_ERROR_TYPE                           0x03
1758
#define EFI_ACPI_5_1_EINJ_GET_ERROR_TYPE                  0x03
1743
#define EFI_ACPI_5_1_EINJ_END_OPERATION                            0x04
1759
#define EFI_ACPI_5_1_EINJ_END_OPERATION                   0x04
1744
#define EFI_ACPI_5_1_EINJ_EXECUTE_OPERATION                        0x05
1760
#define EFI_ACPI_5_1_EINJ_EXECUTE_OPERATION               0x05
1745
#define EFI_ACPI_5_1_EINJ_CHECK_BUSY_STATUS                        0x06
1761
#define EFI_ACPI_5_1_EINJ_CHECK_BUSY_STATUS               0x06
1746
#define EFI_ACPI_5_1_EINJ_GET_COMMAND_STATUS                       0x07
1762
#define EFI_ACPI_5_1_EINJ_GET_COMMAND_STATUS              0x07
1747
#define EFI_ACPI_5_1_EINJ_TRIGGER_ERROR                            0xFF
1763
#define EFI_ACPI_5_1_EINJ_TRIGGER_ERROR                   0xFF
1748
1764
1749
///
1765
///
1750
/// EINJ Action Command Status
1766
/// EINJ Action Command Status
1751
///
1767
///
1752
#define EFI_ACPI_5_1_EINJ_STATUS_SUCCESS                           0x00
1768
#define EFI_ACPI_5_1_EINJ_STATUS_SUCCESS          0x00
1753
#define EFI_ACPI_5_1_EINJ_STATUS_UNKNOWN_FAILURE                   0x01
1769
#define EFI_ACPI_5_1_EINJ_STATUS_UNKNOWN_FAILURE  0x01
1754
#define EFI_ACPI_5_1_EINJ_STATUS_INVALID_ACCESS                    0x02
1770
#define EFI_ACPI_5_1_EINJ_STATUS_INVALID_ACCESS   0x02
1755
1771
1756
///
1772
///
1757
/// EINJ Error Type Definition
1773
/// EINJ Error Type Definition
1758
///
1774
///
1759
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_CORRECTABLE                 (1 << 0)
1775
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_CORRECTABLE               (1 << 0)
1760
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL      (1 << 1)
1776
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL    (1 << 1)
1761
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL         (1 << 2)
1777
#define EFI_ACPI_5_1_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL       (1 << 2)
1762
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_CORRECTABLE                    (1 << 3)
1778
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_CORRECTABLE                  (1 << 3)
1763
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL         (1 << 4)
1779
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL       (1 << 4)
1764
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL            (1 << 5)
1780
#define EFI_ACPI_5_1_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL          (1 << 5)
1765
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE               (1 << 6)
1781
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE             (1 << 6)
1766
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL    (1 << 7)
1782
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL  (1 << 7)
1767
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL       (1 << 8)
1783
#define EFI_ACPI_5_1_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL     (1 << 8)
1768
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_CORRECTABLE                  (1 << 9)
1784
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_CORRECTABLE                (1 << 9)
1769
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL       (1 << 10)
1785
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL     (1 << 10)
1770
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL          (1 << 11)
1786
#define EFI_ACPI_5_1_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL        (1 << 11)
1771
1787
1772
///
1788
///
1773
/// EINJ Injection Instructions
1789
/// EINJ Injection Instructions
1774
///
1790
///
1775
#define EFI_ACPI_5_1_EINJ_READ_REGISTER                            0x00
1791
#define EFI_ACPI_5_1_EINJ_READ_REGISTER         0x00
1776
#define EFI_ACPI_5_1_EINJ_READ_REGISTER_VALUE                      0x01
1792
#define EFI_ACPI_5_1_EINJ_READ_REGISTER_VALUE   0x01
1777
#define EFI_ACPI_5_1_EINJ_WRITE_REGISTER                           0x02
1793
#define EFI_ACPI_5_1_EINJ_WRITE_REGISTER        0x02
1778
#define EFI_ACPI_5_1_EINJ_WRITE_REGISTER_VALUE                     0x03
1794
#define EFI_ACPI_5_1_EINJ_WRITE_REGISTER_VALUE  0x03
1779
#define EFI_ACPI_5_1_EINJ_NOOP                                     0x04
1795
#define EFI_ACPI_5_1_EINJ_NOOP                  0x04
1780
1796
1781
///
1797
///
1782
/// EINJ Instruction Flags
1798
/// EINJ Instruction Flags
1783
///
1799
///
1784
#define EFI_ACPI_5_1_EINJ_PRESERVE_REGISTER                        0x01
1800
#define EFI_ACPI_5_1_EINJ_PRESERVE_REGISTER  0x01
1785
1801
1786
///
1802
///
1787
/// EINJ Injection Instruction Entry
1803
/// EINJ Injection Instruction Entry
1788
///
1804
///
1789
typedef struct {
1805
typedef struct {
1790
  UINT8                                    InjectionAction;
1806
  UINT8                                     InjectionAction;
1791
  UINT8                                    Instruction;
1807
  UINT8                                     Instruction;
1792
  UINT8                                    Flags;
1808
  UINT8                                     Flags;
1793
  UINT8                                    Reserved0;
1809
  UINT8                                     Reserved0;
1794
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1810
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1795
  UINT64                                   Value;
1811
  UINT64                                    Value;
1796
  UINT64                                   Mask;
1812
  UINT64                                    Mask;
1797
} EFI_ACPI_5_1_EINJ_INJECTION_INSTRUCTION_ENTRY;
1813
} EFI_ACPI_5_1_EINJ_INJECTION_INSTRUCTION_ENTRY;
1798
1814
1799
///
1815
///
1800
/// EINJ Trigger Action Table
1816
/// EINJ Trigger Action Table
1801
///
1817
///
1802
typedef struct {
1818
typedef struct {
1803
  UINT32  HeaderSize;
1819
  UINT32    HeaderSize;
1804
  UINT32  Revision;
1820
  UINT32    Revision;
1805
  UINT32  TableSize;
1821
  UINT32    TableSize;
1806
  UINT32  EntryCount;
1822
  UINT32    EntryCount;
1807
} EFI_ACPI_5_1_EINJ_TRIGGER_ACTION_TABLE;
1823
} EFI_ACPI_5_1_EINJ_TRIGGER_ACTION_TABLE;
1808
1824
1809
///
1825
///
1810
/// Platform Communications Channel Table (PCCT)
1826
/// Platform Communications Channel Table (PCCT)
1811
///
1827
///
1812
typedef struct {
1828
typedef struct {
1813
  EFI_ACPI_DESCRIPTION_HEADER Header;
1829
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1814
  UINT32                      Flags;
1830
  UINT32                         Flags;
1815
  UINT64                      Reserved;
1831
  UINT64                         Reserved;
1816
} EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
1832
} EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
1817
1833
1818
///
1834
///
1819
/// PCCT Version (as defined in ACPI 5.1 spec.)
1835
/// PCCT Version (as defined in ACPI 5.1 spec.)
1820
///
1836
///
1821
#define EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION 0x01
1837
#define EFI_ACPI_5_1_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION  0x01
1822
1838
1823
///
1839
///
1824
/// PCCT Global Flags
1840
/// PCCT Global Flags
1825
///
1841
///
1826
#define EFI_ACPI_5_1_PCCT_FLAGS_SCI_DOORBELL                      BIT0
1842
#define EFI_ACPI_5_1_PCCT_FLAGS_SCI_DOORBELL  BIT0
1827
1843
1828
//
1844
//
1829
// PCCT Subspace type
1845
// PCCT Subspace type
Lines 1834-1858 typedef struct { Link Here
1834
/// PCC Subspace Structure Header
1850
/// PCC Subspace Structure Header
1835
///
1851
///
1836
typedef struct {
1852
typedef struct {
1837
  UINT8        Type;
1853
  UINT8    Type;
1838
  UINT8        Length;
1854
  UINT8    Length;
1839
} EFI_ACPI_5_1_PCCT_SUBSPACE_HEADER;
1855
} EFI_ACPI_5_1_PCCT_SUBSPACE_HEADER;
1840
1856
1841
///
1857
///
1842
/// Generic Communications Subspace Structure
1858
/// Generic Communications Subspace Structure
1843
///
1859
///
1844
typedef struct {
1860
typedef struct {
1845
  UINT8                                    Type;
1861
  UINT8                                     Type;
1846
  UINT8                                    Length;
1862
  UINT8                                     Length;
1847
  UINT8                                    Reserved[6];
1863
  UINT8                                     Reserved[6];
1848
  UINT64                                   BaseAddress;
1864
  UINT64                                    BaseAddress;
1849
  UINT64                                   AddressLength;
1865
  UINT64                                    AddressLength;
1850
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE   DoorbellRegister;
1866
  EFI_ACPI_5_1_GENERIC_ADDRESS_STRUCTURE    DoorbellRegister;
1851
  UINT64                                   DoorbellPreserve;
1867
  UINT64                                    DoorbellPreserve;
1852
  UINT64                                   DoorbellWrite;
1868
  UINT64                                    DoorbellWrite;
1853
  UINT32                                   NominalLatency;
1869
  UINT32                                    NominalLatency;
1854
  UINT32                                   MaximumPeriodicAccessRate;
1870
  UINT32                                    MaximumPeriodicAccessRate;
1855
  UINT16                                   MinimumRequestTurnaroundTime;
1871
  UINT16                                    MinimumRequestTurnaroundTime;
1856
} EFI_ACPI_5_1_PCCT_SUBSPACE_GENERIC;
1872
} EFI_ACPI_5_1_PCCT_SUBSPACE_GENERIC;
1857
1873
1858
///
1874
///
Lines 1860-1877 typedef struct { Link Here
1860
///
1876
///
1861
1877
1862
typedef struct {
1878
typedef struct {
1863
  UINT8                                    Command;
1879
  UINT8    Command;
1864
  UINT8                                    Reserved:7;
1880
  UINT8    Reserved    : 7;
1865
  UINT8                                    GenerateSci:1;
1881
  UINT8    GenerateSci : 1;
1866
} EFI_ACPI_5_1_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
1882
} EFI_ACPI_5_1_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
1867
1883
1868
typedef struct {
1884
typedef struct {
1869
  UINT8                                    CommandComplete:1;
1885
  UINT8    CommandComplete      : 1;
1870
  UINT8                                    SciDoorbell:1;
1886
  UINT8    SciDoorbell          : 1;
1871
  UINT8                                    Error:1;
1887
  UINT8    Error                : 1;
1872
  UINT8                                    PlatformNotification:1;
1888
  UINT8    PlatformNotification : 1;
1873
  UINT8                                    Reserved:4;
1889
  UINT8    Reserved             : 4;
1874
  UINT8                                    Reserved1;
1890
  UINT8    Reserved1;
1875
} EFI_ACPI_5_1_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
1891
} EFI_ACPI_5_1_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
1876
1892
1877
typedef struct {
1893
typedef struct {
(-)b/sys/contrib/edk2/Include/IndustryStandard/Acpi60.h (-944 / +960 lines)
Lines 1-7 Link Here
1
/** @file
1
/** @file
2
  ACPI 6.0 definitions from the ACPI Specification Revision 6.0 Errata A January, 2016.
2
  ACPI 6.0 definitions from the ACPI Specification Revision 6.0 Errata A January, 2016.
3
3
4
  Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
4
  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
5
  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
5
  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
6
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
6
  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
7
  SPDX-License-Identifier: BSD-2-Clause-Patent
7
  SPDX-License-Identifier: BSD-2-Clause-Patent
Lines 12-17 Link Here
12
12
13
#include <IndustryStandard/Acpi51.h>
13
#include <IndustryStandard/Acpi51.h>
14
14
15
///
16
/// _PSD Revision for ACPI 6.0
17
///
18
#define EFI_ACPI_6_0_AML_PSD_REVISION  0
19
20
///
21
/// _CPC Revision for ACPI 6.0
22
///
23
#define EFI_ACPI_6_0_AML_CPC_REVISION  2
24
15
//
25
//
16
// Ensure proper structure formats
26
// Ensure proper structure formats
17
//
27
//
Lines 21-41 Link Here
21
/// ACPI 6.0 Generic Address Space definition
31
/// ACPI 6.0 Generic Address Space definition
22
///
32
///
23
typedef struct {
33
typedef struct {
24
  UINT8   AddressSpaceId;
34
  UINT8     AddressSpaceId;
25
  UINT8   RegisterBitWidth;
35
  UINT8     RegisterBitWidth;
26
  UINT8   RegisterBitOffset;
36
  UINT8     RegisterBitOffset;
27
  UINT8   AccessSize;
37
  UINT8     AccessSize;
28
  UINT64  Address;
38
  UINT64    Address;
29
} EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE;
39
} EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE;
30
40
31
//
41
//
32
// Generic Address Space Address IDs
42
// Generic Address Space Address IDs
33
//
43
//
34
#define EFI_ACPI_6_0_SYSTEM_MEMORY              0
44
#define EFI_ACPI_6_0_SYSTEM_MEMORY                   0
35
#define EFI_ACPI_6_0_SYSTEM_IO                  1
45
#define EFI_ACPI_6_0_SYSTEM_IO                       1
36
#define EFI_ACPI_6_0_PCI_CONFIGURATION_SPACE    2
46
#define EFI_ACPI_6_0_PCI_CONFIGURATION_SPACE         2
37
#define EFI_ACPI_6_0_EMBEDDED_CONTROLLER        3
47
#define EFI_ACPI_6_0_EMBEDDED_CONTROLLER             3
38
#define EFI_ACPI_6_0_SMBUS                      4
48
#define EFI_ACPI_6_0_SMBUS                           4
39
#define EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL  0x0A
49
#define EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL  0x0A
40
#define EFI_ACPI_6_0_FUNCTIONAL_FIXED_HARDWARE       0x7F
50
#define EFI_ACPI_6_0_FUNCTIONAL_FIXED_HARDWARE       0x7F
41
51
Lines 56-84 typedef struct { Link Here
56
/// Root System Description Pointer Structure
66
/// Root System Description Pointer Structure
57
///
67
///
58
typedef struct {
68
typedef struct {
59
  UINT64  Signature;
69
  UINT64    Signature;
60
  UINT8   Checksum;
70
  UINT8     Checksum;
61
  UINT8   OemId[6];
71
  UINT8     OemId[6];
62
  UINT8   Revision;
72
  UINT8     Revision;
63
  UINT32  RsdtAddress;
73
  UINT32    RsdtAddress;
64
  UINT32  Length;
74
  UINT32    Length;
65
  UINT64  XsdtAddress;
75
  UINT64    XsdtAddress;
66
  UINT8   ExtendedChecksum;
76
  UINT8     ExtendedChecksum;
67
  UINT8   Reserved[3];
77
  UINT8     Reserved[3];
68
} EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
78
} EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
69
79
70
///
80
///
71
/// RSD_PTR Revision (as defined in ACPI 6.0 spec.)
81
/// RSD_PTR Revision (as defined in ACPI 6.0 spec.)
72
///
82
///
73
#define EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 6.0) says current value is 2
83
#define EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION  0x02 ///< ACPISpec (Revision 6.0) says current value is 2
74
84
75
///
85
///
76
/// Common table header, this prefaces all ACPI tables, including FACS, but
86
/// Common table header, this prefaces all ACPI tables, including FACS, but
77
/// excluding the RSD PTR structure
87
/// excluding the RSD PTR structure
78
///
88
///
79
typedef struct {
89
typedef struct {
80
  UINT32  Signature;
90
  UINT32    Signature;
81
  UINT32  Length;
91
  UINT32    Length;
82
} EFI_ACPI_6_0_COMMON_HEADER;
92
} EFI_ACPI_6_0_COMMON_HEADER;
83
93
84
//
94
//
Lines 90-96 typedef struct { Link Here
90
///
100
///
91
/// RSDT Revision (as defined in ACPI 6.0 spec.)
101
/// RSDT Revision (as defined in ACPI 6.0 spec.)
92
///
102
///
93
#define EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
103
#define EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
94
104
95
//
105
//
96
// Extended System Description Table
106
// Extended System Description Table
Lines 101-174 typedef struct { Link Here
101
///
111
///
102
/// XSDT Revision (as defined in ACPI 6.0 spec.)
112
/// XSDT Revision (as defined in ACPI 6.0 spec.)
103
///
113
///
104
#define EFI_ACPI_6_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
114
#define EFI_ACPI_6_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x01
105
115
106
///
116
///
107
/// Fixed ACPI Description Table Structure (FADT)
117
/// Fixed ACPI Description Table Structure (FADT)
108
///
118
///
109
typedef struct {
119
typedef struct {
110
  EFI_ACPI_DESCRIPTION_HEADER             Header;
120
  EFI_ACPI_DESCRIPTION_HEADER               Header;
111
  UINT32                                  FirmwareCtrl;
121
  UINT32                                    FirmwareCtrl;
112
  UINT32                                  Dsdt;
122
  UINT32                                    Dsdt;
113
  UINT8                                   Reserved0;
123
  UINT8                                     Reserved0;
114
  UINT8                                   PreferredPmProfile;
124
  UINT8                                     PreferredPmProfile;
115
  UINT16                                  SciInt;
125
  UINT16                                    SciInt;
116
  UINT32                                  SmiCmd;
126
  UINT32                                    SmiCmd;
117
  UINT8                                   AcpiEnable;
127
  UINT8                                     AcpiEnable;
118
  UINT8                                   AcpiDisable;
128
  UINT8                                     AcpiDisable;
119
  UINT8                                   S4BiosReq;
129
  UINT8                                     S4BiosReq;
120
  UINT8                                   PstateCnt;
130
  UINT8                                     PstateCnt;
121
  UINT32                                  Pm1aEvtBlk;
131
  UINT32                                    Pm1aEvtBlk;
122
  UINT32                                  Pm1bEvtBlk;
132
  UINT32                                    Pm1bEvtBlk;
123
  UINT32                                  Pm1aCntBlk;
133
  UINT32                                    Pm1aCntBlk;
124
  UINT32                                  Pm1bCntBlk;
134
  UINT32                                    Pm1bCntBlk;
125
  UINT32                                  Pm2CntBlk;
135
  UINT32                                    Pm2CntBlk;
126
  UINT32                                  PmTmrBlk;
136
  UINT32                                    PmTmrBlk;
127
  UINT32                                  Gpe0Blk;
137
  UINT32                                    Gpe0Blk;
128
  UINT32                                  Gpe1Blk;
138
  UINT32                                    Gpe1Blk;
129
  UINT8                                   Pm1EvtLen;
139
  UINT8                                     Pm1EvtLen;
130
  UINT8                                   Pm1CntLen;
140
  UINT8                                     Pm1CntLen;
131
  UINT8                                   Pm2CntLen;
141
  UINT8                                     Pm2CntLen;
132
  UINT8                                   PmTmrLen;
142
  UINT8                                     PmTmrLen;
133
  UINT8                                   Gpe0BlkLen;
143
  UINT8                                     Gpe0BlkLen;
134
  UINT8                                   Gpe1BlkLen;
144
  UINT8                                     Gpe1BlkLen;
135
  UINT8                                   Gpe1Base;
145
  UINT8                                     Gpe1Base;
136
  UINT8                                   CstCnt;
146
  UINT8                                     CstCnt;
137
  UINT16                                  PLvl2Lat;
147
  UINT16                                    PLvl2Lat;
138
  UINT16                                  PLvl3Lat;
148
  UINT16                                    PLvl3Lat;
139
  UINT16                                  FlushSize;
149
  UINT16                                    FlushSize;
140
  UINT16                                  FlushStride;
150
  UINT16                                    FlushStride;
141
  UINT8                                   DutyOffset;
151
  UINT8                                     DutyOffset;
142
  UINT8                                   DutyWidth;
152
  UINT8                                     DutyWidth;
143
  UINT8                                   DayAlrm;
153
  UINT8                                     DayAlrm;
144
  UINT8                                   MonAlrm;
154
  UINT8                                     MonAlrm;
145
  UINT8                                   Century;
155
  UINT8                                     Century;
146
  UINT16                                  IaPcBootArch;
156
  UINT16                                    IaPcBootArch;
147
  UINT8                                   Reserved1;
157
  UINT8                                     Reserved1;
148
  UINT32                                  Flags;
158
  UINT32                                    Flags;
149
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
159
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    ResetReg;
150
  UINT8                                   ResetValue;
160
  UINT8                                     ResetValue;
151
  UINT16                                  ArmBootArch;
161
  UINT16                                    ArmBootArch;
152
  UINT8                                   MinorVersion;
162
  UINT8                                     MinorVersion;
153
  UINT64                                  XFirmwareCtrl;
163
  UINT64                                    XFirmwareCtrl;
154
  UINT64                                  XDsdt;
164
  UINT64                                    XDsdt;
155
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
165
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
156
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
166
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
157
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
167
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
158
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
168
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
159
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
169
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
160
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
170
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
161
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
171
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
162
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
172
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
163
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  SleepControlReg;
173
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    SleepControlReg;
164
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg;
174
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    SleepStatusReg;
165
  UINT64                                  HypervisorVendorIdentity;
175
  UINT64                                    HypervisorVendorIdentity;
166
} EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE;
176
} EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE;
167
177
168
///
178
///
169
/// FADT Version (as defined in ACPI 6.0 spec.)
179
/// FADT Version (as defined in ACPI 6.0 spec.)
170
///
180
///
171
#define EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x06
181
#define EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION        0x06
172
#define EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION  0x00
182
#define EFI_ACPI_6_0_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION  0x00
173
183
174
//
184
//
Lines 188-249 typedef struct { Link Here
188
// Fixed ACPI Description Table Boot Architecture Flags
198
// Fixed ACPI Description Table Boot Architecture Flags
189
// All other bits are reserved and must be set to 0.
199
// All other bits are reserved and must be set to 0.
190
//
200
//
191
#define EFI_ACPI_6_0_LEGACY_DEVICES              BIT0
201
#define EFI_ACPI_6_0_LEGACY_DEVICES        BIT0
192
#define EFI_ACPI_6_0_8042                        BIT1
202
#define EFI_ACPI_6_0_8042                  BIT1
193
#define EFI_ACPI_6_0_VGA_NOT_PRESENT             BIT2
203
#define EFI_ACPI_6_0_VGA_NOT_PRESENT       BIT2
194
#define EFI_ACPI_6_0_MSI_NOT_SUPPORTED           BIT3
204
#define EFI_ACPI_6_0_MSI_NOT_SUPPORTED     BIT3
195
#define EFI_ACPI_6_0_PCIE_ASPM_CONTROLS          BIT4
205
#define EFI_ACPI_6_0_PCIE_ASPM_CONTROLS    BIT4
196
#define EFI_ACPI_6_0_CMOS_RTC_NOT_PRESENT        BIT5
206
#define EFI_ACPI_6_0_CMOS_RTC_NOT_PRESENT  BIT5
197
207
198
//
208
//
199
// Fixed ACPI Description Table Arm Boot Architecture Flags
209
// Fixed ACPI Description Table Arm Boot Architecture Flags
200
// All other bits are reserved and must be set to 0.
210
// All other bits are reserved and must be set to 0.
201
//
211
//
202
#define EFI_ACPI_6_0_ARM_PSCI_COMPLIANT              BIT0
212
#define EFI_ACPI_6_0_ARM_PSCI_COMPLIANT  BIT0
203
#define EFI_ACPI_6_0_ARM_PSCI_USE_HVC                BIT1
213
#define EFI_ACPI_6_0_ARM_PSCI_USE_HVC    BIT1
204
214
205
//
215
//
206
// Fixed ACPI Description Table Fixed Feature Flags
216
// Fixed ACPI Description Table Fixed Feature Flags
207
// All other bits are reserved and must be set to 0.
217
// All other bits are reserved and must be set to 0.
208
//
218
//
209
#define EFI_ACPI_6_0_WBINVD                                 BIT0
219
#define EFI_ACPI_6_0_WBINVD                                BIT0
210
#define EFI_ACPI_6_0_WBINVD_FLUSH                           BIT1
220
#define EFI_ACPI_6_0_WBINVD_FLUSH                          BIT1
211
#define EFI_ACPI_6_0_PROC_C1                                BIT2
221
#define EFI_ACPI_6_0_PROC_C1                               BIT2
212
#define EFI_ACPI_6_0_P_LVL2_UP                              BIT3
222
#define EFI_ACPI_6_0_P_LVL2_UP                             BIT3
213
#define EFI_ACPI_6_0_PWR_BUTTON                             BIT4
223
#define EFI_ACPI_6_0_PWR_BUTTON                            BIT4
214
#define EFI_ACPI_6_0_SLP_BUTTON                             BIT5
224
#define EFI_ACPI_6_0_SLP_BUTTON                            BIT5
215
#define EFI_ACPI_6_0_FIX_RTC                                BIT6
225
#define EFI_ACPI_6_0_FIX_RTC                               BIT6
216
#define EFI_ACPI_6_0_RTC_S4                                 BIT7
226
#define EFI_ACPI_6_0_RTC_S4                                BIT7
217
#define EFI_ACPI_6_0_TMR_VAL_EXT                            BIT8
227
#define EFI_ACPI_6_0_TMR_VAL_EXT                           BIT8
218
#define EFI_ACPI_6_0_DCK_CAP                                BIT9
228
#define EFI_ACPI_6_0_DCK_CAP                               BIT9
219
#define EFI_ACPI_6_0_RESET_REG_SUP                          BIT10
229
#define EFI_ACPI_6_0_RESET_REG_SUP                         BIT10
220
#define EFI_ACPI_6_0_SEALED_CASE                            BIT11
230
#define EFI_ACPI_6_0_SEALED_CASE                           BIT11
221
#define EFI_ACPI_6_0_HEADLESS                               BIT12
231
#define EFI_ACPI_6_0_HEADLESS                              BIT12
222
#define EFI_ACPI_6_0_CPU_SW_SLP                             BIT13
232
#define EFI_ACPI_6_0_CPU_SW_SLP                            BIT13
223
#define EFI_ACPI_6_0_PCI_EXP_WAK                            BIT14
233
#define EFI_ACPI_6_0_PCI_EXP_WAK                           BIT14
224
#define EFI_ACPI_6_0_USE_PLATFORM_CLOCK                     BIT15
234
#define EFI_ACPI_6_0_USE_PLATFORM_CLOCK                    BIT15
225
#define EFI_ACPI_6_0_S4_RTC_STS_VALID                       BIT16
235
#define EFI_ACPI_6_0_S4_RTC_STS_VALID                      BIT16
226
#define EFI_ACPI_6_0_REMOTE_POWER_ON_CAPABLE                BIT17
236
#define EFI_ACPI_6_0_REMOTE_POWER_ON_CAPABLE               BIT17
227
#define EFI_ACPI_6_0_FORCE_APIC_CLUSTER_MODEL               BIT18
237
#define EFI_ACPI_6_0_FORCE_APIC_CLUSTER_MODEL              BIT18
228
#define EFI_ACPI_6_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
238
#define EFI_ACPI_6_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE  BIT19
229
#define EFI_ACPI_6_0_HW_REDUCED_ACPI                        BIT20
239
#define EFI_ACPI_6_0_HW_REDUCED_ACPI                       BIT20
230
#define EFI_ACPI_6_0_LOW_POWER_S0_IDLE_CAPABLE              BIT21
240
#define EFI_ACPI_6_0_LOW_POWER_S0_IDLE_CAPABLE             BIT21
231
241
232
///
242
///
233
/// Firmware ACPI Control Structure
243
/// Firmware ACPI Control Structure
234
///
244
///
235
typedef struct {
245
typedef struct {
236
  UINT32  Signature;
246
  UINT32    Signature;
237
  UINT32  Length;
247
  UINT32    Length;
238
  UINT32  HardwareSignature;
248
  UINT32    HardwareSignature;
239
  UINT32  FirmwareWakingVector;
249
  UINT32    FirmwareWakingVector;
240
  UINT32  GlobalLock;
250
  UINT32    GlobalLock;
241
  UINT32  Flags;
251
  UINT32    Flags;
242
  UINT64  XFirmwareWakingVector;
252
  UINT64    XFirmwareWakingVector;
243
  UINT8   Version;
253
  UINT8     Version;
244
  UINT8   Reserved0[3];
254
  UINT8     Reserved0[3];
245
  UINT32  OspmFlags;
255
  UINT32    OspmFlags;
246
  UINT8   Reserved1[24];
256
  UINT8     Reserved1[24];
247
} EFI_ACPI_6_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
257
} EFI_ACPI_6_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
248
258
249
///
259
///
Lines 255-268 typedef struct { Link Here
255
/// Firmware Control Structure Feature Flags
265
/// Firmware Control Structure Feature Flags
256
/// All other bits are reserved and must be set to 0.
266
/// All other bits are reserved and must be set to 0.
257
///
267
///
258
#define EFI_ACPI_6_0_S4BIOS_F                     BIT0
268
#define EFI_ACPI_6_0_S4BIOS_F                BIT0
259
#define EFI_ACPI_6_0_64BIT_WAKE_SUPPORTED_F       BIT1
269
#define EFI_ACPI_6_0_64BIT_WAKE_SUPPORTED_F  BIT1
260
270
261
///
271
///
262
/// OSPM Enabled Firmware Control Structure Flags
272
/// OSPM Enabled Firmware Control Structure Flags
263
/// All other bits are reserved and must be set to 0.
273
/// All other bits are reserved and must be set to 0.
264
///
274
///
265
#define EFI_ACPI_6_0_OSPM_64BIT_WAKE_F            BIT0
275
#define EFI_ACPI_6_0_OSPM_64BIT_WAKE_F  BIT0
266
276
267
//
277
//
268
// Differentiated System Description Table,
278
// Differentiated System Description Table,
Lines 271-299 typedef struct { Link Here
271
// no definition needed as they are common description table header, the same with
281
// no definition needed as they are common description table header, the same with
272
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
282
// EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
273
//
283
//
274
#define EFI_ACPI_6_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
284
#define EFI_ACPI_6_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION  0x02
275
#define EFI_ACPI_6_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
285
#define EFI_ACPI_6_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION       0x02
276
286
277
///
287
///
278
/// Multiple APIC Description Table header definition.  The rest of the table
288
/// Multiple APIC Description Table header definition.  The rest of the table
279
/// must be defined in a platform specific manner.
289
/// must be defined in a platform specific manner.
280
///
290
///
281
typedef struct {
291
typedef struct {
282
  EFI_ACPI_DESCRIPTION_HEADER Header;
292
  EFI_ACPI_DESCRIPTION_HEADER    Header;
283
  UINT32                      LocalApicAddress;
293
  UINT32                         LocalApicAddress;
284
  UINT32                      Flags;
294
  UINT32                         Flags;
285
} EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
295
} EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
286
296
287
///
297
///
288
/// MADT Revision (as defined in ACPI 6.0 Errata A spec.)
298
/// MADT Revision (as defined in ACPI 6.0 Errata A spec.)
289
///
299
///
290
#define EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x04
300
#define EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION  0x04
291
301
292
///
302
///
293
/// Multiple APIC Flags
303
/// Multiple APIC Flags
294
/// All other bits are reserved and must be set to 0.
304
/// All other bits are reserved and must be set to 0.
295
///
305
///
296
#define EFI_ACPI_6_0_PCAT_COMPAT         BIT0
306
#define EFI_ACPI_6_0_PCAT_COMPAT  BIT0
297
307
298
//
308
//
299
// Multiple APIC Description Table APIC structure types
309
// Multiple APIC Description Table APIC structure types
Lines 325-381 typedef struct { Link Here
325
/// Processor Local APIC Structure Definition
335
/// Processor Local APIC Structure Definition
326
///
336
///
327
typedef struct {
337
typedef struct {
328
  UINT8   Type;
338
  UINT8     Type;
329
  UINT8   Length;
339
  UINT8     Length;
330
  UINT8   AcpiProcessorUid;
340
  UINT8     AcpiProcessorUid;
331
  UINT8   ApicId;
341
  UINT8     ApicId;
332
  UINT32  Flags;
342
  UINT32    Flags;
333
} EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
343
} EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
334
344
335
///
345
///
336
/// Local APIC Flags.  All other bits are reserved and must be 0.
346
/// Local APIC Flags.  All other bits are reserved and must be 0.
337
///
347
///
338
#define EFI_ACPI_6_0_LOCAL_APIC_ENABLED        BIT0
348
#define EFI_ACPI_6_0_LOCAL_APIC_ENABLED  BIT0
339
349
340
///
350
///
341
/// IO APIC Structure
351
/// IO APIC Structure
342
///
352
///
343
typedef struct {
353
typedef struct {
344
  UINT8   Type;
354
  UINT8     Type;
345
  UINT8   Length;
355
  UINT8     Length;
346
  UINT8   IoApicId;
356
  UINT8     IoApicId;
347
  UINT8   Reserved;
357
  UINT8     Reserved;
348
  UINT32  IoApicAddress;
358
  UINT32    IoApicAddress;
349
  UINT32  GlobalSystemInterruptBase;
359
  UINT32    GlobalSystemInterruptBase;
350
} EFI_ACPI_6_0_IO_APIC_STRUCTURE;
360
} EFI_ACPI_6_0_IO_APIC_STRUCTURE;
351
361
352
///
362
///
353
/// Interrupt Source Override Structure
363
/// Interrupt Source Override Structure
354
///
364
///
355
typedef struct {
365
typedef struct {
356
  UINT8   Type;
366
  UINT8     Type;
357
  UINT8   Length;
367
  UINT8     Length;
358
  UINT8   Bus;
368
  UINT8     Bus;
359
  UINT8   Source;
369
  UINT8     Source;
360
  UINT32  GlobalSystemInterrupt;
370
  UINT32    GlobalSystemInterrupt;
361
  UINT16  Flags;
371
  UINT16    Flags;
362
} EFI_ACPI_6_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
372
} EFI_ACPI_6_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
363
373
364
///
374
///
365
/// Platform Interrupt Sources Structure Definition
375
/// Platform Interrupt Sources Structure Definition
366
///
376
///
367
typedef struct {
377
typedef struct {
368
  UINT8   Type;
378
  UINT8     Type;
369
  UINT8   Length;
379
  UINT8     Length;
370
  UINT16  Flags;
380
  UINT16    Flags;
371
  UINT8   InterruptType;
381
  UINT8     InterruptType;
372
  UINT8   ProcessorId;
382
  UINT8     ProcessorId;
373
  UINT8   ProcessorEid;
383
  UINT8     ProcessorEid;
374
  UINT8   IoSapicVector;
384
  UINT8     IoSapicVector;
375
  UINT32  GlobalSystemInterrupt;
385
  UINT32    GlobalSystemInterrupt;
376
  UINT32  PlatformInterruptSourceFlags;
386
  UINT32    PlatformInterruptSourceFlags;
377
  UINT8   CpeiProcessorOverride;
387
  UINT8     CpeiProcessorOverride;
378
  UINT8   Reserved[31];
388
  UINT8     Reserved[31];
379
} EFI_ACPI_6_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
389
} EFI_ACPI_6_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
380
390
381
//
391
//
Lines 389-431 typedef struct { Link Here
389
/// Non-Maskable Interrupt Source Structure
399
/// Non-Maskable Interrupt Source Structure
390
///
400
///
391
typedef struct {
401
typedef struct {
392
  UINT8   Type;
402
  UINT8     Type;
393
  UINT8   Length;
403
  UINT8     Length;
394
  UINT16  Flags;
404
  UINT16    Flags;
395
  UINT32  GlobalSystemInterrupt;
405
  UINT32    GlobalSystemInterrupt;
396
} EFI_ACPI_6_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
406
} EFI_ACPI_6_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
397
407
398
///
408
///
399
/// Local APIC NMI Structure
409
/// Local APIC NMI Structure
400
///
410
///
401
typedef struct {
411
typedef struct {
402
  UINT8   Type;
412
  UINT8     Type;
403
  UINT8   Length;
413
  UINT8     Length;
404
  UINT8   AcpiProcessorUid;
414
  UINT8     AcpiProcessorUid;
405
  UINT16  Flags;
415
  UINT16    Flags;
406
  UINT8   LocalApicLint;
416
  UINT8     LocalApicLint;
407
} EFI_ACPI_6_0_LOCAL_APIC_NMI_STRUCTURE;
417
} EFI_ACPI_6_0_LOCAL_APIC_NMI_STRUCTURE;
408
418
409
///
419
///
410
/// Local APIC Address Override Structure
420
/// Local APIC Address Override Structure
411
///
421
///
412
typedef struct {
422
typedef struct {
413
  UINT8   Type;
423
  UINT8     Type;
414
  UINT8   Length;
424
  UINT8     Length;
415
  UINT16  Reserved;
425
  UINT16    Reserved;
416
  UINT64  LocalApicAddress;
426
  UINT64    LocalApicAddress;
417
} EFI_ACPI_6_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
427
} EFI_ACPI_6_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
418
428
419
///
429
///
420
/// IO SAPIC Structure
430
/// IO SAPIC Structure
421
///
431
///
422
typedef struct {
432
typedef struct {
423
  UINT8   Type;
433
  UINT8     Type;
424
  UINT8   Length;
434
  UINT8     Length;
425
  UINT8   IoApicId;
435
  UINT8     IoApicId;
426
  UINT8   Reserved;
436
  UINT8     Reserved;
427
  UINT32  GlobalSystemInterruptBase;
437
  UINT32    GlobalSystemInterruptBase;
428
  UINT64  IoSapicAddress;
438
  UINT64    IoSapicAddress;
429
} EFI_ACPI_6_0_IO_SAPIC_STRUCTURE;
439
} EFI_ACPI_6_0_IO_SAPIC_STRUCTURE;
430
440
431
///
441
///
Lines 433-601 typedef struct { Link Here
433
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
443
/// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
434
///
444
///
435
typedef struct {
445
typedef struct {
436
  UINT8   Type;
446
  UINT8     Type;
437
  UINT8   Length;
447
  UINT8     Length;
438
  UINT8   AcpiProcessorId;
448
  UINT8     AcpiProcessorId;
439
  UINT8   LocalSapicId;
449
  UINT8     LocalSapicId;
440
  UINT8   LocalSapicEid;
450
  UINT8     LocalSapicEid;
441
  UINT8   Reserved[3];
451
  UINT8     Reserved[3];
442
  UINT32  Flags;
452
  UINT32    Flags;
443
  UINT32  ACPIProcessorUIDValue;
453
  UINT32    ACPIProcessorUIDValue;
444
} EFI_ACPI_6_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
454
} EFI_ACPI_6_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
445
455
446
///
456
///
447
/// Platform Interrupt Sources Structure
457
/// Platform Interrupt Sources Structure
448
///
458
///
449
typedef struct {
459
typedef struct {
450
  UINT8   Type;
460
  UINT8     Type;
451
  UINT8   Length;
461
  UINT8     Length;
452
  UINT16  Flags;
462
  UINT16    Flags;
453
  UINT8   InterruptType;
463
  UINT8     InterruptType;
454
  UINT8   ProcessorId;
464
  UINT8     ProcessorId;
455
  UINT8   ProcessorEid;
465
  UINT8     ProcessorEid;
456
  UINT8   IoSapicVector;
466
  UINT8     IoSapicVector;
457
  UINT32  GlobalSystemInterrupt;
467
  UINT32    GlobalSystemInterrupt;
458
  UINT32  PlatformInterruptSourceFlags;
468
  UINT32    PlatformInterruptSourceFlags;
459
} EFI_ACPI_6_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
469
} EFI_ACPI_6_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
460
470
461
///
471
///
462
/// Platform Interrupt Source Flags.
472
/// Platform Interrupt Source Flags.
463
/// All other bits are reserved and must be set to 0.
473
/// All other bits are reserved and must be set to 0.
464
///
474
///
465
#define EFI_ACPI_6_0_CPEI_PROCESSOR_OVERRIDE          BIT0
475
#define EFI_ACPI_6_0_CPEI_PROCESSOR_OVERRIDE  BIT0
466
476
467
///
477
///
468
/// Processor Local x2APIC Structure Definition
478
/// Processor Local x2APIC Structure Definition
469
///
479
///
470
typedef struct {
480
typedef struct {
471
  UINT8   Type;
481
  UINT8     Type;
472
  UINT8   Length;
482
  UINT8     Length;
473
  UINT8   Reserved[2];
483
  UINT8     Reserved[2];
474
  UINT32  X2ApicId;
484
  UINT32    X2ApicId;
475
  UINT32  Flags;
485
  UINT32    Flags;
476
  UINT32  AcpiProcessorUid;
486
  UINT32    AcpiProcessorUid;
477
} EFI_ACPI_6_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
487
} EFI_ACPI_6_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
478
488
479
///
489
///
480
/// Local x2APIC NMI Structure
490
/// Local x2APIC NMI Structure
481
///
491
///
482
typedef struct {
492
typedef struct {
483
  UINT8   Type;
493
  UINT8     Type;
484
  UINT8   Length;
494
  UINT8     Length;
485
  UINT16  Flags;
495
  UINT16    Flags;
486
  UINT32  AcpiProcessorUid;
496
  UINT32    AcpiProcessorUid;
487
  UINT8   LocalX2ApicLint;
497
  UINT8     LocalX2ApicLint;
488
  UINT8   Reserved[3];
498
  UINT8     Reserved[3];
489
} EFI_ACPI_6_0_LOCAL_X2APIC_NMI_STRUCTURE;
499
} EFI_ACPI_6_0_LOCAL_X2APIC_NMI_STRUCTURE;
490
500
491
///
501
///
492
/// GIC Structure
502
/// GIC Structure
493
///
503
///
494
typedef struct {
504
typedef struct {
495
  UINT8   Type;
505
  UINT8     Type;
496
  UINT8   Length;
506
  UINT8     Length;
497
  UINT16  Reserved;
507
  UINT16    Reserved;
498
  UINT32  CPUInterfaceNumber;
508
  UINT32    CPUInterfaceNumber;
499
  UINT32  AcpiProcessorUid;
509
  UINT32    AcpiProcessorUid;
500
  UINT32  Flags;
510
  UINT32    Flags;
501
  UINT32  ParkingProtocolVersion;
511
  UINT32    ParkingProtocolVersion;
502
  UINT32  PerformanceInterruptGsiv;
512
  UINT32    PerformanceInterruptGsiv;
503
  UINT64  ParkedAddress;
513
  UINT64    ParkedAddress;
504
  UINT64  PhysicalBaseAddress;
514
  UINT64    PhysicalBaseAddress;
505
  UINT64  GICV;
515
  UINT64    GICV;
506
  UINT64  GICH;
516
  UINT64    GICH;
507
  UINT32  VGICMaintenanceInterrupt;
517
  UINT32    VGICMaintenanceInterrupt;
508
  UINT64  GICRBaseAddress;
518
  UINT64    GICRBaseAddress;
509
  UINT64  MPIDR;
519
  UINT64    MPIDR;
510
  UINT8   ProcessorPowerEfficiencyClass;
520
  UINT8     ProcessorPowerEfficiencyClass;
511
  UINT8   Reserved2[3];
521
  UINT8     Reserved2[3];
512
} EFI_ACPI_6_0_GIC_STRUCTURE;
522
} EFI_ACPI_6_0_GIC_STRUCTURE;
513
523
514
///
524
///
515
/// GIC Flags.  All other bits are reserved and must be 0.
525
/// GIC Flags.  All other bits are reserved and must be 0.
516
///
526
///
517
#define EFI_ACPI_6_0_GIC_ENABLED                              BIT0
527
#define EFI_ACPI_6_0_GIC_ENABLED                            BIT0
518
#define EFI_ACPI_6_0_PERFORMANCE_INTERRUPT_MODEL              BIT1
528
#define EFI_ACPI_6_0_PERFORMANCE_INTERRUPT_MODEL            BIT1
519
#define EFI_ACPI_6_0_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS    BIT2
529
#define EFI_ACPI_6_0_VGIC_MAINTENANCE_INTERRUPT_MODE_FLAGS  BIT2
520
530
521
///
531
///
522
/// GIC Distributor Structure
532
/// GIC Distributor Structure
523
///
533
///
524
typedef struct {
534
typedef struct {
525
  UINT8   Type;
535
  UINT8     Type;
526
  UINT8   Length;
536
  UINT8     Length;
527
  UINT16  Reserved1;
537
  UINT16    Reserved1;
528
  UINT32  GicId;
538
  UINT32    GicId;
529
  UINT64  PhysicalBaseAddress;
539
  UINT64    PhysicalBaseAddress;
530
  UINT32  SystemVectorBase;
540
  UINT32    SystemVectorBase;
531
  UINT8   GicVersion;
541
  UINT8     GicVersion;
532
  UINT8   Reserved2[3];
542
  UINT8     Reserved2[3];
533
} EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE;
543
} EFI_ACPI_6_0_GIC_DISTRIBUTOR_STRUCTURE;
534
544
535
///
545
///
536
/// GIC Version
546
/// GIC Version
537
///
547
///
538
#define EFI_ACPI_6_0_GIC_V1                                   0x01
548
#define EFI_ACPI_6_0_GIC_V1  0x01
539
#define EFI_ACPI_6_0_GIC_V2                                   0x02
549
#define EFI_ACPI_6_0_GIC_V2  0x02
540
#define EFI_ACPI_6_0_GIC_V3                                   0x03
550
#define EFI_ACPI_6_0_GIC_V3  0x03
541
#define EFI_ACPI_6_0_GIC_V4                                   0x04
551
#define EFI_ACPI_6_0_GIC_V4  0x04
542
552
543
///
553
///
544
/// GIC MSI Frame Structure
554
/// GIC MSI Frame Structure
545
///
555
///
546
typedef struct {
556
typedef struct {
547
  UINT8   Type;
557
  UINT8     Type;
548
  UINT8   Length;
558
  UINT8     Length;
549
  UINT16  Reserved1;
559
  UINT16    Reserved1;
550
  UINT32  GicMsiFrameId;
560
  UINT32    GicMsiFrameId;
551
  UINT64  PhysicalBaseAddress;
561
  UINT64    PhysicalBaseAddress;
552
  UINT32  Flags;
562
  UINT32    Flags;
553
  UINT16  SPICount;
563
  UINT16    SPICount;
554
  UINT16  SPIBase;
564
  UINT16    SPIBase;
555
} EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE;
565
} EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE;
556
566
557
///
567
///
558
/// GIC MSI Frame Flags.  All other bits are reserved and must be 0.
568
/// GIC MSI Frame Flags.  All other bits are reserved and must be 0.
559
///
569
///
560
#define EFI_ACPI_6_0_SPI_COUNT_BASE_SELECT                    BIT0
570
#define EFI_ACPI_6_0_SPI_COUNT_BASE_SELECT  BIT0
561
571
562
///
572
///
563
/// GICR Structure
573
/// GICR Structure
564
///
574
///
565
typedef struct {
575
typedef struct {
566
  UINT8   Type;
576
  UINT8     Type;
567
  UINT8   Length;
577
  UINT8     Length;
568
  UINT16  Reserved;
578
  UINT16    Reserved;
569
  UINT64  DiscoveryRangeBaseAddress;
579
  UINT64    DiscoveryRangeBaseAddress;
570
  UINT32  DiscoveryRangeLength;
580
  UINT32    DiscoveryRangeLength;
571
} EFI_ACPI_6_0_GICR_STRUCTURE;
581
} EFI_ACPI_6_0_GICR_STRUCTURE;
572
582
573
///
583
///
574
/// GIC Interrupt Translation Service Structure
584
/// GIC Interrupt Translation Service Structure
575
///
585
///
576
typedef struct {
586
typedef struct {
577
  UINT8   Type;
587
  UINT8     Type;
578
  UINT8   Length;
588
  UINT8     Length;
579
  UINT16  Reserved;
589
  UINT16    Reserved;
580
  UINT32  GicItsId;
590
  UINT32    GicItsId;
581
  UINT64  PhysicalBaseAddress;
591
  UINT64    PhysicalBaseAddress;
582
  UINT32  Reserved2;
592
  UINT32    Reserved2;
583
} EFI_ACPI_6_0_GIC_ITS_STRUCTURE;
593
} EFI_ACPI_6_0_GIC_ITS_STRUCTURE;
584
594
585
///
595
///
586
/// Smart Battery Description Table (SBST)
596
/// Smart Battery Description Table (SBST)
587
///
597
///
588
typedef struct {
598
typedef struct {
589
  EFI_ACPI_DESCRIPTION_HEADER Header;
599
  EFI_ACPI_DESCRIPTION_HEADER    Header;
590
  UINT32                      WarningEnergyLevel;
600
  UINT32                         WarningEnergyLevel;
591
  UINT32                      LowEnergyLevel;
601
  UINT32                         LowEnergyLevel;
592
  UINT32                      CriticalEnergyLevel;
602
  UINT32                         CriticalEnergyLevel;
593
} EFI_ACPI_6_0_SMART_BATTERY_DESCRIPTION_TABLE;
603
} EFI_ACPI_6_0_SMART_BATTERY_DESCRIPTION_TABLE;
594
604
595
///
605
///
596
/// SBST Version (as defined in ACPI 6.0 spec.)
606
/// SBST Version (as defined in ACPI 6.0 spec.)
597
///
607
///
598
#define EFI_ACPI_6_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
608
#define EFI_ACPI_6_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION  0x01
599
609
600
///
610
///
601
/// Embedded Controller Boot Resources Table (ECDT)
611
/// Embedded Controller Boot Resources Table (ECDT)
Lines 603-613 typedef struct { Link Here
603
/// a fully qualified reference to the name space object.
613
/// a fully qualified reference to the name space object.
604
///
614
///
605
typedef struct {
615
typedef struct {
606
  EFI_ACPI_DESCRIPTION_HEADER             Header;
616
  EFI_ACPI_DESCRIPTION_HEADER               Header;
607
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
617
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    EcControl;
608
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE  EcData;
618
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    EcData;
609
  UINT32                                  Uid;
619
  UINT32                                    Uid;
610
  UINT8                                   GpeBit;
620
  UINT8                                     GpeBit;
611
} EFI_ACPI_6_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
621
} EFI_ACPI_6_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
612
622
613
///
623
///
Lines 620-628 typedef struct { Link Here
620
/// must be defined in a platform specific manner.
630
/// must be defined in a platform specific manner.
621
///
631
///
622
typedef struct {
632
typedef struct {
623
  EFI_ACPI_DESCRIPTION_HEADER Header;
633
  EFI_ACPI_DESCRIPTION_HEADER    Header;
624
  UINT32                      Reserved1;  ///< Must be set to 1
634
  UINT32                         Reserved1; ///< Must be set to 1
625
  UINT64                      Reserved2;
635
  UINT64                         Reserved2;
626
} EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
636
} EFI_ACPI_6_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
627
637
628
///
638
///
Lines 644-726 typedef struct { Link Here
644
/// Processor Local APIC/SAPIC Affinity Structure Definition
654
/// Processor Local APIC/SAPIC Affinity Structure Definition
645
///
655
///
646
typedef struct {
656
typedef struct {
647
  UINT8   Type;
657
  UINT8     Type;
648
  UINT8   Length;
658
  UINT8     Length;
649
  UINT8   ProximityDomain7To0;
659
  UINT8     ProximityDomain7To0;
650
  UINT8   ApicId;
660
  UINT8     ApicId;
651
  UINT32  Flags;
661
  UINT32    Flags;
652
  UINT8   LocalSapicEid;
662
  UINT8     LocalSapicEid;
653
  UINT8   ProximityDomain31To8[3];
663
  UINT8     ProximityDomain31To8[3];
654
  UINT32  ClockDomain;
664
  UINT32    ClockDomain;
655
} EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
665
} EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
656
666
657
///
667
///
658
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
668
/// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
659
///
669
///
660
#define EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
670
#define EFI_ACPI_6_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED  (1 << 0)
661
671
662
///
672
///
663
/// Memory Affinity Structure Definition
673
/// Memory Affinity Structure Definition
664
///
674
///
665
typedef struct {
675
typedef struct {
666
  UINT8   Type;
676
  UINT8     Type;
667
  UINT8   Length;
677
  UINT8     Length;
668
  UINT32  ProximityDomain;
678
  UINT32    ProximityDomain;
669
  UINT16  Reserved1;
679
  UINT16    Reserved1;
670
  UINT32  AddressBaseLow;
680
  UINT32    AddressBaseLow;
671
  UINT32  AddressBaseHigh;
681
  UINT32    AddressBaseHigh;
672
  UINT32  LengthLow;
682
  UINT32    LengthLow;
673
  UINT32  LengthHigh;
683
  UINT32    LengthHigh;
674
  UINT32  Reserved2;
684
  UINT32    Reserved2;
675
  UINT32  Flags;
685
  UINT32    Flags;
676
  UINT64  Reserved3;
686
  UINT64    Reserved3;
677
} EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE;
687
} EFI_ACPI_6_0_MEMORY_AFFINITY_STRUCTURE;
678
688
679
//
689
//
680
// Memory Flags.  All other bits are reserved and must be 0.
690
// Memory Flags.  All other bits are reserved and must be 0.
681
//
691
//
682
#define EFI_ACPI_6_0_MEMORY_ENABLED       (1 << 0)
692
#define EFI_ACPI_6_0_MEMORY_ENABLED        (1 << 0)
683
#define EFI_ACPI_6_0_MEMORY_HOT_PLUGGABLE (1 << 1)
693
#define EFI_ACPI_6_0_MEMORY_HOT_PLUGGABLE  (1 << 1)
684
#define EFI_ACPI_6_0_MEMORY_NONVOLATILE   (1 << 2)
694
#define EFI_ACPI_6_0_MEMORY_NONVOLATILE    (1 << 2)
685
695
686
///
696
///
687
/// Processor Local x2APIC Affinity Structure Definition
697
/// Processor Local x2APIC Affinity Structure Definition
688
///
698
///
689
typedef struct {
699
typedef struct {
690
  UINT8   Type;
700
  UINT8     Type;
691
  UINT8   Length;
701
  UINT8     Length;
692
  UINT8   Reserved1[2];
702
  UINT8     Reserved1[2];
693
  UINT32  ProximityDomain;
703
  UINT32    ProximityDomain;
694
  UINT32  X2ApicId;
704
  UINT32    X2ApicId;
695
  UINT32  Flags;
705
  UINT32    Flags;
696
  UINT32  ClockDomain;
706
  UINT32    ClockDomain;
697
  UINT8   Reserved2[4];
707
  UINT8     Reserved2[4];
698
} EFI_ACPI_6_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
708
} EFI_ACPI_6_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
699
709
700
///
710
///
701
/// GICC Affinity Structure Definition
711
/// GICC Affinity Structure Definition
702
///
712
///
703
typedef struct {
713
typedef struct {
704
  UINT8   Type;
714
  UINT8     Type;
705
  UINT8   Length;
715
  UINT8     Length;
706
  UINT32  ProximityDomain;
716
  UINT32    ProximityDomain;
707
  UINT32  AcpiProcessorUid;
717
  UINT32    AcpiProcessorUid;
708
  UINT32  Flags;
718
  UINT32    Flags;
709
  UINT32  ClockDomain;
719
  UINT32    ClockDomain;
710
} EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE;
720
} EFI_ACPI_6_0_GICC_AFFINITY_STRUCTURE;
711
721
712
///
722
///
713
/// GICC Flags.  All other bits are reserved and must be 0.
723
/// GICC Flags.  All other bits are reserved and must be 0.
714
///
724
///
715
#define EFI_ACPI_6_0_GICC_ENABLED (1 << 0)
725
#define EFI_ACPI_6_0_GICC_ENABLED  (1 << 0)
716
726
717
///
727
///
718
/// System Locality Distance Information Table (SLIT).
728
/// System Locality Distance Information Table (SLIT).
719
/// The rest of the table is a matrix.
729
/// The rest of the table is a matrix.
720
///
730
///
721
typedef struct {
731
typedef struct {
722
  EFI_ACPI_DESCRIPTION_HEADER Header;
732
  EFI_ACPI_DESCRIPTION_HEADER    Header;
723
  UINT64                      NumberOfSystemLocalities;
733
  UINT64                         NumberOfSystemLocalities;
724
} EFI_ACPI_6_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
734
} EFI_ACPI_6_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
725
735
726
///
736
///
Lines 732-745 typedef struct { Link Here
732
/// Corrected Platform Error Polling Table (CPEP)
742
/// Corrected Platform Error Polling Table (CPEP)
733
///
743
///
734
typedef struct {
744
typedef struct {
735
  EFI_ACPI_DESCRIPTION_HEADER Header;
745
  EFI_ACPI_DESCRIPTION_HEADER    Header;
736
  UINT8                       Reserved[8];
746
  UINT8                          Reserved[8];
737
} EFI_ACPI_6_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
747
} EFI_ACPI_6_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
738
748
739
///
749
///
740
/// CPEP Version (as defined in ACPI 6.0 spec.)
750
/// CPEP Version (as defined in ACPI 6.0 spec.)
741
///
751
///
742
#define EFI_ACPI_6_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
752
#define EFI_ACPI_6_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION  0x01
743
753
744
//
754
//
745
// CPEP processor structure types.
755
// CPEP processor structure types.
Lines 750-815 typedef struct { Link Here
750
/// Corrected Platform Error Polling Processor Structure Definition
760
/// Corrected Platform Error Polling Processor Structure Definition
751
///
761
///
752
typedef struct {
762
typedef struct {
753
  UINT8   Type;
763
  UINT8     Type;
754
  UINT8   Length;
764
  UINT8     Length;
755
  UINT8   ProcessorId;
765
  UINT8     ProcessorId;
756
  UINT8   ProcessorEid;
766
  UINT8     ProcessorEid;
757
  UINT32  PollingInterval;
767
  UINT32    PollingInterval;
758
} EFI_ACPI_6_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
768
} EFI_ACPI_6_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
759
769
760
///
770
///
761
/// Maximum System Characteristics Table (MSCT)
771
/// Maximum System Characteristics Table (MSCT)
762
///
772
///
763
typedef struct {
773
typedef struct {
764
  EFI_ACPI_DESCRIPTION_HEADER Header;
774
  EFI_ACPI_DESCRIPTION_HEADER    Header;
765
  UINT32                      OffsetProxDomInfo;
775
  UINT32                         OffsetProxDomInfo;
766
  UINT32                      MaximumNumberOfProximityDomains;
776
  UINT32                         MaximumNumberOfProximityDomains;
767
  UINT32                      MaximumNumberOfClockDomains;
777
  UINT32                         MaximumNumberOfClockDomains;
768
  UINT64                      MaximumPhysicalAddress;
778
  UINT64                         MaximumPhysicalAddress;
769
} EFI_ACPI_6_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
779
} EFI_ACPI_6_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
770
780
771
///
781
///
772
/// MSCT Version (as defined in ACPI 6.0 spec.)
782
/// MSCT Version (as defined in ACPI 6.0 spec.)
773
///
783
///
774
#define EFI_ACPI_6_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
784
#define EFI_ACPI_6_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION  0x01
775
785
776
///
786
///
777
/// Maximum Proximity Domain Information Structure Definition
787
/// Maximum Proximity Domain Information Structure Definition
778
///
788
///
779
typedef struct {
789
typedef struct {
780
  UINT8   Revision;
790
  UINT8     Revision;
781
  UINT8   Length;
791
  UINT8     Length;
782
  UINT32  ProximityDomainRangeLow;
792
  UINT32    ProximityDomainRangeLow;
783
  UINT32  ProximityDomainRangeHigh;
793
  UINT32    ProximityDomainRangeHigh;
784
  UINT32  MaximumProcessorCapacity;
794
  UINT32    MaximumProcessorCapacity;
785
  UINT64  MaximumMemoryCapacity;
795
  UINT64    MaximumMemoryCapacity;
786
} EFI_ACPI_6_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
796
} EFI_ACPI_6_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
787
797
788
///
798
///
789
/// ACPI RAS Feature Table definition.
799
/// ACPI RAS Feature Table definition.
790
///
800
///
791
typedef struct {
801
typedef struct {
792
  EFI_ACPI_DESCRIPTION_HEADER Header;
802
  EFI_ACPI_DESCRIPTION_HEADER    Header;
793
  UINT8                       PlatformCommunicationChannelIdentifier[12];
803
  UINT8                          PlatformCommunicationChannelIdentifier[12];
794
} EFI_ACPI_6_0_RAS_FEATURE_TABLE;
804
} EFI_ACPI_6_0_RAS_FEATURE_TABLE;
795
805
796
///
806
///
797
/// RASF Version (as defined in ACPI 6.0 spec.)
807
/// RASF Version (as defined in ACPI 6.0 spec.)
798
///
808
///
799
#define EFI_ACPI_6_0_RAS_FEATURE_TABLE_REVISION 0x01
809
#define EFI_ACPI_6_0_RAS_FEATURE_TABLE_REVISION  0x01
800
810
801
///
811
///
802
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
812
/// ACPI RASF Platform Communication Channel Shared Memory Region definition.
803
///
813
///
804
typedef struct {
814
typedef struct {
805
  UINT32                      Signature;
815
  UINT32    Signature;
806
  UINT16                      Command;
816
  UINT16    Command;
807
  UINT16                      Status;
817
  UINT16    Status;
808
  UINT16                      Version;
818
  UINT16    Version;
809
  UINT8                       RASCapabilities[16];
819
  UINT8     RASCapabilities[16];
810
  UINT8                       SetRASCapabilities[16];
820
  UINT8     SetRASCapabilities[16];
811
  UINT16                      NumberOfRASFParameterBlocks;
821
  UINT16    NumberOfRASFParameterBlocks;
812
  UINT32                      SetRASCapabilitiesStatus;
822
  UINT32    SetRASCapabilitiesStatus;
813
} EFI_ACPI_6_0_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
823
} EFI_ACPI_6_0_RASF_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
814
824
815
///
825
///
Lines 827-878 typedef struct { Link Here
827
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
837
/// ACPI RASF Parameter Block structure for PATROL_SCRUB
828
///
838
///
829
typedef struct {
839
typedef struct {
830
  UINT16                      Type;
840
  UINT16    Type;
831
  UINT16                      Version;
841
  UINT16    Version;
832
  UINT16                      Length;
842
  UINT16    Length;
833
  UINT16                      PatrolScrubCommand;
843
  UINT16    PatrolScrubCommand;
834
  UINT64                      RequestedAddressRange[2];
844
  UINT64    RequestedAddressRange[2];
835
  UINT64                      ActualAddressRange[2];
845
  UINT64    ActualAddressRange[2];
836
  UINT16                      Flags;
846
  UINT16    Flags;
837
  UINT8                       RequestedSpeed;
847
  UINT8     RequestedSpeed;
838
} EFI_ACPI_6_0_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
848
} EFI_ACPI_6_0_RASF_PATROL_SCRUB_PLATFORM_BLOCK_STRUCTURE;
839
849
840
///
850
///
841
/// ACPI RASF Patrol Scrub command
851
/// ACPI RASF Patrol Scrub command
842
///
852
///
843
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS   0x01
853
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_GET_PATROL_PARAMETERS  0x01
844
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER   0x02
854
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_START_PATROL_SCRUBBER  0x02
845
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER    0x03
855
#define EFI_ACPI_6_0_RASF_PATROL_SCRUB_COMMAND_STOP_PATROL_SCRUBBER   0x03
846
856
847
///
857
///
848
/// Memory Power State Table definition.
858
/// Memory Power State Table definition.
849
///
859
///
850
typedef struct {
860
typedef struct {
851
  EFI_ACPI_DESCRIPTION_HEADER Header;
861
  EFI_ACPI_DESCRIPTION_HEADER    Header;
852
  UINT8                       PlatformCommunicationChannelIdentifier;
862
  UINT8                          PlatformCommunicationChannelIdentifier;
853
  UINT8                       Reserved[3];
863
  UINT8                          Reserved[3];
854
// Memory Power Node Structure
864
  // Memory Power Node Structure
855
// Memory Power State Characteristics
865
  // Memory Power State Characteristics
856
} EFI_ACPI_6_0_MEMORY_POWER_STATUS_TABLE;
866
} EFI_ACPI_6_0_MEMORY_POWER_STATUS_TABLE;
857
867
858
///
868
///
859
/// MPST Version (as defined in ACPI 6.0 spec.)
869
/// MPST Version (as defined in ACPI 6.0 spec.)
860
///
870
///
861
#define EFI_ACPI_6_0_MEMORY_POWER_STATE_TABLE_REVISION 0x01
871
#define EFI_ACPI_6_0_MEMORY_POWER_STATE_TABLE_REVISION  0x01
862
872
863
///
873
///
864
/// MPST Platform Communication Channel Shared Memory Region definition.
874
/// MPST Platform Communication Channel Shared Memory Region definition.
865
///
875
///
866
typedef struct {
876
typedef struct {
867
  UINT32                      Signature;
877
  UINT32    Signature;
868
  UINT16                      Command;
878
  UINT16    Command;
869
  UINT16                      Status;
879
  UINT16    Status;
870
  UINT32                      MemoryPowerCommandRegister;
880
  UINT32    MemoryPowerCommandRegister;
871
  UINT32                      MemoryPowerStatusRegister;
881
  UINT32    MemoryPowerStatusRegister;
872
  UINT32                      PowerStateId;
882
  UINT32    PowerStateId;
873
  UINT32                      MemoryPowerNodeId;
883
  UINT32    MemoryPowerNodeId;
874
  UINT64                      MemoryEnergyConsumed;
884
  UINT64    MemoryEnergyConsumed;
875
  UINT64                      ExpectedAveragePowerComsuned;
885
  UINT64    ExpectedAveragePowerComsuned;
876
} EFI_ACPI_6_0_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
886
} EFI_ACPI_6_0_MPST_PLATFORM_COMMUNICATION_CHANNEL_SHARED_MEMORY_REGION;
877
887
878
///
888
///
Lines 883-1068 typedef struct { Link Here
883
///
893
///
884
/// ACPI MPST Memory Power command
894
/// ACPI MPST Memory Power command
885
///
895
///
886
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE       0x01
896
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_POWER_STATE      0x01
887
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE       0x02
897
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_SET_MEMORY_POWER_STATE      0x02
888
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED   0x03
898
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_AVERAGE_POWER_CONSUMED  0x03
889
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED   0x04
899
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_COMMAND_GET_MEMORY_ENERGY_CONSUMED  0x04
890
900
891
///
901
///
892
/// MPST Memory Power Node Table
902
/// MPST Memory Power Node Table
893
///
903
///
894
typedef struct {
904
typedef struct {
895
  UINT8                                             PowerStateValue;
905
  UINT8    PowerStateValue;
896
  UINT8                                             PowerStateInformationIndex;
906
  UINT8    PowerStateInformationIndex;
897
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE;
907
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE;
898
908
899
typedef struct {
909
typedef struct {
900
  UINT8                                             Flag;
910
  UINT8     Flag;
901
  UINT8                                             Reserved;
911
  UINT8     Reserved;
902
  UINT16                                            MemoryPowerNodeId;
912
  UINT16    MemoryPowerNodeId;
903
  UINT32                                            Length;
913
  UINT32    Length;
904
  UINT64                                            AddressBase;
914
  UINT64    AddressBase;
905
  UINT64                                            AddressLength;
915
  UINT64    AddressLength;
906
  UINT32                                            NumberOfPowerStates;
916
  UINT32    NumberOfPowerStates;
907
  UINT32                                            NumberOfPhysicalComponents;
917
  UINT32    NumberOfPhysicalComponents;
908
//EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
918
  // EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE              MemoryPowerState[NumberOfPowerStates];
909
//UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
919
  // UINT16                                            PhysicalComponentIdentifier[NumberOfPhysicalComponents];
910
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE;
920
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE;
911
921
912
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE          0x01
922
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_ENABLE         0x01
913
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED   0x02
923
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_POWER_MANAGED  0x02
914
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE   0x04
924
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STRUCTURE_FLAG_HOT_PLUGGABLE  0x04
915
925
916
typedef struct {
926
typedef struct {
917
  UINT16                      MemoryPowerNodeCount;
927
  UINT16    MemoryPowerNodeCount;
918
  UINT8                       Reserved[2];
928
  UINT8     Reserved[2];
919
} EFI_ACPI_6_0_MPST_MEMORY_POWER_NODE_TABLE;
929
} EFI_ACPI_6_0_MPST_MEMORY_POWER_NODE_TABLE;
920
930
921
///
931
///
922
/// MPST Memory Power State Characteristics Table
932
/// MPST Memory Power State Characteristics Table
923
///
933
///
924
typedef struct {
934
typedef struct {
925
  UINT8                                             PowerStateStructureID;
935
  UINT8     PowerStateStructureID;
926
  UINT8                                             Flag;
936
  UINT8     Flag;
927
  UINT16                                            Reserved;
937
  UINT16    Reserved;
928
  UINT32                                            AveragePowerConsumedInMPS0;
938
  UINT32    AveragePowerConsumedInMPS0;
929
  UINT32                                            RelativePowerSavingToMPS0;
939
  UINT32    RelativePowerSavingToMPS0;
930
  UINT64                                            ExitLatencyToMPS0;
940
  UINT64    ExitLatencyToMPS0;
931
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
941
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE;
932
942
933
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED              0x01
943
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_MEMORY_CONTENT_PRESERVED             0x01
934
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY   0x02
944
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_ENTRY  0x02
935
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT    0x04
945
#define EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_FLAG_AUTONOMOUS_MEMORY_POWER_STATE_EXIT   0x04
936
946
937
typedef struct {
947
typedef struct {
938
  UINT16                      MemoryPowerStateCharacteristicsCount;
948
  UINT16    MemoryPowerStateCharacteristicsCount;
939
  UINT8                       Reserved[2];
949
  UINT8     Reserved[2];
940
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
950
} EFI_ACPI_6_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE;
941
951
942
///
952
///
943
/// Memory Topology Table definition.
953
/// Memory Topology Table definition.
944
///
954
///
945
typedef struct {
955
typedef struct {
946
  EFI_ACPI_DESCRIPTION_HEADER Header;
956
  EFI_ACPI_DESCRIPTION_HEADER    Header;
947
  UINT32                      Reserved;
957
  UINT32                         Reserved;
948
} EFI_ACPI_6_0_MEMORY_TOPOLOGY_TABLE;
958
} EFI_ACPI_6_0_MEMORY_TOPOLOGY_TABLE;
949
959
950
///
960
///
951
/// PMTT Version (as defined in ACPI 6.0 spec.)
961
/// PMTT Version (as defined in ACPI 6.0 spec.)
952
///
962
///
953
#define EFI_ACPI_6_0_MEMORY_TOPOLOGY_TABLE_REVISION 0x01
963
#define EFI_ACPI_6_0_MEMORY_TOPOLOGY_TABLE_REVISION  0x01
954
964
955
///
965
///
956
/// Common Memory Aggregator Device Structure.
966
/// Common Memory Aggregator Device Structure.
957
///
967
///
958
typedef struct {
968
typedef struct {
959
  UINT8                       Type;
969
  UINT8     Type;
960
  UINT8                       Reserved;
970
  UINT8     Reserved;
961
  UINT16                      Length;
971
  UINT16    Length;
962
  UINT16                      Flags;
972
  UINT16    Flags;
963
  UINT16                      Reserved1;
973
  UINT16    Reserved1;
964
} EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
974
} EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
965
975
966
///
976
///
967
/// Memory Aggregator Device Type
977
/// Memory Aggregator Device Type
968
///
978
///
969
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET            0x1
979
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_SOCKET             0x0
970
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER 0x2
980
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_MEMORY_CONTROLLER  0x1
971
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM              0x3
981
#define EFI_ACPI_6_0_PMMT_MEMORY_AGGREGATOR_DEVICE_TYPE_DIMM               0x2
972
982
973
///
983
///
974
/// Socket Memory Aggregator Device Structure.
984
/// Socket Memory Aggregator Device Structure.
975
///
985
///
976
typedef struct {
986
typedef struct {
977
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
987
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
978
  UINT16                                                       SocketIdentifier;
988
  UINT16                                                         SocketIdentifier;
979
  UINT16                                                       Reserved;
989
  UINT16                                                         Reserved;
980
//EFI_ACPI_6_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
990
  // EFI_ACPI_6_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  MemoryController[];
981
} EFI_ACPI_6_0_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
991
} EFI_ACPI_6_0_PMMT_SOCKET_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
982
992
983
///
993
///
984
/// MemoryController Memory Aggregator Device Structure.
994
/// MemoryController Memory Aggregator Device Structure.
985
///
995
///
986
typedef struct {
996
typedef struct {
987
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
997
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
988
  UINT32                                                       ReadLatency;
998
  UINT32                                                         ReadLatency;
989
  UINT32                                                       WriteLatency;
999
  UINT32                                                         WriteLatency;
990
  UINT32                                                       ReadBandwidth;
1000
  UINT32                                                         ReadBandwidth;
991
  UINT32                                                       WriteBandwidth;
1001
  UINT32                                                         WriteBandwidth;
992
  UINT16                                                       OptimalAccessUnit;
1002
  UINT16                                                         OptimalAccessUnit;
993
  UINT16                                                       OptimalAccessAlignment;
1003
  UINT16                                                         OptimalAccessAlignment;
994
  UINT16                                                       Reserved;
1004
  UINT16                                                         Reserved;
995
  UINT16                                                       NumberOfProximityDomains;
1005
  UINT16                                                         NumberOfProximityDomains;
996
//UINT32                                                       ProximityDomain[NumberOfProximityDomains];
1006
  // UINT32                                                       ProximityDomain[NumberOfProximityDomains];
997
//EFI_ACPI_6_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
1007
  // EFI_ACPI_6_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    PhysicalComponent[];
998
} EFI_ACPI_6_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1008
} EFI_ACPI_6_0_PMMT_MEMORY_CONTROLLER_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
999
1009
1000
///
1010
///
1001
/// DIMM Memory Aggregator Device Structure.
1011
/// DIMM Memory Aggregator Device Structure.
1002
///
1012
///
1003
typedef struct {
1013
typedef struct {
1004
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE  Header;
1014
  EFI_ACPI_6_0_PMMT_COMMON_MEMORY_AGGREGATOR_DEVICE_STRUCTURE    Header;
1005
  UINT16                                                       PhysicalComponentIdentifier;
1015
  UINT16                                                         PhysicalComponentIdentifier;
1006
  UINT16                                                       Reserved;
1016
  UINT16                                                         Reserved;
1007
  UINT32                                                       SizeOfDimm;
1017
  UINT32                                                         SizeOfDimm;
1008
  UINT32                                                       SmbiosHandle;
1018
  UINT32                                                         SmbiosHandle;
1009
} EFI_ACPI_6_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1019
} EFI_ACPI_6_0_PMMT_DIMM_MEMORY_AGGREGATOR_DEVICE_STRUCTURE;
1010
1020
1011
///
1021
///
1012
/// Boot Graphics Resource Table definition.
1022
/// Boot Graphics Resource Table definition.
1013
///
1023
///
1014
typedef struct {
1024
typedef struct {
1015
  EFI_ACPI_DESCRIPTION_HEADER Header;
1025
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1016
  ///
1026
  ///
1017
  /// 2-bytes (16 bit) version ID. This value must be 1.
1027
  /// 2-bytes (16 bit) version ID. This value must be 1.
1018
  ///
1028
  ///
1019
  UINT16                      Version;
1029
  UINT16                         Version;
1020
  ///
1030
  ///
1021
  /// 1-byte status field indicating current status about the table.
1031
  /// 1-byte status field indicating current status about the table.
1022
  ///     Bits[7:1] = Reserved (must be zero)
1032
  ///     Bits[7:1] = Reserved (must be zero)
1023
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1033
  ///     Bit [0] = Valid. A one indicates the boot image graphic is valid.
1024
  ///
1034
  ///
1025
  UINT8                       Status;
1035
  UINT8                          Status;
1026
  ///
1036
  ///
1027
  /// 1-byte enumerated type field indicating format of the image.
1037
  /// 1-byte enumerated type field indicating format of the image.
1028
  ///     0 = Bitmap
1038
  ///     0 = Bitmap
1029
  ///     1 - 255  Reserved (for future use)
1039
  ///     1 - 255  Reserved (for future use)
1030
  ///
1040
  ///
1031
  UINT8                       ImageType;
1041
  UINT8                          ImageType;
1032
  ///
1042
  ///
1033
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1043
  /// 8-byte (64 bit) physical address pointing to the firmware's in-memory copy
1034
  /// of the image bitmap.
1044
  /// of the image bitmap.
1035
  ///
1045
  ///
1036
  UINT64                      ImageAddress;
1046
  UINT64                         ImageAddress;
1037
  ///
1047
  ///
1038
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1048
  /// A 4-byte (32-bit) unsigned long describing the display X-offset of the boot image.
1039
  /// (X, Y) display offset of the top left corner of the boot image.
1049
  /// (X, Y) display offset of the top left corner of the boot image.
1040
  /// The top left corner of the display is at offset (0, 0).
1050
  /// The top left corner of the display is at offset (0, 0).
1041
  ///
1051
  ///
1042
  UINT32                      ImageOffsetX;
1052
  UINT32                         ImageOffsetX;
1043
  ///
1053
  ///
1044
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1054
  /// A 4-byte (32-bit) unsigned long describing the display Y-offset of the boot image.
1045
  /// (X, Y) display offset of the top left corner of the boot image.
1055
  /// (X, Y) display offset of the top left corner of the boot image.
1046
  /// The top left corner of the display is at offset (0, 0).
1056
  /// The top left corner of the display is at offset (0, 0).
1047
  ///
1057
  ///
1048
  UINT32                      ImageOffsetY;
1058
  UINT32                         ImageOffsetY;
1049
} EFI_ACPI_6_0_BOOT_GRAPHICS_RESOURCE_TABLE;
1059
} EFI_ACPI_6_0_BOOT_GRAPHICS_RESOURCE_TABLE;
1050
1060
1051
///
1061
///
1052
/// BGRT Revision
1062
/// BGRT Revision
1053
///
1063
///
1054
#define EFI_ACPI_6_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION 1
1064
#define EFI_ACPI_6_0_BOOT_GRAPHICS_RESOURCE_TABLE_REVISION  1
1055
1065
1056
///
1066
///
1057
/// BGRT Version
1067
/// BGRT Version
1058
///
1068
///
1059
#define EFI_ACPI_6_0_BGRT_VERSION         0x01
1069
#define EFI_ACPI_6_0_BGRT_VERSION  0x01
1060
1070
1061
///
1071
///
1062
/// BGRT Status
1072
/// BGRT Status
1063
///
1073
///
1064
#define EFI_ACPI_6_0_BGRT_STATUS_NOT_DISPLAYED 0x00
1074
#define EFI_ACPI_6_0_BGRT_STATUS_NOT_DISPLAYED  0x00
1065
#define EFI_ACPI_6_0_BGRT_STATUS_DISPLAYED     0x01
1075
#define EFI_ACPI_6_0_BGRT_STATUS_DISPLAYED      0x01
1066
1076
1067
///
1077
///
1068
/// BGRT Image Type
1078
/// BGRT Image Type
Lines 1072-1097 typedef struct { Link Here
1072
///
1082
///
1073
/// FPDT Version (as defined in ACPI 6.0 spec.)
1083
/// FPDT Version (as defined in ACPI 6.0 spec.)
1074
///
1084
///
1075
#define EFI_ACPI_6_0_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION 0x01
1085
#define EFI_ACPI_6_0_FIRMWARE_PERFORMANCE_DATA_TABLE_REVISION  0x01
1076
1086
1077
///
1087
///
1078
/// FPDT Performance Record Types
1088
/// FPDT Performance Record Types
1079
///
1089
///
1080
#define EFI_ACPI_6_0_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER      0x0000
1090
#define EFI_ACPI_6_0_FPDT_RECORD_TYPE_FIRMWARE_BASIC_BOOT_POINTER   0x0000
1081
#define EFI_ACPI_6_0_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER     0x0001
1091
#define EFI_ACPI_6_0_FPDT_RECORD_TYPE_S3_PERFORMANCE_TABLE_POINTER  0x0001
1082
1092
1083
///
1093
///
1084
/// FPDT Performance Record Revision
1094
/// FPDT Performance Record Revision
1085
///
1095
///
1086
#define EFI_ACPI_6_0_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER  0x01
1096
#define EFI_ACPI_6_0_FPDT_RECORD_REVISION_FIRMWARE_BASIC_BOOT_POINTER   0x01
1087
#define EFI_ACPI_6_0_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER 0x01
1097
#define EFI_ACPI_6_0_FPDT_RECORD_REVISION_S3_PERFORMANCE_TABLE_POINTER  0x01
1088
1098
1089
///
1099
///
1090
/// FPDT Runtime Performance Record Types
1100
/// FPDT Runtime Performance Record Types
1091
///
1101
///
1092
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME                0x0000
1102
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_S3_RESUME            0x0000
1093
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND               0x0001
1103
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_S3_SUSPEND           0x0001
1094
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT      0x0002
1104
#define EFI_ACPI_6_0_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT  0x0002
1095
1105
1096
///
1106
///
1097
/// FPDT Runtime Performance Record Revision
1107
/// FPDT Runtime Performance Record Revision
Lines 1104-1180 typedef struct { Link Here
1104
/// FPDT Performance Record header
1114
/// FPDT Performance Record header
1105
///
1115
///
1106
typedef struct {
1116
typedef struct {
1107
  UINT16           Type;
1117
  UINT16    Type;
1108
  UINT8            Length;
1118
  UINT8     Length;
1109
  UINT8            Revision;
1119
  UINT8     Revision;
1110
} EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER;
1120
} EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER;
1111
1121
1112
///
1122
///
1113
/// FPDT Performance Table header
1123
/// FPDT Performance Table header
1114
///
1124
///
1115
typedef struct {
1125
typedef struct {
1116
  UINT32  Signature;
1126
  UINT32    Signature;
1117
  UINT32  Length;
1127
  UINT32    Length;
1118
} EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER;
1128
} EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER;
1119
1129
1120
///
1130
///
1121
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1131
/// FPDT Firmware Basic Boot Performance Pointer Record Structure
1122
///
1132
///
1123
typedef struct {
1133
typedef struct {
1124
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1134
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1125
  UINT32                                          Reserved;
1135
  UINT32                                         Reserved;
1126
  ///
1136
  ///
1127
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1137
  /// 64-bit processor-relative physical address of the Basic Boot Performance Table.
1128
  ///
1138
  ///
1129
  UINT64                                          BootPerformanceTablePointer;
1139
  UINT64                                         BootPerformanceTablePointer;
1130
} EFI_ACPI_6_0_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1140
} EFI_ACPI_6_0_FPDT_BOOT_PERFORMANCE_TABLE_POINTER_RECORD;
1131
1141
1132
///
1142
///
1133
/// FPDT S3 Performance Table Pointer Record Structure
1143
/// FPDT S3 Performance Table Pointer Record Structure
1134
///
1144
///
1135
typedef struct {
1145
typedef struct {
1136
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1146
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1137
  UINT32                                          Reserved;
1147
  UINT32                                         Reserved;
1138
  ///
1148
  ///
1139
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1149
  /// 64-bit processor-relative physical address of the S3 Performance Table.
1140
  ///
1150
  ///
1141
  UINT64                                          S3PerformanceTablePointer;
1151
  UINT64                                         S3PerformanceTablePointer;
1142
} EFI_ACPI_6_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1152
} EFI_ACPI_6_0_FPDT_S3_PERFORMANCE_TABLE_POINTER_RECORD;
1143
1153
1144
///
1154
///
1145
/// FPDT Firmware Basic Boot Performance Record Structure
1155
/// FPDT Firmware Basic Boot Performance Record Structure
1146
///
1156
///
1147
typedef struct {
1157
typedef struct {
1148
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1158
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1149
  UINT32                                          Reserved;
1159
  UINT32                                         Reserved;
1150
  ///
1160
  ///
1151
  /// Timer value logged at the beginning of firmware image execution.
1161
  /// Timer value logged at the beginning of firmware image execution.
1152
  /// This may not always be zero or near zero.
1162
  /// This may not always be zero or near zero.
1153
  ///
1163
  ///
1154
  UINT64                                          ResetEnd;
1164
  UINT64                                         ResetEnd;
1155
  ///
1165
  ///
1156
  /// Timer value logged just prior to loading the OS boot loader into memory.
1166
  /// Timer value logged just prior to loading the OS boot loader into memory.
1157
  /// For non-UEFI compatible boots, this field must be zero.
1167
  /// For non-UEFI compatible boots, this field must be zero.
1158
  ///
1168
  ///
1159
  UINT64                                          OsLoaderLoadImageStart;
1169
  UINT64                                         OsLoaderLoadImageStart;
1160
  ///
1170
  ///
1161
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1171
  /// Timer value logged just prior to launching the previously loaded OS boot loader image.
1162
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1172
  /// For non-UEFI compatible boots, the timer value logged will be just prior
1163
  /// to the INT 19h handler invocation.
1173
  /// to the INT 19h handler invocation.
1164
  ///
1174
  ///
1165
  UINT64                                          OsLoaderStartImageStart;
1175
  UINT64                                         OsLoaderStartImageStart;
1166
  ///
1176
  ///
1167
  /// Timer value logged at the point when the OS loader calls the
1177
  /// Timer value logged at the point when the OS loader calls the
1168
  /// ExitBootServices function for UEFI compatible firmware.
1178
  /// ExitBootServices function for UEFI compatible firmware.
1169
  /// For non-UEFI compatible boots, this field must be zero.
1179
  /// For non-UEFI compatible boots, this field must be zero.
1170
  ///
1180
  ///
1171
  UINT64                                          ExitBootServicesEntry;
1181
  UINT64                                         ExitBootServicesEntry;
1172
  ///
1182
  ///
1173
  /// Timer value logged at the point just prior to when the OS loader gaining
1183
  /// Timer value logged at the point just prior to when the OS loader gaining
1174
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1184
  /// control back from calls the ExitBootServices function for UEFI compatible firmware.
1175
  /// For non-UEFI compatible boots, this field must be zero.
1185
  /// For non-UEFI compatible boots, this field must be zero.
1176
  ///
1186
  ///
1177
  UINT64                                          ExitBootServicesExit;
1187
  UINT64                                         ExitBootServicesExit;
1178
} EFI_ACPI_6_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1188
} EFI_ACPI_6_0_FPDT_FIRMWARE_BASIC_BOOT_RECORD;
1179
1189
1180
///
1190
///
Lines 1186-1192 typedef struct { Link Here
1186
// FPDT Firmware Basic Boot Performance Table
1196
// FPDT Firmware Basic Boot Performance Table
1187
//
1197
//
1188
typedef struct {
1198
typedef struct {
1189
  EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1199
  EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1190
  //
1200
  //
1191
  // one or more Performance Records.
1201
  // one or more Performance Records.
1192
  //
1202
  //
Lines 1201-1207 typedef struct { Link Here
1201
// FPDT Firmware S3 Boot Performance Table
1211
// FPDT Firmware S3 Boot Performance Table
1202
//
1212
//
1203
typedef struct {
1213
typedef struct {
1204
  EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER      Header;
1214
  EFI_ACPI_6_0_FPDT_PERFORMANCE_TABLE_HEADER    Header;
1205
  //
1215
  //
1206
  // one or more Performance Records.
1216
  // one or more Performance Records.
1207
  //
1217
  //
Lines 1211-1355 typedef struct { Link Here
1211
/// FPDT Basic S3 Resume Performance Record
1221
/// FPDT Basic S3 Resume Performance Record
1212
///
1222
///
1213
typedef struct {
1223
typedef struct {
1214
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1224
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1215
  ///
1225
  ///
1216
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1226
  /// A count of the number of S3 resume cycles since the last full boot sequence.
1217
  ///
1227
  ///
1218
  UINT32                                          ResumeCount;
1228
  UINT32                                         ResumeCount;
1219
  ///
1229
  ///
1220
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1230
  /// Timer recorded at the end of BIOS S3 resume, just prior to handoff to the
1221
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1231
  /// OS waking vector. Only the most recent resume cycle's time is retained.
1222
  ///
1232
  ///
1223
  UINT64                                          FullResume;
1233
  UINT64                                         FullResume;
1224
  ///
1234
  ///
1225
  /// Average timer value of all resume cycles logged since the last full boot
1235
  /// Average timer value of all resume cycles logged since the last full boot
1226
  /// sequence, including the most recent resume.  Note that the entire log of
1236
  /// sequence, including the most recent resume.  Note that the entire log of
1227
  /// timer values does not need to be retained in order to calculate this average.
1237
  /// timer values does not need to be retained in order to calculate this average.
1228
  ///
1238
  ///
1229
  UINT64                                          AverageResume;
1239
  UINT64                                         AverageResume;
1230
} EFI_ACPI_6_0_FPDT_S3_RESUME_RECORD;
1240
} EFI_ACPI_6_0_FPDT_S3_RESUME_RECORD;
1231
1241
1232
///
1242
///
1233
/// FPDT Basic S3 Suspend Performance Record
1243
/// FPDT Basic S3 Suspend Performance Record
1234
///
1244
///
1235
typedef struct {
1245
typedef struct {
1236
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER     Header;
1246
  EFI_ACPI_6_0_FPDT_PERFORMANCE_RECORD_HEADER    Header;
1237
  ///
1247
  ///
1238
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1248
  /// Timer value recorded at the OS write to SLP_TYP upon entry to S3.
1239
  /// Only the most recent suspend cycle's timer value is retained.
1249
  /// Only the most recent suspend cycle's timer value is retained.
1240
  ///
1250
  ///
1241
  UINT64                                          SuspendStart;
1251
  UINT64                                         SuspendStart;
1242
  ///
1252
  ///
1243
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1253
  /// Timer value recorded at the final firmware write to SLP_TYP (or other
1244
  /// mechanism) used to trigger hardware entry to S3.
1254
  /// mechanism) used to trigger hardware entry to S3.
1245
  /// Only the most recent suspend cycle's timer value is retained.
1255
  /// Only the most recent suspend cycle's timer value is retained.
1246
  ///
1256
  ///
1247
  UINT64                                          SuspendEnd;
1257
  UINT64                                         SuspendEnd;
1248
} EFI_ACPI_6_0_FPDT_S3_SUSPEND_RECORD;
1258
} EFI_ACPI_6_0_FPDT_S3_SUSPEND_RECORD;
1249
1259
1250
///
1260
///
1251
/// Firmware Performance Record Table definition.
1261
/// Firmware Performance Record Table definition.
1252
///
1262
///
1253
typedef struct {
1263
typedef struct {
1254
  EFI_ACPI_DESCRIPTION_HEADER Header;
1264
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1255
} EFI_ACPI_6_0_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1265
} EFI_ACPI_6_0_FIRMWARE_PERFORMANCE_RECORD_TABLE;
1256
1266
1257
///
1267
///
1258
/// Generic Timer Description Table definition.
1268
/// Generic Timer Description Table definition.
1259
///
1269
///
1260
typedef struct {
1270
typedef struct {
1261
  EFI_ACPI_DESCRIPTION_HEADER Header;
1271
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1262
  UINT64                      CntControlBasePhysicalAddress;
1272
  UINT64                         CntControlBasePhysicalAddress;
1263
  UINT32                      Reserved;
1273
  UINT32                         Reserved;
1264
  UINT32                      SecurePL1TimerGSIV;
1274
  UINT32                         SecurePL1TimerGSIV;
1265
  UINT32                      SecurePL1TimerFlags;
1275
  UINT32                         SecurePL1TimerFlags;
1266
  UINT32                      NonSecurePL1TimerGSIV;
1276
  UINT32                         NonSecurePL1TimerGSIV;
1267
  UINT32                      NonSecurePL1TimerFlags;
1277
  UINT32                         NonSecurePL1TimerFlags;
1268
  UINT32                      VirtualTimerGSIV;
1278
  UINT32                         VirtualTimerGSIV;
1269
  UINT32                      VirtualTimerFlags;
1279
  UINT32                         VirtualTimerFlags;
1270
  UINT32                      NonSecurePL2TimerGSIV;
1280
  UINT32                         NonSecurePL2TimerGSIV;
1271
  UINT32                      NonSecurePL2TimerFlags;
1281
  UINT32                         NonSecurePL2TimerFlags;
1272
  UINT64                      CntReadBasePhysicalAddress;
1282
  UINT64                         CntReadBasePhysicalAddress;
1273
  UINT32                      PlatformTimerCount;
1283
  UINT32                         PlatformTimerCount;
1274
  UINT32                      PlatformTimerOffset;
1284
  UINT32                         PlatformTimerOffset;
1275
} EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE;
1285
} EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE;
1276
1286
1277
///
1287
///
1278
/// GTDT Version (as defined in ACPI 6.0 spec.)
1288
/// GTDT Version (as defined in ACPI 6.0 spec.)
1279
///
1289
///
1280
#define EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION 0x02
1290
#define EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION  0x02
1281
1291
1282
///
1292
///
1283
/// Timer Flags.  All other bits are reserved and must be 0.
1293
/// Timer Flags.  All other bits are reserved and must be 0.
1284
///
1294
///
1285
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE          BIT0
1295
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_MODE      BIT0
1286
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1296
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1287
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY          BIT2
1297
#define EFI_ACPI_6_0_GTDT_TIMER_FLAG_ALWAYS_ON_CAPABILITY      BIT2
1288
1298
1289
///
1299
///
1290
/// Platform Timer Type
1300
/// Platform Timer Type
1291
///
1301
///
1292
#define EFI_ACPI_6_0_GTDT_GT_BLOCK                       0
1302
#define EFI_ACPI_6_0_GTDT_GT_BLOCK               0
1293
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG          1
1303
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG  1
1294
1304
1295
///
1305
///
1296
/// GT Block Structure
1306
/// GT Block Structure
1297
///
1307
///
1298
typedef struct {
1308
typedef struct {
1299
  UINT8   Type;
1309
  UINT8     Type;
1300
  UINT16  Length;
1310
  UINT16    Length;
1301
  UINT8   Reserved;
1311
  UINT8     Reserved;
1302
  UINT64  CntCtlBase;
1312
  UINT64    CntCtlBase;
1303
  UINT32  GTBlockTimerCount;
1313
  UINT32    GTBlockTimerCount;
1304
  UINT32  GTBlockTimerOffset;
1314
  UINT32    GTBlockTimerOffset;
1305
} EFI_ACPI_6_0_GTDT_GT_BLOCK_STRUCTURE;
1315
} EFI_ACPI_6_0_GTDT_GT_BLOCK_STRUCTURE;
1306
1316
1307
///
1317
///
1308
/// GT Block Timer Structure
1318
/// GT Block Timer Structure
1309
///
1319
///
1310
typedef struct {
1320
typedef struct {
1311
  UINT8   GTFrameNumber;
1321
  UINT8     GTFrameNumber;
1312
  UINT8   Reserved[3];
1322
  UINT8     Reserved[3];
1313
  UINT64  CntBaseX;
1323
  UINT64    CntBaseX;
1314
  UINT64  CntEL0BaseX;
1324
  UINT64    CntEL0BaseX;
1315
  UINT32  GTxPhysicalTimerGSIV;
1325
  UINT32    GTxPhysicalTimerGSIV;
1316
  UINT32  GTxPhysicalTimerFlags;
1326
  UINT32    GTxPhysicalTimerFlags;
1317
  UINT32  GTxVirtualTimerGSIV;
1327
  UINT32    GTxVirtualTimerGSIV;
1318
  UINT32  GTxVirtualTimerFlags;
1328
  UINT32    GTxVirtualTimerFlags;
1319
  UINT32  GTxCommonFlags;
1329
  UINT32    GTxCommonFlags;
1320
} EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_STRUCTURE;
1330
} EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_STRUCTURE;
1321
1331
1322
///
1332
///
1323
/// GT Block Physical Timers and Virtual Timers Flags.  All other bits are reserved and must be 0.
1333
/// GT Block Physical Timers and Virtual Timers Flags.  All other bits are reserved and must be 0.
1324
///
1334
///
1325
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MODE          BIT0
1335
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_MODE      BIT0
1326
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1336
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_TIMER_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1327
1337
1328
///
1338
///
1329
/// Common Flags Flags.  All other bits are reserved and must be 0.
1339
/// Common Flags Flags.  All other bits are reserved and must be 0.
1330
///
1340
///
1331
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER              BIT0
1341
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER          BIT0
1332
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY      BIT1
1342
#define EFI_ACPI_6_0_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY  BIT1
1333
1343
1334
///
1344
///
1335
/// SBSA Generic Watchdog Structure
1345
/// SBSA Generic Watchdog Structure
1336
///
1346
///
1337
typedef struct {
1347
typedef struct {
1338
  UINT8   Type;
1348
  UINT8     Type;
1339
  UINT16  Length;
1349
  UINT16    Length;
1340
  UINT8   Reserved;
1350
  UINT8     Reserved;
1341
  UINT64  RefreshFramePhysicalAddress;
1351
  UINT64    RefreshFramePhysicalAddress;
1342
  UINT64  WatchdogControlFramePhysicalAddress;
1352
  UINT64    WatchdogControlFramePhysicalAddress;
1343
  UINT32  WatchdogTimerGSIV;
1353
  UINT32    WatchdogTimerGSIV;
1344
  UINT32  WatchdogTimerFlags;
1354
  UINT32    WatchdogTimerFlags;
1345
} EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE;
1355
} EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE;
1346
1356
1347
///
1357
///
1348
/// SBSA Generic Watchdog Timer Flags.  All other bits are reserved and must be 0.
1358
/// SBSA Generic Watchdog Timer Flags.  All other bits are reserved and must be 0.
1349
///
1359
///
1350
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE          BIT0
1360
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_MODE      BIT0
1351
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY      BIT1
1361
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_TIMER_INTERRUPT_POLARITY  BIT1
1352
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER                  BIT2
1362
#define EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER              BIT2
1353
1363
1354
//
1364
//
1355
// NVDIMM Firmware Interface Table definition.
1365
// NVDIMM Firmware Interface Table definition.
Lines 1362-1368 typedef struct { Link Here
1362
//
1372
//
1363
// NFIT Version (as defined in ACPI 6.0 spec.)
1373
// NFIT Version (as defined in ACPI 6.0 spec.)
1364
//
1374
//
1365
#define EFI_ACPI_6_0_NVDIMM_FIRMWARE_INTERFACE_TABLE_REVISION 0x1
1375
#define EFI_ACPI_6_0_NVDIMM_FIRMWARE_INTERFACE_TABLE_REVISION  0x1
1366
1376
1367
//
1377
//
1368
// Definition for NFIT Table Structure Types
1378
// Definition for NFIT Table Structure Types
Lines 1379-1424 typedef struct { Link Here
1379
// Definition for NFIT Structure Header
1389
// Definition for NFIT Structure Header
1380
//
1390
//
1381
typedef struct {
1391
typedef struct {
1382
  UINT16                                      Type;
1392
  UINT16    Type;
1383
  UINT16                                      Length;
1393
  UINT16    Length;
1384
} EFI_ACPI_6_0_NFIT_STRUCTURE_HEADER;
1394
} EFI_ACPI_6_0_NFIT_STRUCTURE_HEADER;
1385
1395
1386
//
1396
//
1387
// Definition for System Physical Address Range Structure
1397
// Definition for System Physical Address Range Structure
1388
//
1398
//
1389
#define EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_FLAGS_CONTROL_REGION_FOR_MANAGEMENT      BIT0
1399
#define EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_FLAGS_CONTROL_REGION_FOR_MANAGEMENT  BIT0
1390
#define EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_FLAGS_PROXIMITY_DOMAIN_VALID             BIT1
1400
#define EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_FLAGS_PROXIMITY_DOMAIN_VALID         BIT1
1391
#define EFI_ACPI_6_0_NFIT_GUID_VOLATILE_MEMORY_REGION                             { 0x7305944F, 0xFDDA, 0x44E3, { 0xB1, 0x6C, 0x3F, 0x22, 0xD2, 0x52, 0xE5, 0xD0 }}
1401
#define EFI_ACPI_6_0_NFIT_GUID_VOLATILE_MEMORY_REGION                                        { 0x7305944F, 0xFDDA, 0x44E3, { 0xB1, 0x6C, 0x3F, 0x22, 0xD2, 0x52, 0xE5, 0xD0 }}
1392
#define EFI_ACPI_6_0_NFIT_GUID_BYTE_ADDRESSABLE_PERSISTENT_MEMORY_REGION          { 0x66F0D379, 0xB4F3, 0x4074, { 0xAC, 0x43, 0x0D, 0x33, 0x18, 0xB7, 0x8C, 0xDB }}
1402
#define EFI_ACPI_6_0_NFIT_GUID_BYTE_ADDRESSABLE_PERSISTENT_MEMORY_REGION                     { 0x66F0D379, 0xB4F3, 0x4074, { 0xAC, 0x43, 0x0D, 0x33, 0x18, 0xB7, 0x8C, 0xDB }}
1393
#define EFI_ACPI_6_0_NFIT_GUID_NVDIMM_CONTROL_REGION                              { 0x92F701F6, 0x13B4, 0x405D, { 0x91, 0x0B, 0x29, 0x93, 0x67, 0xE8, 0x23, 0x4C }}
1403
#define EFI_ACPI_6_0_NFIT_GUID_NVDIMM_CONTROL_REGION                                         { 0x92F701F6, 0x13B4, 0x405D, { 0x91, 0x0B, 0x29, 0x93, 0x67, 0xE8, 0x23, 0x4C }}
1394
#define EFI_ACPI_6_0_NFIT_GUID_NVDIMM_BLOCK_DATA_WINDOW_REGION                    { 0x91AF0530, 0x5D86, 0x470E, { 0xA6, 0xB0, 0x0A, 0x2D, 0xB9, 0x40, 0x82, 0x49 }}
1404
#define EFI_ACPI_6_0_NFIT_GUID_NVDIMM_BLOCK_DATA_WINDOW_REGION                               { 0x91AF0530, 0x5D86, 0x470E, { 0xA6, 0xB0, 0x0A, 0x2D, 0xB9, 0x40, 0x82, 0x49 }}
1395
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE   { 0x77AB535A, 0x45FC, 0x624B, { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}
1405
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE              { 0x77AB535A, 0x45FC, 0x624B, { 0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E }}
1396
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE     { 0x3D5ABD30, 0x4175, 0x87CE, { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}
1406
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE                { 0x3D5ABD30, 0x4175, 0x87CE, { 0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB }}
1397
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT { 0x5CEA02C9, 0x4D07, 0x69D3, { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}
1407
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT            { 0x5CEA02C9, 0x4D07, 0x69D3, { 0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 }}
1398
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT   { 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}
1408
#define EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT              { 0x08018188, 0x42CD, 0xBB48, { 0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D }}
1399
typedef struct {
1409
typedef struct {
1400
  UINT16                                      Type;
1410
  UINT16    Type;
1401
  UINT16                                      Length;
1411
  UINT16    Length;
1402
  UINT16                                      SPARangeStructureIndex;
1412
  UINT16    SPARangeStructureIndex;
1403
  UINT16                                      Flags;
1413
  UINT16    Flags;
1404
  UINT32                                      Reserved_8;
1414
  UINT32    Reserved_8;
1405
  UINT32                                      ProximityDomain;
1415
  UINT32    ProximityDomain;
1406
  GUID                                        AddressRangeTypeGUID;
1416
  GUID      AddressRangeTypeGUID;
1407
  UINT64                                      SystemPhysicalAddressRangeBase;
1417
  UINT64    SystemPhysicalAddressRangeBase;
1408
  UINT64                                      SystemPhysicalAddressRangeLength;
1418
  UINT64    SystemPhysicalAddressRangeLength;
1409
  UINT64                                      AddressRangeMemoryMappingAttribute;
1419
  UINT64    AddressRangeMemoryMappingAttribute;
1410
} EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_STRUCTURE;
1420
} EFI_ACPI_6_0_NFIT_SYSTEM_PHYSICAL_ADDRESS_RANGE_STRUCTURE;
1411
1421
1412
//
1422
//
1413
// Definition for Memory Device to System Physical Address Range Mapping Structure
1423
// Definition for Memory Device to System Physical Address Range Mapping Structure
1414
//
1424
//
1415
typedef struct {
1425
typedef struct {
1416
  UINT32                                      DIMMNumber:4;
1426
  UINT32    DIMMNumber          : 4;
1417
  UINT32                                      MemoryChannelNumber:4;
1427
  UINT32    MemoryChannelNumber : 4;
1418
  UINT32                                      MemoryControllerID:4;
1428
  UINT32    MemoryControllerID  : 4;
1419
  UINT32                                      SocketID:4;
1429
  UINT32    SocketID            : 4;
1420
  UINT32                                      NodeControllerID:12;
1430
  UINT32    NodeControllerID    : 12;
1421
  UINT32                                      Reserved_28:4;
1431
  UINT32    Reserved_28         : 4;
1422
} EFI_ACPI_6_0_NFIT_DEVICE_HANDLE;
1432
} EFI_ACPI_6_0_NFIT_DEVICE_HANDLE;
1423
1433
1424
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_PREVIOUS_SAVE_FAIL                                      BIT0
1434
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_PREVIOUS_SAVE_FAIL                                      BIT0
Lines 1428-1582 typedef struct { Link Here
1428
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_SMART_HEALTH_EVENTS_PRIOR_OSPM_HAND_OFF                 BIT4
1438
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_SMART_HEALTH_EVENTS_PRIOR_OSPM_HAND_OFF                 BIT4
1429
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_FIRMWARE_ENABLED_TO_NOTIFY_OSPM_ON_SMART_HEALTH_EVENTS  BIT5
1439
#define EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_STATE_FLAGS_FIRMWARE_ENABLED_TO_NOTIFY_OSPM_ON_SMART_HEALTH_EVENTS  BIT5
1430
typedef struct {
1440
typedef struct {
1431
  UINT16                                      Type;
1441
  UINT16                             Type;
1432
  UINT16                                      Length;
1442
  UINT16                             Length;
1433
  EFI_ACPI_6_0_NFIT_DEVICE_HANDLE             NFITDeviceHandle;
1443
  EFI_ACPI_6_0_NFIT_DEVICE_HANDLE    NFITDeviceHandle;
1434
  UINT16                                      MemoryDevicePhysicalID;
1444
  UINT16                             MemoryDevicePhysicalID;
1435
  UINT16                                      MemoryDeviceRegionID;
1445
  UINT16                             MemoryDeviceRegionID;
1436
  UINT16                                      SPARangeStructureIndex ;
1446
  UINT16                             SPARangeStructureIndex;
1437
  UINT16                                      NVDIMMControlRegionStructureIndex;
1447
  UINT16                             NVDIMMControlRegionStructureIndex;
1438
  UINT64                                      MemoryDeviceRegionSize;
1448
  UINT64                             MemoryDeviceRegionSize;
1439
  UINT64                                      RegionOffset;
1449
  UINT64                             RegionOffset;
1440
  UINT64                                      MemoryDevicePhysicalAddressRegionBase;
1450
  UINT64                             MemoryDevicePhysicalAddressRegionBase;
1441
  UINT16                                      InterleaveStructureIndex;
1451
  UINT16                             InterleaveStructureIndex;
1442
  UINT16                                      InterleaveWays;
1452
  UINT16                             InterleaveWays;
1443
  UINT16                                      MemoryDeviceStateFlags;
1453
  UINT16                             MemoryDeviceStateFlags;
1444
  UINT16                                      Reserved_46;
1454
  UINT16                             Reserved_46;
1445
} EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_TO_SYSTEM_ADDRESS_RANGE_MAP_STRUCTURE;
1455
} EFI_ACPI_6_0_NFIT_MEMORY_DEVICE_TO_SYSTEM_ADDRESS_RANGE_MAP_STRUCTURE;
1446
1456
1447
//
1457
//
1448
// Definition for Interleave Structure
1458
// Definition for Interleave Structure
1449
//
1459
//
1450
typedef struct {
1460
typedef struct {
1451
  UINT16                                      Type;
1461
  UINT16    Type;
1452
  UINT16                                      Length;
1462
  UINT16    Length;
1453
  UINT16                                      InterleaveStructureIndex;
1463
  UINT16    InterleaveStructureIndex;
1454
  UINT16                                      Reserved_6;
1464
  UINT16    Reserved_6;
1455
  UINT32                                      NumberOfLines;
1465
  UINT32    NumberOfLines;
1456
  UINT32                                      LineSize;
1466
  UINT32    LineSize;
1457
//UINT32                                      LineOffset[NumberOfLines];
1467
  // UINT32                                      LineOffset[NumberOfLines];
1458
} EFI_ACPI_6_0_NFIT_INTERLEAVE_STRUCTURE;
1468
} EFI_ACPI_6_0_NFIT_INTERLEAVE_STRUCTURE;
1459
1469
1460
//
1470
//
1461
// Definition for SMBIOS Management Information Structure
1471
// Definition for SMBIOS Management Information Structure
1462
//
1472
//
1463
typedef struct {
1473
typedef struct {
1464
  UINT16                                      Type;
1474
  UINT16    Type;
1465
  UINT16                                      Length;
1475
  UINT16    Length;
1466
  UINT32                                      Reserved_4;
1476
  UINT32    Reserved_4;
1467
//UINT8                                       Data[];
1477
  // UINT8                                       Data[];
1468
} EFI_ACPI_6_0_NFIT_SMBIOS_MANAGEMENT_INFORMATION_STRUCTURE;
1478
} EFI_ACPI_6_0_NFIT_SMBIOS_MANAGEMENT_INFORMATION_STRUCTURE;
1469
1479
1470
//
1480
//
1471
// Definition for NVDIMM Control Region Structure
1481
// Definition for NVDIMM Control Region Structure
1472
//
1482
//
1473
#define EFI_ACPI_6_0_NFIT_NVDIMM_CONTROL_REGION_FLAGS_BLOCK_DATA_WINDOWS_BUFFERED    BIT0
1483
#define EFI_ACPI_6_0_NFIT_NVDIMM_CONTROL_REGION_FLAGS_BLOCK_DATA_WINDOWS_BUFFERED  BIT0
1474
typedef struct {
1484
typedef struct {
1475
  UINT16                                      Type;
1485
  UINT16    Type;
1476
  UINT16                                      Length;
1486
  UINT16    Length;
1477
  UINT16                                      NVDIMMControlRegionStructureIndex;
1487
  UINT16    NVDIMMControlRegionStructureIndex;
1478
  UINT16                                      VendorID;
1488
  UINT16    VendorID;
1479
  UINT16                                      DeviceID;
1489
  UINT16    DeviceID;
1480
  UINT16                                      RevisionID;
1490
  UINT16    RevisionID;
1481
  UINT16                                      SubsystemVendorID;
1491
  UINT16    SubsystemVendorID;
1482
  UINT16                                      SubsystemDeviceID;
1492
  UINT16    SubsystemDeviceID;
1483
  UINT16                                      SubsystemRevisionID;
1493
  UINT16    SubsystemRevisionID;
1484
  UINT8                                       Reserved_18[6];
1494
  UINT8     Reserved_18[6];
1485
  UINT32                                      SerialNumber;
1495
  UINT32    SerialNumber;
1486
  UINT16                                      RegionFormatInterfaceCode;
1496
  UINT16    RegionFormatInterfaceCode;
1487
  UINT16                                      NumberOfBlockControlWindows;
1497
  UINT16    NumberOfBlockControlWindows;
1488
  UINT64                                      SizeOfBlockControlWindow;
1498
  UINT64    SizeOfBlockControlWindow;
1489
  UINT64                                      CommandRegisterOffsetInBlockControlWindow;
1499
  UINT64    CommandRegisterOffsetInBlockControlWindow;
1490
  UINT64                                      SizeOfCommandRegisterInBlockControlWindows;
1500
  UINT64    SizeOfCommandRegisterInBlockControlWindows;
1491
  UINT64                                      StatusRegisterOffsetInBlockControlWindow;
1501
  UINT64    StatusRegisterOffsetInBlockControlWindow;
1492
  UINT64                                      SizeOfStatusRegisterInBlockControlWindows;
1502
  UINT64    SizeOfStatusRegisterInBlockControlWindows;
1493
  UINT16                                      NVDIMMControlRegionFlag;
1503
  UINT16    NVDIMMControlRegionFlag;
1494
  UINT8                                       Reserved_74[6];
1504
  UINT8     Reserved_74[6];
1495
} EFI_ACPI_6_0_NFIT_NVDIMM_CONTROL_REGION_STRUCTURE;
1505
} EFI_ACPI_6_0_NFIT_NVDIMM_CONTROL_REGION_STRUCTURE;
1496
1506
1497
//
1507
//
1498
// Definition for NVDIMM Block Data Window Region Structure
1508
// Definition for NVDIMM Block Data Window Region Structure
1499
//
1509
//
1500
typedef struct {
1510
typedef struct {
1501
  UINT16                                      Type;
1511
  UINT16    Type;
1502
  UINT16                                      Length;
1512
  UINT16    Length;
1503
  UINT16                                      NVDIMMControlRegionStructureIndex;
1513
  UINT16    NVDIMMControlRegionStructureIndex;
1504
  UINT16                                      NumberOfBlockDataWindows;
1514
  UINT16    NumberOfBlockDataWindows;
1505
  UINT64                                      BlockDataWindowStartOffset;
1515
  UINT64    BlockDataWindowStartOffset;
1506
  UINT64                                      SizeOfBlockDataWindow;
1516
  UINT64    SizeOfBlockDataWindow;
1507
  UINT64                                      BlockAccessibleMemoryCapacity;
1517
  UINT64    BlockAccessibleMemoryCapacity;
1508
  UINT64                                      BeginningAddressOfFirstBlockInBlockAccessibleMemory;
1518
  UINT64    BeginningAddressOfFirstBlockInBlockAccessibleMemory;
1509
} EFI_ACPI_6_0_NFIT_NVDIMM_BLOCK_DATA_WINDOW_REGION_STRUCTURE;
1519
} EFI_ACPI_6_0_NFIT_NVDIMM_BLOCK_DATA_WINDOW_REGION_STRUCTURE;
1510
1520
1511
//
1521
//
1512
// Definition for Flush Hint Address Structure
1522
// Definition for Flush Hint Address Structure
1513
//
1523
//
1514
typedef struct {
1524
typedef struct {
1515
  UINT16                                      Type;
1525
  UINT16                             Type;
1516
  UINT16                                      Length;
1526
  UINT16                             Length;
1517
  EFI_ACPI_6_0_NFIT_DEVICE_HANDLE             NFITDeviceHandle;
1527
  EFI_ACPI_6_0_NFIT_DEVICE_HANDLE    NFITDeviceHandle;
1518
  UINT16                                      NumberOfFlushHintAddresses;
1528
  UINT16                             NumberOfFlushHintAddresses;
1519
  UINT8                                       Reserved_10[6];
1529
  UINT8                              Reserved_10[6];
1520
//UINT64                                      FlushHintAddress[NumberOfFlushHintAddresses];
1530
  // UINT64                                      FlushHintAddress[NumberOfFlushHintAddresses];
1521
} EFI_ACPI_6_0_NFIT_FLUSH_HINT_ADDRESS_STRUCTURE;
1531
} EFI_ACPI_6_0_NFIT_FLUSH_HINT_ADDRESS_STRUCTURE;
1522
1532
1523
///
1533
///
1524
/// Boot Error Record Table (BERT)
1534
/// Boot Error Record Table (BERT)
1525
///
1535
///
1526
typedef struct {
1536
typedef struct {
1527
  EFI_ACPI_DESCRIPTION_HEADER Header;
1537
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1528
  UINT32                      BootErrorRegionLength;
1538
  UINT32                         BootErrorRegionLength;
1529
  UINT64                      BootErrorRegion;
1539
  UINT64                         BootErrorRegion;
1530
} EFI_ACPI_6_0_BOOT_ERROR_RECORD_TABLE_HEADER;
1540
} EFI_ACPI_6_0_BOOT_ERROR_RECORD_TABLE_HEADER;
1531
1541
1532
///
1542
///
1533
/// BERT Version (as defined in ACPI 6.0 spec.)
1543
/// BERT Version (as defined in ACPI 6.0 spec.)
1534
///
1544
///
1535
#define EFI_ACPI_6_0_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
1545
#define EFI_ACPI_6_0_BOOT_ERROR_RECORD_TABLE_REVISION  0x01
1536
1546
1537
///
1547
///
1538
/// Boot Error Region Block Status Definition
1548
/// Boot Error Region Block Status Definition
1539
///
1549
///
1540
typedef struct {
1550
typedef struct {
1541
  UINT32       UncorrectableErrorValid:1;
1551
  UINT32    UncorrectableErrorValid     : 1;
1542
  UINT32       CorrectableErrorValid:1;
1552
  UINT32    CorrectableErrorValid       : 1;
1543
  UINT32       MultipleUncorrectableErrors:1;
1553
  UINT32    MultipleUncorrectableErrors : 1;
1544
  UINT32       MultipleCorrectableErrors:1;
1554
  UINT32    MultipleCorrectableErrors   : 1;
1545
  UINT32       ErrorDataEntryCount:10;
1555
  UINT32    ErrorDataEntryCount         : 10;
1546
  UINT32       Reserved:18;
1556
  UINT32    Reserved                    : 18;
1547
} EFI_ACPI_6_0_ERROR_BLOCK_STATUS;
1557
} EFI_ACPI_6_0_ERROR_BLOCK_STATUS;
1548
1558
1549
///
1559
///
1550
/// Boot Error Region Definition
1560
/// Boot Error Region Definition
1551
///
1561
///
1552
typedef struct {
1562
typedef struct {
1553
  EFI_ACPI_6_0_ERROR_BLOCK_STATUS              BlockStatus;
1563
  EFI_ACPI_6_0_ERROR_BLOCK_STATUS    BlockStatus;
1554
  UINT32                                       RawDataOffset;
1564
  UINT32                             RawDataOffset;
1555
  UINT32                                       RawDataLength;
1565
  UINT32                             RawDataLength;
1556
  UINT32                                       DataLength;
1566
  UINT32                             DataLength;
1557
  UINT32                                       ErrorSeverity;
1567
  UINT32                             ErrorSeverity;
1558
} EFI_ACPI_6_0_BOOT_ERROR_REGION_STRUCTURE;
1568
} EFI_ACPI_6_0_BOOT_ERROR_REGION_STRUCTURE;
1559
1569
1560
//
1570
//
1561
// Boot Error Severity types
1571
// Boot Error Severity types
1562
//
1572
//
1563
#define EFI_ACPI_6_0_ERROR_SEVERITY_CORRECTABLE  0x00
1573
#define EFI_ACPI_6_0_ERROR_SEVERITY_RECOVERABLE  0x00
1564
#define EFI_ACPI_6_0_ERROR_SEVERITY_FATAL        0x01
1574
#define EFI_ACPI_6_0_ERROR_SEVERITY_FATAL        0x01
1565
#define EFI_ACPI_6_0_ERROR_SEVERITY_CORRECTED    0x02
1575
#define EFI_ACPI_6_0_ERROR_SEVERITY_CORRECTED    0x02
1566
#define EFI_ACPI_6_0_ERROR_SEVERITY_NONE         0x03
1576
#define EFI_ACPI_6_0_ERROR_SEVERITY_NONE         0x03
1577
//
1578
// The term 'Correctable' is no longer being used as an error severity of the
1579
// reported error since ACPI Specification Version 5.1 Errata B.
1580
// The below macro is considered as deprecated and should no longer be used.
1581
//
1582
#define EFI_ACPI_6_0_ERROR_SEVERITY_CORRECTABLE  0x00
1567
1583
1568
///
1584
///
1569
/// Generic Error Data Entry Definition
1585
/// Generic Error Data Entry Definition
1570
///
1586
///
1571
typedef struct {
1587
typedef struct {
1572
  UINT8    SectionType[16];
1588
  UINT8     SectionType[16];
1573
  UINT32   ErrorSeverity;
1589
  UINT32    ErrorSeverity;
1574
  UINT16   Revision;
1590
  UINT16    Revision;
1575
  UINT8    ValidationBits;
1591
  UINT8     ValidationBits;
1576
  UINT8    Flags;
1592
  UINT8     Flags;
1577
  UINT32   ErrorDataLength;
1593
  UINT32    ErrorDataLength;
1578
  UINT8    FruId[16];
1594
  UINT8     FruId[16];
1579
  UINT8    FruText[20];
1595
  UINT8     FruText[20];
1580
} EFI_ACPI_6_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1596
} EFI_ACPI_6_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
1581
1597
1582
///
1598
///
Lines 1588-1601 typedef struct { Link Here
1588
/// HEST - Hardware Error Source Table
1604
/// HEST - Hardware Error Source Table
1589
///
1605
///
1590
typedef struct {
1606
typedef struct {
1591
  EFI_ACPI_DESCRIPTION_HEADER Header;
1607
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1592
  UINT32                      ErrorSourceCount;
1608
  UINT32                         ErrorSourceCount;
1593
} EFI_ACPI_6_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1609
} EFI_ACPI_6_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
1594
1610
1595
///
1611
///
1596
/// HEST Version (as defined in ACPI 6.0 spec.)
1612
/// HEST Version (as defined in ACPI 6.0 spec.)
1597
///
1613
///
1598
#define EFI_ACPI_6_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
1614
#define EFI_ACPI_6_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION  0x01
1599
1615
1600
//
1616
//
1601
// Error Source structure types.
1617
// Error Source structure types.
Lines 1611-2047 typedef struct { Link Here
1611
//
1627
//
1612
// Error Source structure flags.
1628
// Error Source structure flags.
1613
//
1629
//
1614
#define EFI_ACPI_6_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST       (1 << 0)
1630
#define EFI_ACPI_6_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST  (1 << 0)
1615
#define EFI_ACPI_6_0_ERROR_SOURCE_FLAG_GLOBAL               (1 << 1)
1631
#define EFI_ACPI_6_0_ERROR_SOURCE_FLAG_GLOBAL          (1 << 1)
1616
1632
1617
///
1633
///
1618
/// IA-32 Architecture Machine Check Exception Structure Definition
1634
/// IA-32 Architecture Machine Check Exception Structure Definition
1619
///
1635
///
1620
typedef struct {
1636
typedef struct {
1621
  UINT16  Type;
1637
  UINT16    Type;
1622
  UINT16  SourceId;
1638
  UINT16    SourceId;
1623
  UINT8   Reserved0[2];
1639
  UINT8     Reserved0[2];
1624
  UINT8   Flags;
1640
  UINT8     Flags;
1625
  UINT8   Enabled;
1641
  UINT8     Enabled;
1626
  UINT32  NumberOfRecordsToPreAllocate;
1642
  UINT32    NumberOfRecordsToPreAllocate;
1627
  UINT32  MaxSectionsPerRecord;
1643
  UINT32    MaxSectionsPerRecord;
1628
  UINT64  GlobalCapabilityInitData;
1644
  UINT64    GlobalCapabilityInitData;
1629
  UINT64  GlobalControlInitData;
1645
  UINT64    GlobalControlInitData;
1630
  UINT8   NumberOfHardwareBanks;
1646
  UINT8     NumberOfHardwareBanks;
1631
  UINT8   Reserved1[7];
1647
  UINT8     Reserved1[7];
1632
} EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1648
} EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
1633
1649
1634
///
1650
///
1635
/// IA-32 Architecture Machine Check Bank Structure Definition
1651
/// IA-32 Architecture Machine Check Bank Structure Definition
1636
///
1652
///
1637
typedef struct {
1653
typedef struct {
1638
  UINT8   BankNumber;
1654
  UINT8     BankNumber;
1639
  UINT8   ClearStatusOnInitialization;
1655
  UINT8     ClearStatusOnInitialization;
1640
  UINT8   StatusDataFormat;
1656
  UINT8     StatusDataFormat;
1641
  UINT8   Reserved0;
1657
  UINT8     Reserved0;
1642
  UINT32  ControlRegisterMsrAddress;
1658
  UINT32    ControlRegisterMsrAddress;
1643
  UINT64  ControlInitData;
1659
  UINT64    ControlInitData;
1644
  UINT32  StatusRegisterMsrAddress;
1660
  UINT32    StatusRegisterMsrAddress;
1645
  UINT32  AddressRegisterMsrAddress;
1661
  UINT32    AddressRegisterMsrAddress;
1646
  UINT32  MiscRegisterMsrAddress;
1662
  UINT32    MiscRegisterMsrAddress;
1647
} EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1663
} EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
1648
1664
1649
///
1665
///
1650
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1666
/// IA-32 Architecture Machine Check Bank Structure MCA data format
1651
///
1667
///
1652
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32      0x00
1668
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32     0x00
1653
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64   0x01
1669
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64  0x01
1654
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64     0x02
1670
#define EFI_ACPI_6_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64    0x02
1655
1671
1656
//
1672
//
1657
// Hardware Error Notification types. All other values are reserved
1673
// Hardware Error Notification types. All other values are reserved
1658
//
1674
//
1659
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_POLLED                0x00
1675
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_POLLED              0x00
1660
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT    0x01
1676
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT  0x01
1661
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT       0x02
1677
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT     0x02
1662
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_SCI                   0x03
1678
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_SCI                 0x03
1663
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_NMI                   0x04
1679
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_NMI                 0x04
1664
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CMCI                  0x05
1680
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CMCI                0x05
1665
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_MCE                   0x06
1681
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_MCE                 0x06
1666
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_GPIO_SIGNAL           0x07
1682
#define EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_GPIO_SIGNAL         0x07
1667
1683
1668
///
1684
///
1669
/// Hardware Error Notification Configuration Write Enable Structure Definition
1685
/// Hardware Error Notification Configuration Write Enable Structure Definition
1670
///
1686
///
1671
typedef struct {
1687
typedef struct {
1672
  UINT16    Type:1;
1688
  UINT16    Type                           : 1;
1673
  UINT16    PollInterval:1;
1689
  UINT16    PollInterval                   : 1;
1674
  UINT16    SwitchToPollingThresholdValue:1;
1690
  UINT16    SwitchToPollingThresholdValue  : 1;
1675
  UINT16    SwitchToPollingThresholdWindow:1;
1691
  UINT16    SwitchToPollingThresholdWindow : 1;
1676
  UINT16    ErrorThresholdValue:1;
1692
  UINT16    ErrorThresholdValue            : 1;
1677
  UINT16    ErrorThresholdWindow:1;
1693
  UINT16    ErrorThresholdWindow           : 1;
1678
  UINT16    Reserved:10;
1694
  UINT16    Reserved                       : 10;
1679
} EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1695
} EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
1680
1696
1681
///
1697
///
1682
/// Hardware Error Notification Structure Definition
1698
/// Hardware Error Notification Structure Definition
1683
///
1699
///
1684
typedef struct {
1700
typedef struct {
1685
  UINT8                                                                          Type;
1701
  UINT8                                                                            Type;
1686
  UINT8                                                                          Length;
1702
  UINT8                                                                            Length;
1687
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE  ConfigurationWriteEnable;
1703
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE    ConfigurationWriteEnable;
1688
  UINT32                                                                         PollInterval;
1704
  UINT32                                                                           PollInterval;
1689
  UINT32                                                                         Vector;
1705
  UINT32                                                                           Vector;
1690
  UINT32                                                                         SwitchToPollingThresholdValue;
1706
  UINT32                                                                           SwitchToPollingThresholdValue;
1691
  UINT32                                                                         SwitchToPollingThresholdWindow;
1707
  UINT32                                                                           SwitchToPollingThresholdWindow;
1692
  UINT32                                                                         ErrorThresholdValue;
1708
  UINT32                                                                           ErrorThresholdValue;
1693
  UINT32                                                                         ErrorThresholdWindow;
1709
  UINT32                                                                           ErrorThresholdWindow;
1694
} EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1710
} EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
1695
1711
1696
///
1712
///
1697
/// IA-32 Architecture Corrected Machine Check Structure Definition
1713
/// IA-32 Architecture Corrected Machine Check Structure Definition
1698
///
1714
///
1699
typedef struct {
1715
typedef struct {
1700
  UINT16                                                 Type;
1716
  UINT16                                                Type;
1701
  UINT16                                                 SourceId;
1717
  UINT16                                                SourceId;
1702
  UINT8                                                  Reserved0[2];
1718
  UINT8                                                 Reserved0[2];
1703
  UINT8                                                  Flags;
1719
  UINT8                                                 Flags;
1704
  UINT8                                                  Enabled;
1720
  UINT8                                                 Enabled;
1705
  UINT32                                                 NumberOfRecordsToPreAllocate;
1721
  UINT32                                                NumberOfRecordsToPreAllocate;
1706
  UINT32                                                 MaxSectionsPerRecord;
1722
  UINT32                                                MaxSectionsPerRecord;
1707
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1723
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1708
  UINT8                                                  NumberOfHardwareBanks;
1724
  UINT8                                                 NumberOfHardwareBanks;
1709
  UINT8                                                  Reserved1[3];
1725
  UINT8                                                 Reserved1[3];
1710
} EFI_ACPI_6_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1726
} EFI_ACPI_6_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
1711
1727
1712
///
1728
///
1713
/// IA-32 Architecture NMI Error Structure Definition
1729
/// IA-32 Architecture NMI Error Structure Definition
1714
///
1730
///
1715
typedef struct {
1731
typedef struct {
1716
  UINT16  Type;
1732
  UINT16    Type;
1717
  UINT16  SourceId;
1733
  UINT16    SourceId;
1718
  UINT8   Reserved0[2];
1734
  UINT8     Reserved0[2];
1719
  UINT32  NumberOfRecordsToPreAllocate;
1735
  UINT32    NumberOfRecordsToPreAllocate;
1720
  UINT32  MaxSectionsPerRecord;
1736
  UINT32    MaxSectionsPerRecord;
1721
  UINT32  MaxRawDataLength;
1737
  UINT32    MaxRawDataLength;
1722
} EFI_ACPI_6_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1738
} EFI_ACPI_6_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
1723
1739
1724
///
1740
///
1725
/// PCI Express Root Port AER Structure Definition
1741
/// PCI Express Root Port AER Structure Definition
1726
///
1742
///
1727
typedef struct {
1743
typedef struct {
1728
  UINT16  Type;
1744
  UINT16    Type;
1729
  UINT16  SourceId;
1745
  UINT16    SourceId;
1730
  UINT8   Reserved0[2];
1746
  UINT8     Reserved0[2];
1731
  UINT8   Flags;
1747
  UINT8     Flags;
1732
  UINT8   Enabled;
1748
  UINT8     Enabled;
1733
  UINT32  NumberOfRecordsToPreAllocate;
1749
  UINT32    NumberOfRecordsToPreAllocate;
1734
  UINT32  MaxSectionsPerRecord;
1750
  UINT32    MaxSectionsPerRecord;
1735
  UINT32  Bus;
1751
  UINT32    Bus;
1736
  UINT16  Device;
1752
  UINT16    Device;
1737
  UINT16  Function;
1753
  UINT16    Function;
1738
  UINT16  DeviceControl;
1754
  UINT16    DeviceControl;
1739
  UINT8   Reserved1[2];
1755
  UINT8     Reserved1[2];
1740
  UINT32  UncorrectableErrorMask;
1756
  UINT32    UncorrectableErrorMask;
1741
  UINT32  UncorrectableErrorSeverity;
1757
  UINT32    UncorrectableErrorSeverity;
1742
  UINT32  CorrectableErrorMask;
1758
  UINT32    CorrectableErrorMask;
1743
  UINT32  AdvancedErrorCapabilitiesAndControl;
1759
  UINT32    AdvancedErrorCapabilitiesAndControl;
1744
  UINT32  RootErrorCommand;
1760
  UINT32    RootErrorCommand;
1745
} EFI_ACPI_6_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1761
} EFI_ACPI_6_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
1746
1762
1747
///
1763
///
1748
/// PCI Express Device AER Structure Definition
1764
/// PCI Express Device AER Structure Definition
1749
///
1765
///
1750
typedef struct {
1766
typedef struct {
1751
  UINT16  Type;
1767
  UINT16    Type;
1752
  UINT16  SourceId;
1768
  UINT16    SourceId;
1753
  UINT8   Reserved0[2];
1769
  UINT8     Reserved0[2];
1754
  UINT8   Flags;
1770
  UINT8     Flags;
1755
  UINT8   Enabled;
1771
  UINT8     Enabled;
1756
  UINT32  NumberOfRecordsToPreAllocate;
1772
  UINT32    NumberOfRecordsToPreAllocate;
1757
  UINT32  MaxSectionsPerRecord;
1773
  UINT32    MaxSectionsPerRecord;
1758
  UINT32  Bus;
1774
  UINT32    Bus;
1759
  UINT16  Device;
1775
  UINT16    Device;
1760
  UINT16  Function;
1776
  UINT16    Function;
1761
  UINT16  DeviceControl;
1777
  UINT16    DeviceControl;
1762
  UINT8   Reserved1[2];
1778
  UINT8     Reserved1[2];
1763
  UINT32  UncorrectableErrorMask;
1779
  UINT32    UncorrectableErrorMask;
1764
  UINT32  UncorrectableErrorSeverity;
1780
  UINT32    UncorrectableErrorSeverity;
1765
  UINT32  CorrectableErrorMask;
1781
  UINT32    CorrectableErrorMask;
1766
  UINT32  AdvancedErrorCapabilitiesAndControl;
1782
  UINT32    AdvancedErrorCapabilitiesAndControl;
1767
} EFI_ACPI_6_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1783
} EFI_ACPI_6_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
1768
1784
1769
///
1785
///
1770
/// PCI Express Bridge AER Structure Definition
1786
/// PCI Express Bridge AER Structure Definition
1771
///
1787
///
1772
typedef struct {
1788
typedef struct {
1773
  UINT16  Type;
1789
  UINT16    Type;
1774
  UINT16  SourceId;
1790
  UINT16    SourceId;
1775
  UINT8   Reserved0[2];
1791
  UINT8     Reserved0[2];
1776
  UINT8   Flags;
1792
  UINT8     Flags;
1777
  UINT8   Enabled;
1793
  UINT8     Enabled;
1778
  UINT32  NumberOfRecordsToPreAllocate;
1794
  UINT32    NumberOfRecordsToPreAllocate;
1779
  UINT32  MaxSectionsPerRecord;
1795
  UINT32    MaxSectionsPerRecord;
1780
  UINT32  Bus;
1796
  UINT32    Bus;
1781
  UINT16  Device;
1797
  UINT16    Device;
1782
  UINT16  Function;
1798
  UINT16    Function;
1783
  UINT16  DeviceControl;
1799
  UINT16    DeviceControl;
1784
  UINT8   Reserved1[2];
1800
  UINT8     Reserved1[2];
1785
  UINT32  UncorrectableErrorMask;
1801
  UINT32    UncorrectableErrorMask;
1786
  UINT32  UncorrectableErrorSeverity;
1802
  UINT32    UncorrectableErrorSeverity;
1787
  UINT32  CorrectableErrorMask;
1803
  UINT32    CorrectableErrorMask;
1788
  UINT32  AdvancedErrorCapabilitiesAndControl;
1804
  UINT32    AdvancedErrorCapabilitiesAndControl;
1789
  UINT32  SecondaryUncorrectableErrorMask;
1805
  UINT32    SecondaryUncorrectableErrorMask;
1790
  UINT32  SecondaryUncorrectableErrorSeverity;
1806
  UINT32    SecondaryUncorrectableErrorSeverity;
1791
  UINT32  SecondaryAdvancedErrorCapabilitiesAndControl;
1807
  UINT32    SecondaryAdvancedErrorCapabilitiesAndControl;
1792
} EFI_ACPI_6_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1808
} EFI_ACPI_6_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
1793
1809
1794
///
1810
///
1795
/// Generic Hardware Error Source Structure Definition
1811
/// Generic Hardware Error Source Structure Definition
1796
///
1812
///
1797
typedef struct {
1813
typedef struct {
1798
  UINT16                                                 Type;
1814
  UINT16                                                Type;
1799
  UINT16                                                 SourceId;
1815
  UINT16                                                SourceId;
1800
  UINT16                                                 RelatedSourceId;
1816
  UINT16                                                RelatedSourceId;
1801
  UINT8                                                  Flags;
1817
  UINT8                                                 Flags;
1802
  UINT8                                                  Enabled;
1818
  UINT8                                                 Enabled;
1803
  UINT32                                                 NumberOfRecordsToPreAllocate;
1819
  UINT32                                                NumberOfRecordsToPreAllocate;
1804
  UINT32                                                 MaxSectionsPerRecord;
1820
  UINT32                                                MaxSectionsPerRecord;
1805
  UINT32                                                 MaxRawDataLength;
1821
  UINT32                                                MaxRawDataLength;
1806
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE                 ErrorStatusAddress;
1822
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE                ErrorStatusAddress;
1807
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
1823
  EFI_ACPI_6_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE    NotificationStructure;
1808
  UINT32                                                 ErrorStatusBlockLength;
1824
  UINT32                                                ErrorStatusBlockLength;
1809
} EFI_ACPI_6_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1825
} EFI_ACPI_6_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
1810
1826
1811
///
1827
///
1812
/// Generic Error Status Definition
1828
/// Generic Error Status Definition
1813
///
1829
///
1814
typedef struct {
1830
typedef struct {
1815
  EFI_ACPI_6_0_ERROR_BLOCK_STATUS              BlockStatus;
1831
  EFI_ACPI_6_0_ERROR_BLOCK_STATUS    BlockStatus;
1816
  UINT32                                       RawDataOffset;
1832
  UINT32                             RawDataOffset;
1817
  UINT32                                       RawDataLength;
1833
  UINT32                             RawDataLength;
1818
  UINT32                                       DataLength;
1834
  UINT32                             DataLength;
1819
  UINT32                                       ErrorSeverity;
1835
  UINT32                             ErrorSeverity;
1820
} EFI_ACPI_6_0_GENERIC_ERROR_STATUS_STRUCTURE;
1836
} EFI_ACPI_6_0_GENERIC_ERROR_STATUS_STRUCTURE;
1821
1837
1822
///
1838
///
1823
/// ERST - Error Record Serialization Table
1839
/// ERST - Error Record Serialization Table
1824
///
1840
///
1825
typedef struct {
1841
typedef struct {
1826
  EFI_ACPI_DESCRIPTION_HEADER Header;
1842
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1827
  UINT32                      SerializationHeaderSize;
1843
  UINT32                         SerializationHeaderSize;
1828
  UINT8                       Reserved0[4];
1844
  UINT8                          Reserved0[4];
1829
  UINT32                      InstructionEntryCount;
1845
  UINT32                         InstructionEntryCount;
1830
} EFI_ACPI_6_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1846
} EFI_ACPI_6_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
1831
1847
1832
///
1848
///
1833
/// ERST Version (as defined in ACPI 6.0 spec.)
1849
/// ERST Version (as defined in ACPI 6.0 spec.)
1834
///
1850
///
1835
#define EFI_ACPI_6_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
1851
#define EFI_ACPI_6_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION  0x01
1836
1852
1837
///
1853
///
1838
/// ERST Serialization Actions
1854
/// ERST Serialization Actions
1839
///
1855
///
1840
#define EFI_ACPI_6_0_ERST_BEGIN_WRITE_OPERATION                    0x00
1856
#define EFI_ACPI_6_0_ERST_BEGIN_WRITE_OPERATION                   0x00
1841
#define EFI_ACPI_6_0_ERST_BEGIN_READ_OPERATION                     0x01
1857
#define EFI_ACPI_6_0_ERST_BEGIN_READ_OPERATION                    0x01
1842
#define EFI_ACPI_6_0_ERST_BEGIN_CLEAR_OPERATION                    0x02
1858
#define EFI_ACPI_6_0_ERST_BEGIN_CLEAR_OPERATION                   0x02
1843
#define EFI_ACPI_6_0_ERST_END_OPERATION                            0x03
1859
#define EFI_ACPI_6_0_ERST_END_OPERATION                           0x03
1844
#define EFI_ACPI_6_0_ERST_SET_RECORD_OFFSET                        0x04
1860
#define EFI_ACPI_6_0_ERST_SET_RECORD_OFFSET                       0x04
1845
#define EFI_ACPI_6_0_ERST_EXECUTE_OPERATION                        0x05
1861
#define EFI_ACPI_6_0_ERST_EXECUTE_OPERATION                       0x05
1846
#define EFI_ACPI_6_0_ERST_CHECK_BUSY_STATUS                        0x06
1862
#define EFI_ACPI_6_0_ERST_CHECK_BUSY_STATUS                       0x06
1847
#define EFI_ACPI_6_0_ERST_GET_COMMAND_STATUS                       0x07
1863
#define EFI_ACPI_6_0_ERST_GET_COMMAND_STATUS                      0x07
1848
#define EFI_ACPI_6_0_ERST_GET_RECORD_IDENTIFIER                    0x08
1864
#define EFI_ACPI_6_0_ERST_GET_RECORD_IDENTIFIER                   0x08
1849
#define EFI_ACPI_6_0_ERST_SET_RECORD_IDENTIFIER                    0x09
1865
#define EFI_ACPI_6_0_ERST_SET_RECORD_IDENTIFIER                   0x09
1850
#define EFI_ACPI_6_0_ERST_GET_RECORD_COUNT                         0x0A
1866
#define EFI_ACPI_6_0_ERST_GET_RECORD_COUNT                        0x0A
1851
#define EFI_ACPI_6_0_ERST_BEGIN_DUMMY_WRITE_OPERATION              0x0B
1867
#define EFI_ACPI_6_0_ERST_BEGIN_DUMMY_WRITE_OPERATION             0x0B
1852
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE              0x0D
1868
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE             0x0D
1853
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH       0x0E
1869
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH      0x0E
1854
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES   0x0F
1870
#define EFI_ACPI_6_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES  0x0F
1855
1871
1856
///
1872
///
1857
/// ERST Action Command Status
1873
/// ERST Action Command Status
1858
///
1874
///
1859
#define EFI_ACPI_6_0_ERST_STATUS_SUCCESS                           0x00
1875
#define EFI_ACPI_6_0_ERST_STATUS_SUCCESS                 0x00
1860
#define EFI_ACPI_6_0_ERST_STATUS_NOT_ENOUGH_SPACE                  0x01
1876
#define EFI_ACPI_6_0_ERST_STATUS_NOT_ENOUGH_SPACE        0x01
1861
#define EFI_ACPI_6_0_ERST_STATUS_HARDWARE_NOT_AVAILABLE            0x02
1877
#define EFI_ACPI_6_0_ERST_STATUS_HARDWARE_NOT_AVAILABLE  0x02
1862
#define EFI_ACPI_6_0_ERST_STATUS_FAILED                            0x03
1878
#define EFI_ACPI_6_0_ERST_STATUS_FAILED                  0x03
1863
#define EFI_ACPI_6_0_ERST_STATUS_RECORD_STORE_EMPTY                0x04
1879
#define EFI_ACPI_6_0_ERST_STATUS_RECORD_STORE_EMPTY      0x04
1864
#define EFI_ACPI_6_0_ERST_STATUS_RECORD_NOT_FOUND                  0x05
1880
#define EFI_ACPI_6_0_ERST_STATUS_RECORD_NOT_FOUND        0x05
1865
1881
1866
///
1882
///
1867
/// ERST Serialization Instructions
1883
/// ERST Serialization Instructions
1868
///
1884
///
1869
#define EFI_ACPI_6_0_ERST_READ_REGISTER                            0x00
1885
#define EFI_ACPI_6_0_ERST_READ_REGISTER                  0x00
1870
#define EFI_ACPI_6_0_ERST_READ_REGISTER_VALUE                      0x01
1886
#define EFI_ACPI_6_0_ERST_READ_REGISTER_VALUE            0x01
1871
#define EFI_ACPI_6_0_ERST_WRITE_REGISTER                           0x02
1887
#define EFI_ACPI_6_0_ERST_WRITE_REGISTER                 0x02
1872
#define EFI_ACPI_6_0_ERST_WRITE_REGISTER_VALUE                     0x03
1888
#define EFI_ACPI_6_0_ERST_WRITE_REGISTER_VALUE           0x03
1873
#define EFI_ACPI_6_0_ERST_NOOP                                     0x04
1889
#define EFI_ACPI_6_0_ERST_NOOP                           0x04
1874
#define EFI_ACPI_6_0_ERST_LOAD_VAR1                                0x05
1890
#define EFI_ACPI_6_0_ERST_LOAD_VAR1                      0x05
1875
#define EFI_ACPI_6_0_ERST_LOAD_VAR2                                0x06
1891
#define EFI_ACPI_6_0_ERST_LOAD_VAR2                      0x06
1876
#define EFI_ACPI_6_0_ERST_STORE_VAR1                               0x07
1892
#define EFI_ACPI_6_0_ERST_STORE_VAR1                     0x07
1877
#define EFI_ACPI_6_0_ERST_ADD                                      0x08
1893
#define EFI_ACPI_6_0_ERST_ADD                            0x08
1878
#define EFI_ACPI_6_0_ERST_SUBTRACT                                 0x09
1894
#define EFI_ACPI_6_0_ERST_SUBTRACT                       0x09
1879
#define EFI_ACPI_6_0_ERST_ADD_VALUE                                0x0A
1895
#define EFI_ACPI_6_0_ERST_ADD_VALUE                      0x0A
1880
#define EFI_ACPI_6_0_ERST_SUBTRACT_VALUE                           0x0B
1896
#define EFI_ACPI_6_0_ERST_SUBTRACT_VALUE                 0x0B
1881
#define EFI_ACPI_6_0_ERST_STALL                                    0x0C
1897
#define EFI_ACPI_6_0_ERST_STALL                          0x0C
1882
#define EFI_ACPI_6_0_ERST_STALL_WHILE_TRUE                         0x0D
1898
#define EFI_ACPI_6_0_ERST_STALL_WHILE_TRUE               0x0D
1883
#define EFI_ACPI_6_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE            0x0E
1899
#define EFI_ACPI_6_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE  0x0E
1884
#define EFI_ACPI_6_0_ERST_GOTO                                     0x0F
1900
#define EFI_ACPI_6_0_ERST_GOTO                           0x0F
1885
#define EFI_ACPI_6_0_ERST_SET_SRC_ADDRESS_BASE                     0x10
1901
#define EFI_ACPI_6_0_ERST_SET_SRC_ADDRESS_BASE           0x10
1886
#define EFI_ACPI_6_0_ERST_SET_DST_ADDRESS_BASE                     0x11
1902
#define EFI_ACPI_6_0_ERST_SET_DST_ADDRESS_BASE           0x11
1887
#define EFI_ACPI_6_0_ERST_MOVE_DATA                                0x12
1903
#define EFI_ACPI_6_0_ERST_MOVE_DATA                      0x12
1888
1904
1889
///
1905
///
1890
/// ERST Instruction Flags
1906
/// ERST Instruction Flags
1891
///
1907
///
1892
#define EFI_ACPI_6_0_ERST_PRESERVE_REGISTER                        0x01
1908
#define EFI_ACPI_6_0_ERST_PRESERVE_REGISTER  0x01
1893
1909
1894
///
1910
///
1895
/// ERST Serialization Instruction Entry
1911
/// ERST Serialization Instruction Entry
1896
///
1912
///
1897
typedef struct {
1913
typedef struct {
1898
  UINT8                                    SerializationAction;
1914
  UINT8                                     SerializationAction;
1899
  UINT8                                    Instruction;
1915
  UINT8                                     Instruction;
1900
  UINT8                                    Flags;
1916
  UINT8                                     Flags;
1901
  UINT8                                    Reserved0;
1917
  UINT8                                     Reserved0;
1902
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1918
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1903
  UINT64                                   Value;
1919
  UINT64                                    Value;
1904
  UINT64                                   Mask;
1920
  UINT64                                    Mask;
1905
} EFI_ACPI_6_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1921
} EFI_ACPI_6_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1906
1922
1907
///
1923
///
1908
/// EINJ - Error Injection Table
1924
/// EINJ - Error Injection Table
1909
///
1925
///
1910
typedef struct {
1926
typedef struct {
1911
  EFI_ACPI_DESCRIPTION_HEADER Header;
1927
  EFI_ACPI_DESCRIPTION_HEADER    Header;
1912
  UINT32                      InjectionHeaderSize;
1928
  UINT32                         InjectionHeaderSize;
1913
  UINT8                       InjectionFlags;
1929
  UINT8                          InjectionFlags;
1914
  UINT8                       Reserved0[3];
1930
  UINT8                          Reserved0[3];
1915
  UINT32                      InjectionEntryCount;
1931
  UINT32                         InjectionEntryCount;
1916
} EFI_ACPI_6_0_ERROR_INJECTION_TABLE_HEADER;
1932
} EFI_ACPI_6_0_ERROR_INJECTION_TABLE_HEADER;
1917
1933
1918
///
1934
///
1919
/// EINJ Version (as defined in ACPI 6.0 spec.)
1935
/// EINJ Version (as defined in ACPI 6.0 spec.)
1920
///
1936
///
1921
#define EFI_ACPI_6_0_ERROR_INJECTION_TABLE_REVISION 0x01
1937
#define EFI_ACPI_6_0_ERROR_INJECTION_TABLE_REVISION  0x01
1922
1938
1923
///
1939
///
1924
/// EINJ Error Injection Actions
1940
/// EINJ Error Injection Actions
1925
///
1941
///
1926
#define EFI_ACPI_6_0_EINJ_BEGIN_INJECTION_OPERATION                0x00
1942
#define EFI_ACPI_6_0_EINJ_BEGIN_INJECTION_OPERATION       0x00
1927
#define EFI_ACPI_6_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE           0x01
1943
#define EFI_ACPI_6_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE  0x01
1928
#define EFI_ACPI_6_0_EINJ_SET_ERROR_TYPE                           0x02
1944
#define EFI_ACPI_6_0_EINJ_SET_ERROR_TYPE                  0x02
1929
#define EFI_ACPI_6_0_EINJ_GET_ERROR_TYPE                           0x03
1945
#define EFI_ACPI_6_0_EINJ_GET_ERROR_TYPE                  0x03
1930
#define EFI_ACPI_6_0_EINJ_END_OPERATION                            0x04
1946
#define EFI_ACPI_6_0_EINJ_END_OPERATION                   0x04
1931
#define EFI_ACPI_6_0_EINJ_EXECUTE_OPERATION                        0x05
1947
#define EFI_ACPI_6_0_EINJ_EXECUTE_OPERATION               0x05
1932
#define EFI_ACPI_6_0_EINJ_CHECK_BUSY_STATUS                        0x06
1948
#define EFI_ACPI_6_0_EINJ_CHECK_BUSY_STATUS               0x06
1933
#define EFI_ACPI_6_0_EINJ_GET_COMMAND_STATUS                       0x07
1949
#define EFI_ACPI_6_0_EINJ_GET_COMMAND_STATUS              0x07
1934
#define EFI_ACPI_6_0_EINJ_TRIGGER_ERROR                            0xFF
1950
#define EFI_ACPI_6_0_EINJ_TRIGGER_ERROR                   0xFF
1935
1951
1936
///
1952
///
1937
/// EINJ Action Command Status
1953
/// EINJ Action Command Status
1938
///
1954
///
1939
#define EFI_ACPI_6_0_EINJ_STATUS_SUCCESS                           0x00
1955
#define EFI_ACPI_6_0_EINJ_STATUS_SUCCESS          0x00
1940
#define EFI_ACPI_6_0_EINJ_STATUS_UNKNOWN_FAILURE                   0x01
1956
#define EFI_ACPI_6_0_EINJ_STATUS_UNKNOWN_FAILURE  0x01
1941
#define EFI_ACPI_6_0_EINJ_STATUS_INVALID_ACCESS                    0x02
1957
#define EFI_ACPI_6_0_EINJ_STATUS_INVALID_ACCESS   0x02
1942
1958
1943
///
1959
///
1944
/// EINJ Error Type Definition
1960
/// EINJ Error Type Definition
1945
///
1961
///
1946
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_CORRECTABLE                 (1 << 0)
1962
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_CORRECTABLE               (1 << 0)
1947
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL      (1 << 1)
1963
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL    (1 << 1)
1948
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL         (1 << 2)
1964
#define EFI_ACPI_6_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL       (1 << 2)
1949
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_CORRECTABLE                    (1 << 3)
1965
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_CORRECTABLE                  (1 << 3)
1950
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL         (1 << 4)
1966
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL       (1 << 4)
1951
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL            (1 << 5)
1967
#define EFI_ACPI_6_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL          (1 << 5)
1952
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE               (1 << 6)
1968
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE             (1 << 6)
1953
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL    (1 << 7)
1969
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL  (1 << 7)
1954
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL       (1 << 8)
1970
#define EFI_ACPI_6_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL     (1 << 8)
1955
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_CORRECTABLE                  (1 << 9)
1971
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_CORRECTABLE                (1 << 9)
1956
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL       (1 << 10)
1972
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL     (1 << 10)
1957
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL          (1 << 11)
1973
#define EFI_ACPI_6_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL        (1 << 11)
1958
1974
1959
///
1975
///
1960
/// EINJ Injection Instructions
1976
/// EINJ Injection Instructions
1961
///
1977
///
1962
#define EFI_ACPI_6_0_EINJ_READ_REGISTER                            0x00
1978
#define EFI_ACPI_6_0_EINJ_READ_REGISTER         0x00
1963
#define EFI_ACPI_6_0_EINJ_READ_REGISTER_VALUE                      0x01
1979
#define EFI_ACPI_6_0_EINJ_READ_REGISTER_VALUE   0x01
1964
#define EFI_ACPI_6_0_EINJ_WRITE_REGISTER                           0x02
1980
#define EFI_ACPI_6_0_EINJ_WRITE_REGISTER        0x02
1965
#define EFI_ACPI_6_0_EINJ_WRITE_REGISTER_VALUE                     0x03
1981
#define EFI_ACPI_6_0_EINJ_WRITE_REGISTER_VALUE  0x03
1966
#define EFI_ACPI_6_0_EINJ_NOOP                                     0x04
1982
#define EFI_ACPI_6_0_EINJ_NOOP                  0x04
1967
1983
1968
///
1984
///
1969
/// EINJ Instruction Flags
1985
/// EINJ Instruction Flags
1970
///
1986
///
1971
#define EFI_ACPI_6_0_EINJ_PRESERVE_REGISTER                        0x01
1987
#define EFI_ACPI_6_0_EINJ_PRESERVE_REGISTER  0x01
1972
1988
1973
///
1989
///
1974
/// EINJ Injection Instruction Entry
1990
/// EINJ Injection Instruction Entry
1975
///
1991
///
1976
typedef struct {
1992
typedef struct {
1977
  UINT8                                    InjectionAction;
1993
  UINT8                                     InjectionAction;
1978
  UINT8                                    Instruction;
1994
  UINT8                                     Instruction;
1979
  UINT8                                    Flags;
1995
  UINT8                                     Flags;
1980
  UINT8                                    Reserved0;
1996
  UINT8                                     Reserved0;
1981
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1997
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    RegisterRegion;
1982
  UINT64                                   Value;
1998
  UINT64                                    Value;
1983
  UINT64                                   Mask;
1999
  UINT64                                    Mask;
1984
} EFI_ACPI_6_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
2000
} EFI_ACPI_6_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1985
2001
1986
///
2002
///
1987
/// EINJ Trigger Action Table
2003
/// EINJ Trigger Action Table
1988
///
2004
///
1989
typedef struct {
2005
typedef struct {
1990
  UINT32  HeaderSize;
2006
  UINT32    HeaderSize;
1991
  UINT32  Revision;
2007
  UINT32    Revision;
1992
  UINT32  TableSize;
2008
  UINT32    TableSize;
1993
  UINT32  EntryCount;
2009
  UINT32    EntryCount;
1994
} EFI_ACPI_6_0_EINJ_TRIGGER_ACTION_TABLE;
2010
} EFI_ACPI_6_0_EINJ_TRIGGER_ACTION_TABLE;
1995
2011
1996
///
2012
///
1997
/// Platform Communications Channel Table (PCCT)
2013
/// Platform Communications Channel Table (PCCT)
1998
///
2014
///
1999
typedef struct {
2015
typedef struct {
2000
  EFI_ACPI_DESCRIPTION_HEADER Header;
2016
  EFI_ACPI_DESCRIPTION_HEADER    Header;
2001
  UINT32                      Flags;
2017
  UINT32                         Flags;
2002
  UINT64                      Reserved;
2018
  UINT64                         Reserved;
2003
} EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
2019
} EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_HEADER;
2004
2020
2005
///
2021
///
2006
/// PCCT Version (as defined in ACPI 6.0 spec.)
2022
/// PCCT Version (as defined in ACPI 6.0 spec.)
2007
///
2023
///
2008
#define EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION 0x01
2024
#define EFI_ACPI_6_0_PLATFORM_COMMUNICATION_CHANNEL_TABLE_REVISION  0x01
2009
2025
2010
///
2026
///
2011
/// PCCT Global Flags
2027
/// PCCT Global Flags
2012
///
2028
///
2013
#define EFI_ACPI_6_0_PCCT_FLAGS_SCI_DOORBELL                      BIT0
2029
#define EFI_ACPI_6_0_PCCT_FLAGS_SCI_DOORBELL  BIT0
2014
2030
2015
//
2031
//
2016
// PCCT Subspace type
2032
// PCCT Subspace type
2017
//
2033
//
2018
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_GENERIC                         0x00
2034
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_GENERIC                      0x00
2019
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS     0x01
2035
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_1_HW_REDUCED_COMMUNICATIONS  0x01
2020
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS     0x02
2036
#define EFI_ACPI_6_0_PCCT_SUBSPACE_TYPE_2_HW_REDUCED_COMMUNICATIONS  0x02
2021
2037
2022
///
2038
///
2023
/// PCC Subspace Structure Header
2039
/// PCC Subspace Structure Header
2024
///
2040
///
2025
typedef struct {
2041
typedef struct {
2026
  UINT8        Type;
2042
  UINT8    Type;
2027
  UINT8        Length;
2043
  UINT8    Length;
2028
} EFI_ACPI_6_0_PCCT_SUBSPACE_HEADER;
2044
} EFI_ACPI_6_0_PCCT_SUBSPACE_HEADER;
2029
2045
2030
///
2046
///
2031
/// Generic Communications Subspace Structure
2047
/// Generic Communications Subspace Structure
2032
///
2048
///
2033
typedef struct {
2049
typedef struct {
2034
  UINT8                                    Type;
2050
  UINT8                                     Type;
2035
  UINT8                                    Length;
2051
  UINT8                                     Length;
2036
  UINT8                                    Reserved[6];
2052
  UINT8                                     Reserved[6];
2037
  UINT64                                   BaseAddress;
2053
  UINT64                                    BaseAddress;
2038
  UINT64                                   AddressLength;
2054
  UINT64                                    AddressLength;
2039
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   DoorbellRegister;
2055
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    DoorbellRegister;
2040
  UINT64                                   DoorbellPreserve;
2056
  UINT64                                    DoorbellPreserve;
2041
  UINT64                                   DoorbellWrite;
2057
  UINT64                                    DoorbellWrite;
2042
  UINT32                                   NominalLatency;
2058
  UINT32                                    NominalLatency;
2043
  UINT32                                   MaximumPeriodicAccessRate;
2059
  UINT32                                    MaximumPeriodicAccessRate;
2044
  UINT16                                   MinimumRequestTurnaroundTime;
2060
  UINT16                                    MinimumRequestTurnaroundTime;
2045
} EFI_ACPI_6_0_PCCT_SUBSPACE_GENERIC;
2061
} EFI_ACPI_6_0_PCCT_SUBSPACE_GENERIC;
2046
2062
2047
///
2063
///
Lines 2049-2066 typedef struct { Link Here
2049
///
2065
///
2050
2066
2051
typedef struct {
2067
typedef struct {
2052
  UINT8                                    Command;
2068
  UINT8    Command;
2053
  UINT8                                    Reserved:7;
2069
  UINT8    Reserved    : 7;
2054
  UINT8                                    GenerateSci:1;
2070
  UINT8    GenerateSci : 1;
2055
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
2071
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_COMMAND;
2056
2072
2057
typedef struct {
2073
typedef struct {
2058
  UINT8                                    CommandComplete:1;
2074
  UINT8    CommandComplete      : 1;
2059
  UINT8                                    SciDoorbell:1;
2075
  UINT8    SciDoorbell          : 1;
2060
  UINT8                                    Error:1;
2076
  UINT8    Error                : 1;
2061
  UINT8                                    PlatformNotification:1;
2077
  UINT8    PlatformNotification : 1;
2062
  UINT8                                    Reserved:4;
2078
  UINT8    Reserved             : 4;
2063
  UINT8                                    Reserved1;
2079
  UINT8    Reserved1;
2064
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
2080
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS;
2065
2081
2066
typedef struct {
2082
typedef struct {
Lines 2069-2116 typedef struct { Link Here
2069
  EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS     Status;
2085
  EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_STATUS     Status;
2070
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_HEADER;
2086
} EFI_ACPI_6_0_PCCT_GENERIC_SHARED_MEMORY_REGION_HEADER;
2071
2087
2072
#define EFI_ACPI_6_0_PCCT_SUBSPACE_DOORBELL_INTERRUPT_FLAGS_POLARITY    BIT0
2088
#define EFI_ACPI_6_0_PCCT_SUBSPACE_DOORBELL_INTERRUPT_FLAGS_POLARITY  BIT0
2073
#define EFI_ACPI_6_0_PCCT_SUBSPACE_DOORBELL_INTERRUPT_FLAGS_MODE        BIT1
2089
#define EFI_ACPI_6_0_PCCT_SUBSPACE_DOORBELL_INTERRUPT_FLAGS_MODE      BIT1
2074
2090
2075
///
2091
///
2076
/// Type 1 HW-Reduced Communications Subspace Structure
2092
/// Type 1 HW-Reduced Communications Subspace Structure
2077
///
2093
///
2078
typedef struct {
2094
typedef struct {
2079
  UINT8                                    Type;
2095
  UINT8                                     Type;
2080
  UINT8                                    Length;
2096
  UINT8                                     Length;
2081
  UINT32                                   DoorbellInterrupt;
2097
  UINT32                                    DoorbellInterrupt;
2082
  UINT8                                    DoorbellInterruptFlags;
2098
  UINT8                                     DoorbellInterruptFlags;
2083
  UINT8                                    Reserved;
2099
  UINT8                                     Reserved;
2084
  UINT64                                   BaseAddress;
2100
  UINT64                                    BaseAddress;
2085
  UINT64                                   AddressLength;
2101
  UINT64                                    AddressLength;
2086
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   DoorbellRegister;
2102
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    DoorbellRegister;
2087
  UINT64                                   DoorbellPreserve;
2103
  UINT64                                    DoorbellPreserve;
2088
  UINT64                                   DoorbellWrite;
2104
  UINT64                                    DoorbellWrite;
2089
  UINT32                                   NominalLatency;
2105
  UINT32                                    NominalLatency;
2090
  UINT32                                   MaximumPeriodicAccessRate;
2106
  UINT32                                    MaximumPeriodicAccessRate;
2091
  UINT16                                   MinimumRequestTurnaroundTime;
2107
  UINT16                                    MinimumRequestTurnaroundTime;
2092
} EFI_ACPI_6_0_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS;
2108
} EFI_ACPI_6_0_PCCT_SUBSPACE_1_HW_REDUCED_COMMUNICATIONS;
2093
2109
2094
///
2110
///
2095
/// Type 2 HW-Reduced Communications Subspace Structure
2111
/// Type 2 HW-Reduced Communications Subspace Structure
2096
///
2112
///
2097
typedef struct {
2113
typedef struct {
2098
  UINT8                                    Type;
2114
  UINT8                                     Type;
2099
  UINT8                                    Length;
2115
  UINT8                                     Length;
2100
  UINT32                                   DoorbellInterrupt;
2116
  UINT32                                    DoorbellInterrupt;
2101
  UINT8                                    DoorbellInterruptFlags;
2117
  UINT8                                     DoorbellInterruptFlags;
2102
  UINT8                                    Reserved;
2118
  UINT8                                     Reserved;
2103
  UINT64                                   BaseAddress;
2119
  UINT64                                    BaseAddress;
2104
  UINT64                                   AddressLength;
2120
  UINT64                                    AddressLength;
2105
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   DoorbellRegister;
2121
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    DoorbellRegister;
2106
  UINT64                                   DoorbellPreserve;
2122
  UINT64                                    DoorbellPreserve;
2107
  UINT64                                   DoorbellWrite;
2123
  UINT64                                    DoorbellWrite;
2108
  UINT32                                   NominalLatency;
2124
  UINT32                                    NominalLatency;
2109
  UINT32                                   MaximumPeriodicAccessRate;
2125
  UINT32                                    MaximumPeriodicAccessRate;
2110
  UINT16                                   MinimumRequestTurnaroundTime;
2126
  UINT16                                    MinimumRequestTurnaroundTime;
2111
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE   DoorbellAckRegister;
2127
  EFI_ACPI_6_0_GENERIC_ADDRESS_STRUCTURE    DoorbellAckRegister;
2112
  UINT64                                   DoorbellAckPreserve;
2128
  UINT64                                    DoorbellAckPreserve;
2113
  UINT64                                   DoorbellAckWrite;
2129
  UINT64                                    DoorbellAckWrite;
2114
} EFI_ACPI_6_0_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS;
2130
} EFI_ACPI_6_0_PCCT_SUBSPACE_2_HW_REDUCED_COMMUNICATIONS;
2115
2131
2116
//
2132
//
(-)b/sys/contrib/edk2/Include/IndustryStandard/AcpiAml.h (-150 / +155 lines)
Lines 2-8 Link Here
2
  This file contains AML code definition in the latest ACPI spec.
2
  This file contains AML code definition in the latest ACPI spec.
3
3
4
  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
4
  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
5
  Copyright (c) 2019, ARM Limited. All rights reserved.<BR>
5
  Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR>
6
  SPDX-License-Identifier: BSD-2-Clause-Patent
6
  SPDX-License-Identifier: BSD-2-Clause-Patent
7
7
8
**/
8
**/
Lines 17-179 Link Here
17
//
17
//
18
// Primary OpCode
18
// Primary OpCode
19
//
19
//
20
#define AML_ZERO_OP                  0x00
20
#define AML_ZERO_OP                0x00
21
#define AML_ONE_OP                   0x01
21
#define AML_ONE_OP                 0x01
22
#define AML_ALIAS_OP                 0x06
22
#define AML_ALIAS_OP               0x06
23
#define AML_NAME_OP                  0x08
23
#define AML_NAME_OP                0x08
24
#define AML_BYTE_PREFIX              0x0a
24
#define AML_BYTE_PREFIX            0x0a
25
#define AML_WORD_PREFIX              0x0b
25
#define AML_WORD_PREFIX            0x0b
26
#define AML_DWORD_PREFIX             0x0c
26
#define AML_DWORD_PREFIX           0x0c
27
#define AML_STRING_PREFIX            0x0d
27
#define AML_STRING_PREFIX          0x0d
28
#define AML_QWORD_PREFIX             0x0e
28
#define AML_QWORD_PREFIX           0x0e
29
#define AML_SCOPE_OP                 0x10
29
#define AML_SCOPE_OP               0x10
30
#define AML_BUFFER_OP                0x11
30
#define AML_BUFFER_OP              0x11
31
#define AML_PACKAGE_OP               0x12
31
#define AML_PACKAGE_OP             0x12
32
#define AML_VAR_PACKAGE_OP           0x13
32
#define AML_VAR_PACKAGE_OP         0x13
33
#define AML_METHOD_OP                0x14
33
#define AML_METHOD_OP              0x14
34
#define AML_EXTERNAL_OP              0x15
34
#define AML_EXTERNAL_OP            0x15
35
#define AML_DUAL_NAME_PREFIX         0x2e
35
#define AML_DUAL_NAME_PREFIX       0x2e
36
#define AML_MULTI_NAME_PREFIX        0x2f
36
#define AML_MULTI_NAME_PREFIX      0x2f
37
#define AML_NAME_CHAR_A              0x41
37
#define AML_NAME_CHAR_A            0x41
38
#define AML_NAME_CHAR_B              0x42
38
#define AML_NAME_CHAR_B            0x42
39
#define AML_NAME_CHAR_C              0x43
39
#define AML_NAME_CHAR_C            0x43
40
#define AML_NAME_CHAR_D              0x44
40
#define AML_NAME_CHAR_D            0x44
41
#define AML_NAME_CHAR_E              0x45
41
#define AML_NAME_CHAR_E            0x45
42
#define AML_NAME_CHAR_F              0x46
42
#define AML_NAME_CHAR_F            0x46
43
#define AML_NAME_CHAR_G              0x47
43
#define AML_NAME_CHAR_G            0x47
44
#define AML_NAME_CHAR_H              0x48
44
#define AML_NAME_CHAR_H            0x48
45
#define AML_NAME_CHAR_I              0x49
45
#define AML_NAME_CHAR_I            0x49
46
#define AML_NAME_CHAR_J              0x4a
46
#define AML_NAME_CHAR_J            0x4a
47
#define AML_NAME_CHAR_K              0x4b
47
#define AML_NAME_CHAR_K            0x4b
48
#define AML_NAME_CHAR_L              0x4c
48
#define AML_NAME_CHAR_L            0x4c
49
#define AML_NAME_CHAR_M              0x4d
49
#define AML_NAME_CHAR_M            0x4d
50
#define AML_NAME_CHAR_N              0x4e
50
#define AML_NAME_CHAR_N            0x4e
51
#define AML_NAME_CHAR_O              0x4f
51
#define AML_NAME_CHAR_O            0x4f
52
#define AML_NAME_CHAR_P              0x50
52
#define AML_NAME_CHAR_P            0x50
53
#define AML_NAME_CHAR_Q              0x51
53
#define AML_NAME_CHAR_Q            0x51
54
#define AML_NAME_CHAR_R              0x52
54
#define AML_NAME_CHAR_R            0x52
55
#define AML_NAME_CHAR_S              0x53
55
#define AML_NAME_CHAR_S            0x53
56
#define AML_NAME_CHAR_T              0x54
56
#define AML_NAME_CHAR_T            0x54
57
#define AML_NAME_CHAR_U              0x55
57
#define AML_NAME_CHAR_U            0x55
58
#define AML_NAME_CHAR_V              0x56
58
#define AML_NAME_CHAR_V            0x56
59
#define AML_NAME_CHAR_W              0x57
59
#define AML_NAME_CHAR_W            0x57
60
#define AML_NAME_CHAR_X              0x58
60
#define AML_NAME_CHAR_X            0x58
61
#define AML_NAME_CHAR_Y              0x59
61
#define AML_NAME_CHAR_Y            0x59
62
#define AML_NAME_CHAR_Z              0x5a
62
#define AML_NAME_CHAR_Z            0x5a
63
#define AML_ROOT_CHAR                0x5c
63
#define AML_ROOT_CHAR              0x5c
64
#define AML_PARENT_PREFIX_CHAR       0x5e
64
#define AML_PARENT_PREFIX_CHAR     0x5e
65
#define AML_NAME_CHAR__              0x5f
65
#define AML_NAME_CHAR__            0x5f
66
#define AML_LOCAL0                   0x60
66
#define AML_LOCAL0                 0x60
67
#define AML_LOCAL1                   0x61
67
#define AML_LOCAL1                 0x61
68
#define AML_LOCAL2                   0x62
68
#define AML_LOCAL2                 0x62
69
#define AML_LOCAL3                   0x63
69
#define AML_LOCAL3                 0x63
70
#define AML_LOCAL4                   0x64
70
#define AML_LOCAL4                 0x64
71
#define AML_LOCAL5                   0x65
71
#define AML_LOCAL5                 0x65
72
#define AML_LOCAL6                   0x66
72
#define AML_LOCAL6                 0x66
73
#define AML_LOCAL7                   0x67
73
#define AML_LOCAL7                 0x67
74
#define AML_ARG0                     0x68
74
#define AML_ARG0                   0x68
75
#define AML_ARG1                     0x69
75
#define AML_ARG1                   0x69
76
#define AML_ARG2                     0x6a
76
#define AML_ARG2                   0x6a
77
#define AML_ARG3                     0x6b
77
#define AML_ARG3                   0x6b
78
#define AML_ARG4                     0x6c
78
#define AML_ARG4                   0x6c
79
#define AML_ARG5                     0x6d
79
#define AML_ARG5                   0x6d
80
#define AML_ARG6                     0x6e
80
#define AML_ARG6                   0x6e
81
#define AML_STORE_OP                 0x70
81
#define AML_STORE_OP               0x70
82
#define AML_REF_OF_OP                0x71
82
#define AML_REF_OF_OP              0x71
83
#define AML_ADD_OP                   0x72
83
#define AML_ADD_OP                 0x72
84
#define AML_CONCAT_OP                0x73
84
#define AML_CONCAT_OP              0x73
85
#define AML_SUBTRACT_OP              0x74
85
#define AML_SUBTRACT_OP            0x74
86
#define AML_INCREMENT_OP             0x75
86
#define AML_INCREMENT_OP           0x75
87
#define AML_DECREMENT_OP             0x76
87
#define AML_DECREMENT_OP           0x76
88
#define AML_MULTIPLY_OP              0x77
88
#define AML_MULTIPLY_OP            0x77
89
#define AML_DIVIDE_OP                0x78
89
#define AML_DIVIDE_OP              0x78
90
#define AML_SHIFT_LEFT_OP            0x79
90
#define AML_SHIFT_LEFT_OP          0x79
91
#define AML_SHIFT_RIGHT_OP           0x7a
91
#define AML_SHIFT_RIGHT_OP         0x7a
92
#define AML_AND_OP                   0x7b
92
#define AML_AND_OP                 0x7b
93
#define AML_NAND_OP                  0x7c
93
#define AML_NAND_OP                0x7c
94
#define AML_OR_OP                    0x7d
94
#define AML_OR_OP                  0x7d
95
#define AML_NOR_OP                   0x7e
95
#define AML_NOR_OP                 0x7e
96
#define AML_XOR_OP                   0x7f
96
#define AML_XOR_OP                 0x7f
97
#define AML_NOT_OP                   0x80
97
#define AML_NOT_OP                 0x80
98
#define AML_FIND_SET_LEFT_BIT_OP     0x81
98
#define AML_FIND_SET_LEFT_BIT_OP   0x81
99
#define AML_FIND_SET_RIGHT_BIT_OP    0x82
99
#define AML_FIND_SET_RIGHT_BIT_OP  0x82
100
#define AML_DEREF_OF_OP              0x83
100
#define AML_DEREF_OF_OP            0x83
101
#define AML_CONCAT_RES_OP            0x84
101
#define AML_CONCAT_RES_OP          0x84
102
#define AML_MOD_OP                   0x85
102
#define AML_MOD_OP                 0x85
103
#define AML_NOTIFY_OP                0x86
103
#define AML_NOTIFY_OP              0x86
104
#define AML_SIZE_OF_OP               0x87
104
#define AML_SIZE_OF_OP             0x87
105
#define AML_INDEX_OP                 0x88
105
#define AML_INDEX_OP               0x88
106
#define AML_MATCH_OP                 0x89
106
#define AML_MATCH_OP               0x89
107
#define AML_CREATE_DWORD_FIELD_OP    0x8a
107
#define AML_CREATE_DWORD_FIELD_OP  0x8a
108
#define AML_CREATE_WORD_FIELD_OP     0x8b
108
#define AML_CREATE_WORD_FIELD_OP   0x8b
109
#define AML_CREATE_BYTE_FIELD_OP     0x8c
109
#define AML_CREATE_BYTE_FIELD_OP   0x8c
110
#define AML_CREATE_BIT_FIELD_OP      0x8d
110
#define AML_CREATE_BIT_FIELD_OP    0x8d
111
#define AML_OBJECT_TYPE_OP           0x8e
111
#define AML_OBJECT_TYPE_OP         0x8e
112
#define AML_CREATE_QWORD_FIELD_OP    0x8f
112
#define AML_CREATE_QWORD_FIELD_OP  0x8f
113
#define AML_LAND_OP                  0x90
113
#define AML_LAND_OP                0x90
114
#define AML_LOR_OP                   0x91
114
#define AML_LOR_OP                 0x91
115
#define AML_LNOT_OP                  0x92
115
#define AML_LNOT_OP                0x92
116
#define AML_LEQUAL_OP                0x93
116
#define AML_LEQUAL_OP              0x93
117
#define AML_LGREATER_OP              0x94
117
#define AML_LGREATER_OP            0x94
118
#define AML_LLESS_OP                 0x95
118
#define AML_LLESS_OP               0x95
119
#define AML_TO_BUFFER_OP             0x96
119
#define AML_TO_BUFFER_OP           0x96
120
#define AML_TO_DEC_STRING_OP         0x97
120
#define AML_TO_DEC_STRING_OP       0x97
121
#define AML_TO_HEX_STRING_OP         0x98
121
#define AML_TO_HEX_STRING_OP       0x98
122
#define AML_TO_INTEGER_OP            0x99
122
#define AML_TO_INTEGER_OP          0x99
123
#define AML_TO_STRING_OP             0x9c
123
#define AML_TO_STRING_OP           0x9c
124
#define AML_COPY_OBJECT_OP           0x9d
124
#define AML_COPY_OBJECT_OP         0x9d
125
#define AML_MID_OP                   0x9e
125
#define AML_MID_OP                 0x9e
126
#define AML_CONTINUE_OP              0x9f
126
#define AML_CONTINUE_OP            0x9f
127
#define AML_IF_OP                    0xa0
127
#define AML_IF_OP                  0xa0
128
#define AML_ELSE_OP                  0xa1
128
#define AML_ELSE_OP                0xa1
129
#define AML_WHILE_OP                 0xa2
129
#define AML_WHILE_OP               0xa2
130
#define AML_NOOP_OP                  0xa3
130
#define AML_NOOP_OP                0xa3
131
#define AML_RETURN_OP                0xa4
131
#define AML_RETURN_OP              0xa4
132
#define AML_BREAK_OP                 0xa5
132
#define AML_BREAK_OP               0xa5
133
#define AML_BREAK_POINT_OP           0xcc
133
#define AML_BREAK_POINT_OP         0xcc
134
#define AML_ONES_OP                  0xff
134
#define AML_ONES_OP                0xff
135
135
136
//
136
//
137
// Extended OpCode
137
// Extended OpCode
138
//
138
//
139
#define AML_EXT_OP                   0x5b
139
#define AML_EXT_OP  0x5b
140
140
141
#define AML_EXT_MUTEX_OP             0x01
141
#define AML_EXT_MUTEX_OP         0x01
142
#define AML_EXT_EVENT_OP             0x02
142
#define AML_EXT_EVENT_OP         0x02
143
#define AML_EXT_COND_REF_OF_OP       0x12
143
#define AML_EXT_COND_REF_OF_OP   0x12
144
#define AML_EXT_CREATE_FIELD_OP      0x13
144
#define AML_EXT_CREATE_FIELD_OP  0x13
145
#define AML_EXT_LOAD_TABLE_OP        0x1f
145
#define AML_EXT_LOAD_TABLE_OP    0x1f
146
#define AML_EXT_LOAD_OP              0x20
146
#define AML_EXT_LOAD_OP          0x20
147
#define AML_EXT_STALL_OP             0x21
147
#define AML_EXT_STALL_OP         0x21
148
#define AML_EXT_SLEEP_OP             0x22
148
#define AML_EXT_SLEEP_OP         0x22
149
#define AML_EXT_ACQUIRE_OP           0x23
149
#define AML_EXT_ACQUIRE_OP       0x23
150
#define AML_EXT_SIGNAL_OP            0x24
150
#define AML_EXT_SIGNAL_OP        0x24
151
#define AML_EXT_WAIT_OP              0x25
151
#define AML_EXT_WAIT_OP          0x25
152
#define AML_EXT_RESET_OP             0x26
152
#define AML_EXT_RESET_OP         0x26
153
#define AML_EXT_RELEASE_OP           0x27
153
#define AML_EXT_RELEASE_OP       0x27
154
#define AML_EXT_FROM_BCD_OP          0x28
154
#define AML_EXT_FROM_BCD_OP      0x28
155
#define AML_EXT_TO_BCD_OP            0x29
155
#define AML_EXT_TO_BCD_OP        0x29
156
#define AML_EXT_UNLOAD_OP            0x2a
156
#define AML_EXT_UNLOAD_OP        0x2a
157
#define AML_EXT_REVISION_OP          0x30
157
#define AML_EXT_REVISION_OP      0x30
158
#define AML_EXT_DEBUG_OP             0x31
158
#define AML_EXT_DEBUG_OP         0x31
159
#define AML_EXT_FATAL_OP             0x32
159
#define AML_EXT_FATAL_OP         0x32
160
#define AML_EXT_TIMER_OP             0x33
160
#define AML_EXT_TIMER_OP         0x33
161
#define AML_EXT_REGION_OP            0x80
161
#define AML_EXT_REGION_OP        0x80
162
#define AML_EXT_FIELD_OP             0x81
162
#define AML_EXT_FIELD_OP         0x81
163
#define AML_EXT_DEVICE_OP            0x82
163
#define AML_EXT_DEVICE_OP        0x82
164
#define AML_EXT_PROCESSOR_OP         0x83
164
#define AML_EXT_PROCESSOR_OP     0x83
165
#define AML_EXT_POWER_RES_OP         0x84
165
#define AML_EXT_POWER_RES_OP     0x84
166
#define AML_EXT_THERMAL_ZONE_OP      0x85
166
#define AML_EXT_THERMAL_ZONE_OP  0x85
167
#define AML_EXT_INDEX_FIELD_OP       0x86
167
#define AML_EXT_INDEX_FIELD_OP   0x86
168
#define AML_EXT_BANK_FIELD_OP        0x87
168
#define AML_EXT_BANK_FIELD_OP    0x87
169
#define AML_EXT_DATA_REGION_OP       0x88
169
#define AML_EXT_DATA_REGION_OP   0x88
170
170
171
//
171
//
172
// FieldElement OpCode
172
// FieldElement OpCode
173
//
173
//
174
#define AML_FIELD_RESERVED_OP        0x00
174
#define AML_FIELD_RESERVED_OP    0x00
175
#define AML_FIELD_ACCESS_OP          0x01
175
#define AML_FIELD_ACCESS_OP      0x01
176
#define AML_FIELD_CONNECTION_OP      0x02
176
#define AML_FIELD_CONNECTION_OP  0x02
177
#define AML_FIELD_EXT_ACCESS_OP      0x03
177
#define AML_FIELD_EXT_ACCESS_OP  0x03
178
179
//
180
// AML Name segment definitions
181
//
182
#define AML_NAME_SEG_SIZE  4
178
183
179
#endif
184
#endif
(-)b/sys/contrib/edk2/Include/IndustryStandard/Bluetooth.h (-9 / +9 lines)
Lines 19-35 typedef struct { Link Here
19
  ///
19
  ///
20
  /// 48bit Bluetooth device address.
20
  /// 48bit Bluetooth device address.
21
  ///
21
  ///
22
  UINT8      Address[6];
22
  UINT8    Address[6];
23
} BLUETOOTH_ADDRESS;
23
} BLUETOOTH_ADDRESS;
24
24
25
///
25
///
26
/// BLUETOOTH_CLASS_OF_DEVICE. See Bluetooth specification for detail.
26
/// BLUETOOTH_CLASS_OF_DEVICE. See Bluetooth specification for detail.
27
///
27
///
28
typedef struct {
28
typedef struct {
29
  UINT8      FormatType:2;
29
  UINT8     FormatType        : 2;
30
  UINT8      MinorDeviceClass: 6;
30
  UINT8     MinorDeviceClass  : 6;
31
  UINT16     MajorDeviceClass: 5;
31
  UINT16    MajorDeviceClass  : 5;
32
  UINT16     MajorServiceClass:11;
32
  UINT16    MajorServiceClass : 11;
33
} BLUETOOTH_CLASS_OF_DEVICE;
33
} BLUETOOTH_CLASS_OF_DEVICE;
34
34
35
///
35
///
Lines 39-56 typedef struct { Link Here
39
  ///
39
  ///
40
  /// 48-bit Bluetooth device address
40
  /// 48-bit Bluetooth device address
41
  ///
41
  ///
42
  UINT8      Address[6];
42
  UINT8    Address[6];
43
  ///
43
  ///
44
  /// 0x00 - Public Device Address
44
  /// 0x00 - Public Device Address
45
  /// 0x01 - Random Device Address
45
  /// 0x01 - Random Device Address
46
  ///
46
  ///
47
  UINT8      Type;
47
  UINT8    Type;
48
} BLUETOOTH_LE_ADDRESS;
48
} BLUETOOTH_LE_ADDRESS;
49
49
50
#pragma pack()
50
#pragma pack()
51
51
52
#define BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE    248
52
#define BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE  248
53
53
54
#define BLUETOOTH_HCI_LINK_KEY_SIZE                           16
54
#define BLUETOOTH_HCI_LINK_KEY_SIZE  16
55
55
56
#endif
56
#endif
(-)b/sys/contrib/edk2/Include/IndustryStandard/PeImage.h (+816 lines)
Added Link Here
1
/** @file
2
  EFI image format for PE32, PE32+ and TE. Please note some data structures are
3
  different for PE32 and PE32+. EFI_IMAGE_NT_HEADERS32 is for PE32 and
4
  EFI_IMAGE_NT_HEADERS64 is for PE32+.
5
6
  This file is coded to the Visual Studio, Microsoft Portable Executable and
7
  Common Object File Format Specification, Revision 9.3 - December 29, 2015.
8
  This file also includes some definitions in PI Specification, Revision 1.0.
9
10
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
12
Portions Copyright (c) 2016 - 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
13
Portions Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
14
15
SPDX-License-Identifier: BSD-2-Clause-Patent
16
17
**/
18
19
#ifndef __PE_IMAGE_H__
20
#define __PE_IMAGE_H__
21
22
//
23
// PE32+ Subsystem type for EFI images
24
//
25
#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION          10
26
#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER  11
27
#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER       12
28
#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER       13///< defined PI Specification, 1.0
29
30
//
31
// PE32+ Machine type for EFI images
32
//
33
#define IMAGE_FILE_MACHINE_I386            0x014c
34
#define IMAGE_FILE_MACHINE_IA64            0x0200
35
#define IMAGE_FILE_MACHINE_EBC             0x0EBC
36
#define IMAGE_FILE_MACHINE_X64             0x8664
37
#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED  0x01c2
38
#define IMAGE_FILE_MACHINE_ARM64           0xAA64
39
#define IMAGE_FILE_MACHINE_RISCV32         0x5032
40
#define IMAGE_FILE_MACHINE_RISCV64         0x5064
41
#define IMAGE_FILE_MACHINE_RISCV128        0x5128
42
#define IMAGE_FILE_MACHINE_LOONGARCH32     0x6232
43
#define IMAGE_FILE_MACHINE_LOONGARCH64     0x6264
44
45
//
46
// EXE file formats
47
//
48
#define EFI_IMAGE_DOS_SIGNATURE     SIGNATURE_16('M', 'Z')
49
#define EFI_IMAGE_OS2_SIGNATURE     SIGNATURE_16('N', 'E')
50
#define EFI_IMAGE_OS2_SIGNATURE_LE  SIGNATURE_16('L', 'E')
51
#define EFI_IMAGE_NT_SIGNATURE      SIGNATURE_32('P', 'E', '\0', '\0')
52
53
///
54
/// PE images can start with an optional DOS header, so if an image is run
55
/// under DOS it can print an error message.
56
///
57
typedef struct {
58
  UINT16    e_magic;    ///< Magic number.
59
  UINT16    e_cblp;     ///< Bytes on last page of file.
60
  UINT16    e_cp;       ///< Pages in file.
61
  UINT16    e_crlc;     ///< Relocations.
62
  UINT16    e_cparhdr;  ///< Size of header in paragraphs.
63
  UINT16    e_minalloc; ///< Minimum extra paragraphs needed.
64
  UINT16    e_maxalloc; ///< Maximum extra paragraphs needed.
65
  UINT16    e_ss;       ///< Initial (relative) SS value.
66
  UINT16    e_sp;       ///< Initial SP value.
67
  UINT16    e_csum;     ///< Checksum.
68
  UINT16    e_ip;       ///< Initial IP value.
69
  UINT16    e_cs;       ///< Initial (relative) CS value.
70
  UINT16    e_lfarlc;   ///< File address of relocation table.
71
  UINT16    e_ovno;     ///< Overlay number.
72
  UINT16    e_res[4];   ///< Reserved words.
73
  UINT16    e_oemid;    ///< OEM identifier (for e_oeminfo).
74
  UINT16    e_oeminfo;  ///< OEM information; e_oemid specific.
75
  UINT16    e_res2[10]; ///< Reserved words.
76
  UINT32    e_lfanew;   ///< File address of new exe header.
77
} EFI_IMAGE_DOS_HEADER;
78
79
///
80
/// COFF File Header (Object and Image).
81
///
82
typedef struct {
83
  UINT16    Machine;
84
  UINT16    NumberOfSections;
85
  UINT32    TimeDateStamp;
86
  UINT32    PointerToSymbolTable;
87
  UINT32    NumberOfSymbols;
88
  UINT16    SizeOfOptionalHeader;
89
  UINT16    Characteristics;
90
} EFI_IMAGE_FILE_HEADER;
91
92
///
93
/// Size of EFI_IMAGE_FILE_HEADER.
94
///
95
#define EFI_IMAGE_SIZEOF_FILE_HEADER  20
96
97
//
98
// Characteristics
99
//
100
#define EFI_IMAGE_FILE_RELOCS_STRIPPED      BIT0     ///< 0x0001  Relocation info stripped from file.
101
#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE     BIT1     ///< 0x0002  File is executable  (i.e. no unresolved externel references).
102
#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED   BIT2     ///< 0x0004  Line numbers stripped from file.
103
#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED  BIT3     ///< 0x0008  Local symbols stripped from file.
104
#define EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE  BIT5     ///< 0x0020  Supports addresses > 2-GB
105
#define EFI_IMAGE_FILE_BYTES_REVERSED_LO    BIT7     ///< 0x0080  Bytes of machine word are reversed.
106
#define EFI_IMAGE_FILE_32BIT_MACHINE        BIT8     ///< 0x0100  32 bit word machine.
107
#define EFI_IMAGE_FILE_DEBUG_STRIPPED       BIT9     ///< 0x0200  Debugging info stripped from file in .DBG file.
108
#define EFI_IMAGE_FILE_SYSTEM               BIT12    ///< 0x1000  System File.
109
#define EFI_IMAGE_FILE_DLL                  BIT13    ///< 0x2000  File is a DLL.
110
#define EFI_IMAGE_FILE_BYTES_REVERSED_HI    BIT15    ///< 0x8000  Bytes of machine word are reversed.
111
112
///
113
/// Header Data Directories.
114
///
115
typedef struct {
116
  UINT32    VirtualAddress;
117
  UINT32    Size;
118
} EFI_IMAGE_DATA_DIRECTORY;
119
120
//
121
// Directory Entries
122
//
123
#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT       0
124
#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT       1
125
#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE     2
126
#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION    3
127
#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY     4
128
#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC    5
129
#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG        6
130
#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT    7
131
#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR    8
132
#define EFI_IMAGE_DIRECTORY_ENTRY_TLS          9
133
#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG  10
134
135
#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES  16
136
137
///
138
/// @attention
139
/// EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC means PE32 and
140
/// EFI_IMAGE_OPTIONAL_HEADER32 must be used. The data structures only vary
141
/// after NT additional fields.
142
///
143
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC  0x10b
144
145
///
146
/// Optional Header Standard Fields for PE32.
147
///
148
typedef struct {
149
  ///
150
  /// Standard fields.
151
  ///
152
  UINT16                      Magic;
153
  UINT8                       MajorLinkerVersion;
154
  UINT8                       MinorLinkerVersion;
155
  UINT32                      SizeOfCode;
156
  UINT32                      SizeOfInitializedData;
157
  UINT32                      SizeOfUninitializedData;
158
  UINT32                      AddressOfEntryPoint;
159
  UINT32                      BaseOfCode;
160
  UINT32                      BaseOfData; ///< PE32 contains this additional field, which is absent in PE32+.
161
  ///
162
  /// Optional Header Windows-Specific Fields.
163
  ///
164
  UINT32                      ImageBase;
165
  UINT32                      SectionAlignment;
166
  UINT32                      FileAlignment;
167
  UINT16                      MajorOperatingSystemVersion;
168
  UINT16                      MinorOperatingSystemVersion;
169
  UINT16                      MajorImageVersion;
170
  UINT16                      MinorImageVersion;
171
  UINT16                      MajorSubsystemVersion;
172
  UINT16                      MinorSubsystemVersion;
173
  UINT32                      Win32VersionValue;
174
  UINT32                      SizeOfImage;
175
  UINT32                      SizeOfHeaders;
176
  UINT32                      CheckSum;
177
  UINT16                      Subsystem;
178
  UINT16                      DllCharacteristics;
179
  UINT32                      SizeOfStackReserve;
180
  UINT32                      SizeOfStackCommit;
181
  UINT32                      SizeOfHeapReserve;
182
  UINT32                      SizeOfHeapCommit;
183
  UINT32                      LoaderFlags;
184
  UINT32                      NumberOfRvaAndSizes;
185
  EFI_IMAGE_DATA_DIRECTORY    DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
186
} EFI_IMAGE_OPTIONAL_HEADER32;
187
188
///
189
/// @attention
190
/// EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC means PE32+ and
191
/// EFI_IMAGE_OPTIONAL_HEADER64 must be used. The data structures only vary
192
/// after NT additional fields.
193
///
194
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC  0x20b
195
196
///
197
/// Optional Header Standard Fields for PE32+.
198
///
199
typedef struct {
200
  ///
201
  /// Standard fields.
202
  ///
203
  UINT16                      Magic;
204
  UINT8                       MajorLinkerVersion;
205
  UINT8                       MinorLinkerVersion;
206
  UINT32                      SizeOfCode;
207
  UINT32                      SizeOfInitializedData;
208
  UINT32                      SizeOfUninitializedData;
209
  UINT32                      AddressOfEntryPoint;
210
  UINT32                      BaseOfCode;
211
  ///
212
  /// Optional Header Windows-Specific Fields.
213
  ///
214
  UINT64                      ImageBase;
215
  UINT32                      SectionAlignment;
216
  UINT32                      FileAlignment;
217
  UINT16                      MajorOperatingSystemVersion;
218
  UINT16                      MinorOperatingSystemVersion;
219
  UINT16                      MajorImageVersion;
220
  UINT16                      MinorImageVersion;
221
  UINT16                      MajorSubsystemVersion;
222
  UINT16                      MinorSubsystemVersion;
223
  UINT32                      Win32VersionValue;
224
  UINT32                      SizeOfImage;
225
  UINT32                      SizeOfHeaders;
226
  UINT32                      CheckSum;
227
  UINT16                      Subsystem;
228
  UINT16                      DllCharacteristics;
229
  UINT64                      SizeOfStackReserve;
230
  UINT64                      SizeOfStackCommit;
231
  UINT64                      SizeOfHeapReserve;
232
  UINT64                      SizeOfHeapCommit;
233
  UINT32                      LoaderFlags;
234
  UINT32                      NumberOfRvaAndSizes;
235
  EFI_IMAGE_DATA_DIRECTORY    DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
236
} EFI_IMAGE_OPTIONAL_HEADER64;
237
238
///
239
/// @attention
240
/// EFI_IMAGE_NT_HEADERS32 is for use ONLY by tools.
241
///
242
typedef struct {
243
  UINT32                         Signature;
244
  EFI_IMAGE_FILE_HEADER          FileHeader;
245
  EFI_IMAGE_OPTIONAL_HEADER32    OptionalHeader;
246
} EFI_IMAGE_NT_HEADERS32;
247
248
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER  sizeof (EFI_IMAGE_NT_HEADERS32)
249
250
///
251
/// @attention
252
/// EFI_IMAGE_HEADERS64 is for use ONLY by tools.
253
///
254
typedef struct {
255
  UINT32                         Signature;
256
  EFI_IMAGE_FILE_HEADER          FileHeader;
257
  EFI_IMAGE_OPTIONAL_HEADER64    OptionalHeader;
258
} EFI_IMAGE_NT_HEADERS64;
259
260
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER  sizeof (EFI_IMAGE_NT_HEADERS64)
261
262
//
263
// Other Windows Subsystem Values
264
//
265
#define EFI_IMAGE_SUBSYSTEM_UNKNOWN      0
266
#define EFI_IMAGE_SUBSYSTEM_NATIVE       1
267
#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI  2
268
#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI  3
269
#define EFI_IMAGE_SUBSYSTEM_OS2_CUI      5
270
#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI    7
271
272
//
273
// DLL Characteristics
274
//
275
#define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA        0x0020
276
#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE           0x0040
277
#define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY        0x0080
278
#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT              0x0100
279
#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION           0x0200
280
#define IMAGE_DLLCHARACTERISTICS_NO_SEH                 0x0400
281
#define IMAGE_DLLCHARACTERISTICS_NO_BIND                0x0800
282
#define IMAGE_DLLCHARACTERISTICS_APPCONTAINER           0x1000
283
#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER             0x2000
284
#define IMAGE_DLLCHARACTERISTICS_GUARD_CF               0x4000
285
#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE  0x8000
286
287
///
288
/// Length of ShortName.
289
///
290
#define EFI_IMAGE_SIZEOF_SHORT_NAME  8
291
292
///
293
/// Section Table. This table immediately follows the optional header.
294
///
295
typedef struct {
296
  UINT8     Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
297
  union {
298
    UINT32    PhysicalAddress;
299
    UINT32    VirtualSize;
300
  } Misc;
301
  UINT32    VirtualAddress;
302
  UINT32    SizeOfRawData;
303
  UINT32    PointerToRawData;
304
  UINT32    PointerToRelocations;
305
  UINT32    PointerToLinenumbers;
306
  UINT16    NumberOfRelocations;
307
  UINT16    NumberOfLinenumbers;
308
  UINT32    Characteristics;
309
} EFI_IMAGE_SECTION_HEADER;
310
311
///
312
/// Size of EFI_IMAGE_SECTION_HEADER.
313
///
314
#define EFI_IMAGE_SIZEOF_SECTION_HEADER  40
315
316
//
317
// Section Flags Values
318
//
319
#define EFI_IMAGE_SCN_TYPE_NO_PAD             BIT3        ///< 0x00000008  ///< Reserved.
320
#define EFI_IMAGE_SCN_CNT_CODE                BIT5        ///< 0x00000020
321
#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA    BIT6        ///< 0x00000040
322
#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA  BIT7        ///< 0x00000080
323
324
#define EFI_IMAGE_SCN_LNK_OTHER   BIT8                    ///< 0x00000100  ///< Reserved.
325
#define EFI_IMAGE_SCN_LNK_INFO    BIT9                    ///< 0x00000200  ///< Section contains comments or some other type of information.
326
#define EFI_IMAGE_SCN_LNK_REMOVE  BIT11                   ///< 0x00000800  ///< Section contents will not become part of image.
327
#define EFI_IMAGE_SCN_LNK_COMDAT  BIT12                   ///< 0x00001000
328
329
#define EFI_IMAGE_SCN_ALIGN_1BYTES   BIT20                ///< 0x00100000
330
#define EFI_IMAGE_SCN_ALIGN_2BYTES   BIT21                ///< 0x00200000
331
#define EFI_IMAGE_SCN_ALIGN_4BYTES   (BIT20|BIT21)        ///< 0x00300000
332
#define EFI_IMAGE_SCN_ALIGN_8BYTES   BIT22                ///< 0x00400000
333
#define EFI_IMAGE_SCN_ALIGN_16BYTES  (BIT20|BIT22)        ///< 0x00500000
334
#define EFI_IMAGE_SCN_ALIGN_32BYTES  (BIT21|BIT22)        ///< 0x00600000
335
#define EFI_IMAGE_SCN_ALIGN_64BYTES  (BIT20|BIT21|BIT22)  ///< 0x00700000
336
337
#define EFI_IMAGE_SCN_MEM_DISCARDABLE  BIT25              ///< 0x02000000
338
#define EFI_IMAGE_SCN_MEM_NOT_CACHED   BIT26              ///< 0x04000000
339
#define EFI_IMAGE_SCN_MEM_NOT_PAGED    BIT27              ///< 0x08000000
340
#define EFI_IMAGE_SCN_MEM_SHARED       BIT28              ///< 0x10000000
341
#define EFI_IMAGE_SCN_MEM_EXECUTE      BIT29              ///< 0x20000000
342
#define EFI_IMAGE_SCN_MEM_READ         BIT30              ///< 0x40000000
343
#define EFI_IMAGE_SCN_MEM_WRITE        BIT31              ///< 0x80000000
344
345
///
346
/// Size of a Symbol Table Record.
347
///
348
#define EFI_IMAGE_SIZEOF_SYMBOL  18
349
350
//
351
// Symbols have a section number of the section in which they are
352
// defined. Otherwise, section numbers have the following meanings:
353
//
354
#define EFI_IMAGE_SYM_UNDEFINED  (UINT16) 0  ///< Symbol is undefined or is common.
355
#define EFI_IMAGE_SYM_ABSOLUTE   (UINT16) -1 ///< Symbol is an absolute value.
356
#define EFI_IMAGE_SYM_DEBUG      (UINT16) -2 ///< Symbol is a special debug item.
357
358
//
359
// Symbol Type (fundamental) values.
360
//
361
#define EFI_IMAGE_SYM_TYPE_NULL    0  ///< no type.
362
#define EFI_IMAGE_SYM_TYPE_VOID    1  ///< no valid type.
363
#define EFI_IMAGE_SYM_TYPE_CHAR    2  ///< type character.
364
#define EFI_IMAGE_SYM_TYPE_SHORT   3  ///< type short integer.
365
#define EFI_IMAGE_SYM_TYPE_INT     4
366
#define EFI_IMAGE_SYM_TYPE_LONG    5
367
#define EFI_IMAGE_SYM_TYPE_FLOAT   6
368
#define EFI_IMAGE_SYM_TYPE_DOUBLE  7
369
#define EFI_IMAGE_SYM_TYPE_STRUCT  8
370
#define EFI_IMAGE_SYM_TYPE_UNION   9
371
#define EFI_IMAGE_SYM_TYPE_ENUM    10 ///< enumeration.
372
#define EFI_IMAGE_SYM_TYPE_MOE     11 ///< member of enumeration.
373
#define EFI_IMAGE_SYM_TYPE_BYTE    12
374
#define EFI_IMAGE_SYM_TYPE_WORD    13
375
#define EFI_IMAGE_SYM_TYPE_UINT    14
376
#define EFI_IMAGE_SYM_TYPE_DWORD   15
377
378
//
379
// Symbol Type (derived) values.
380
//
381
#define EFI_IMAGE_SYM_DTYPE_NULL      0 ///< no derived type.
382
#define EFI_IMAGE_SYM_DTYPE_POINTER   1
383
#define EFI_IMAGE_SYM_DTYPE_FUNCTION  2
384
#define EFI_IMAGE_SYM_DTYPE_ARRAY     3
385
386
//
387
// Storage classes.
388
//
389
#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION   ((UINT8) -1)
390
#define EFI_IMAGE_SYM_CLASS_NULL              0
391
#define EFI_IMAGE_SYM_CLASS_AUTOMATIC         1
392
#define EFI_IMAGE_SYM_CLASS_EXTERNAL          2
393
#define EFI_IMAGE_SYM_CLASS_STATIC            3
394
#define EFI_IMAGE_SYM_CLASS_REGISTER          4
395
#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF      5
396
#define EFI_IMAGE_SYM_CLASS_LABEL             6
397
#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL   7
398
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT  8
399
#define EFI_IMAGE_SYM_CLASS_ARGUMENT          9
400
#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG        10
401
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION   11
402
#define EFI_IMAGE_SYM_CLASS_UNION_TAG         12
403
#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION   13
404
#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC  14
405
#define EFI_IMAGE_SYM_CLASS_ENUM_TAG          15
406
#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM    16
407
#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM    17
408
#define EFI_IMAGE_SYM_CLASS_BIT_FIELD         18
409
#define EFI_IMAGE_SYM_CLASS_BLOCK             100
410
#define EFI_IMAGE_SYM_CLASS_FUNCTION          101
411
#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT     102
412
#define EFI_IMAGE_SYM_CLASS_FILE              103
413
#define EFI_IMAGE_SYM_CLASS_SECTION           104
414
#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL     105
415
416
//
417
// type packing constants
418
//
419
#define EFI_IMAGE_N_BTMASK  017
420
#define EFI_IMAGE_N_TMASK   060
421
#define EFI_IMAGE_N_TMASK1  0300
422
#define EFI_IMAGE_N_TMASK2  0360
423
#define EFI_IMAGE_N_BTSHFT  4
424
#define EFI_IMAGE_N_TSHIFT  2
425
426
//
427
// Communal selection types.
428
//
429
#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES  1
430
#define EFI_IMAGE_COMDAT_SELECT_ANY           2
431
#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE     3
432
#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH   4
433
#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE   5
434
435
//
436
// the following values only be referred in PeCoff, not defined in PECOFF.
437
//
438
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY  1
439
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY    2
440
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS      3
441
442
///
443
/// Relocation format.
444
///
445
typedef struct {
446
  UINT32    VirtualAddress;
447
  UINT32    SymbolTableIndex;
448
  UINT16    Type;
449
} EFI_IMAGE_RELOCATION;
450
451
///
452
/// Size of EFI_IMAGE_RELOCATION
453
///
454
#define EFI_IMAGE_SIZEOF_RELOCATION  10
455
456
//
457
// I386 relocation types.
458
//
459
#define EFI_IMAGE_REL_I386_ABSOLUTE  0x0000 ///< Reference is absolute, no relocation is necessary.
460
#define EFI_IMAGE_REL_I386_DIR16     0x0001 ///< Direct 16-bit reference to the symbols virtual address.
461
#define EFI_IMAGE_REL_I386_REL16     0x0002 ///< PC-relative 16-bit reference to the symbols virtual address.
462
#define EFI_IMAGE_REL_I386_DIR32     0x0006 ///< Direct 32-bit reference to the symbols virtual address.
463
#define EFI_IMAGE_REL_I386_DIR32NB   0x0007 ///< Direct 32-bit reference to the symbols virtual address, base not included.
464
#define EFI_IMAGE_REL_I386_SEG12     0x0009 ///< Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address.
465
#define EFI_IMAGE_REL_I386_SECTION   0x000A
466
#define EFI_IMAGE_REL_I386_SECREL    0x000B
467
#define EFI_IMAGE_REL_I386_REL32     0x0014 ///< PC-relative 32-bit reference to the symbols virtual address.
468
469
//
470
// x64 processor relocation types.
471
//
472
#define IMAGE_REL_AMD64_ABSOLUTE  0x0000
473
#define IMAGE_REL_AMD64_ADDR64    0x0001
474
#define IMAGE_REL_AMD64_ADDR32    0x0002
475
#define IMAGE_REL_AMD64_ADDR32NB  0x0003
476
#define IMAGE_REL_AMD64_REL32     0x0004
477
#define IMAGE_REL_AMD64_REL32_1   0x0005
478
#define IMAGE_REL_AMD64_REL32_2   0x0006
479
#define IMAGE_REL_AMD64_REL32_3   0x0007
480
#define IMAGE_REL_AMD64_REL32_4   0x0008
481
#define IMAGE_REL_AMD64_REL32_5   0x0009
482
#define IMAGE_REL_AMD64_SECTION   0x000A
483
#define IMAGE_REL_AMD64_SECREL    0x000B
484
#define IMAGE_REL_AMD64_SECREL7   0x000C
485
#define IMAGE_REL_AMD64_TOKEN     0x000D
486
#define IMAGE_REL_AMD64_SREL32    0x000E
487
#define IMAGE_REL_AMD64_PAIR      0x000F
488
#define IMAGE_REL_AMD64_SSPAN32   0x0010
489
490
///
491
/// Based relocation format.
492
///
493
typedef struct {
494
  UINT32    VirtualAddress;
495
  UINT32    SizeOfBlock;
496
} EFI_IMAGE_BASE_RELOCATION;
497
498
///
499
/// Size of EFI_IMAGE_BASE_RELOCATION.
500
///
501
#define EFI_IMAGE_SIZEOF_BASE_RELOCATION  8
502
503
//
504
// Based relocation types.
505
//
506
#define EFI_IMAGE_REL_BASED_ABSOLUTE        0
507
#define EFI_IMAGE_REL_BASED_HIGH            1
508
#define EFI_IMAGE_REL_BASED_LOW             2
509
#define EFI_IMAGE_REL_BASED_HIGHLOW         3
510
#define EFI_IMAGE_REL_BASED_HIGHADJ         4
511
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR    5
512
#define EFI_IMAGE_REL_BASED_ARM_MOV32A      5
513
#define EFI_IMAGE_REL_BASED_ARM_MOV32T      7
514
#define EFI_IMAGE_REL_BASED_IA64_IMM64      9
515
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16  9
516
#define EFI_IMAGE_REL_BASED_DIR64           10
517
518
///
519
/// Relocation types of RISC-V processor.
520
///
521
#define EFI_IMAGE_REL_BASED_RISCV_HI20    5
522
#define EFI_IMAGE_REL_BASED_RISCV_LOW12I  7
523
#define EFI_IMAGE_REL_BASED_RISCV_LOW12S  8
524
525
//
526
// Relocation types of LoongArch processor.
527
//
528
#define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA  8
529
#define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA  8
530
531
///
532
/// Line number format.
533
///
534
typedef struct {
535
  union {
536
    UINT32    SymbolTableIndex; ///< Symbol table index of function name if Linenumber is 0.
537
    UINT32    VirtualAddress;   ///< Virtual address of line number.
538
  } Type;
539
  UINT16    Linenumber;       ///< Line number.
540
} EFI_IMAGE_LINENUMBER;
541
542
///
543
/// Size of EFI_IMAGE_LINENUMBER.
544
///
545
#define EFI_IMAGE_SIZEOF_LINENUMBER  6
546
547
//
548
// Archive format.
549
//
550
#define EFI_IMAGE_ARCHIVE_START_SIZE        8
551
#define EFI_IMAGE_ARCHIVE_START             "!<arch>\n"
552
#define EFI_IMAGE_ARCHIVE_END               "`\n"
553
#define EFI_IMAGE_ARCHIVE_PAD               "\n"
554
#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER     "/               "
555
#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER  "//              "
556
557
///
558
/// Archive Member Headers
559
///
560
typedef struct {
561
  UINT8    Name[16];     ///< File member name - `/' terminated.
562
  UINT8    Date[12];     ///< File member date - decimal.
563
  UINT8    UserID[6];    ///< File member user id - decimal.
564
  UINT8    GroupID[6];   ///< File member group id - decimal.
565
  UINT8    Mode[8];      ///< File member mode - octal.
566
  UINT8    Size[10];     ///< File member size - decimal.
567
  UINT8    EndHeader[2]; ///< String to end header. (0x60 0x0A).
568
} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
569
570
///
571
/// Size of EFI_IMAGE_ARCHIVE_MEMBER_HEADER.
572
///
573
#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR  60
574
575
//
576
// DLL Support
577
//
578
579
///
580
/// Export Directory Table.
581
///
582
typedef struct {
583
  UINT32    Characteristics;
584
  UINT32    TimeDateStamp;
585
  UINT16    MajorVersion;
586
  UINT16    MinorVersion;
587
  UINT32    Name;
588
  UINT32    Base;
589
  UINT32    NumberOfFunctions;
590
  UINT32    NumberOfNames;
591
  UINT32    AddressOfFunctions;
592
  UINT32    AddressOfNames;
593
  UINT32    AddressOfNameOrdinals;
594
} EFI_IMAGE_EXPORT_DIRECTORY;
595
596
//
597
// Based export types.
598
//
599
#define EFI_IMAGE_EXPORT_ORDINAL_BASE  1
600
#define EFI_IMAGE_EXPORT_ADDR_SIZE     4
601
#define EFI_IMAGE_EXPORT_ORDINAL_SIZE  2
602
603
///
604
/// Hint/Name Table.
605
///
606
typedef struct {
607
  UINT16    Hint;
608
  UINT8     Name[1];
609
} EFI_IMAGE_IMPORT_BY_NAME;
610
611
///
612
/// Import Address Table RVA (Thunk Table).
613
///
614
typedef struct {
615
  union {
616
    UINT32                      Function;
617
    UINT32                      Ordinal;
618
    EFI_IMAGE_IMPORT_BY_NAME    *AddressOfData;
619
  } u1;
620
} EFI_IMAGE_THUNK_DATA;
621
622
#define EFI_IMAGE_ORDINAL_FLAG  BIT31                ///< Flag for PE32.
623
#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal)  ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
624
#define EFI_IMAGE_ORDINAL(Ordinal)          (Ordinal & 0xffff)
625
626
///
627
/// Import Directory Table
628
///
629
typedef struct {
630
  UINT32                  Characteristics;
631
  UINT32                  TimeDateStamp;
632
  UINT32                  ForwarderChain;
633
  UINT32                  Name;
634
  EFI_IMAGE_THUNK_DATA    *FirstThunk;
635
} EFI_IMAGE_IMPORT_DESCRIPTOR;
636
637
///
638
/// Debug Directory Format.
639
///
640
typedef struct {
641
  UINT32    Characteristics;
642
  UINT32    TimeDateStamp;
643
  UINT16    MajorVersion;
644
  UINT16    MinorVersion;
645
  UINT32    Type;
646
  UINT32    SizeOfData;
647
  UINT32    RVA;         ///< The address of the debug data when loaded, relative to the image base.
648
  UINT32    FileOffset;  ///< The file pointer to the debug data.
649
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
650
651
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW               2    ///< The Visual C++ debug information.
652
#define EFI_IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS  20
653
654
///
655
/// Debug Data Structure defined in Microsoft C++.
656
///
657
#define CODEVIEW_SIGNATURE_NB10  SIGNATURE_32('N', 'B', '1', '0')
658
typedef struct {
659
  UINT32    Signature;                      ///< "NB10"
660
  UINT32    Unknown;
661
  UINT32    Unknown2;
662
  UINT32    Unknown3;
663
  //
664
  // Filename of .PDB goes here
665
  //
666
} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
667
668
///
669
/// Debug Data Structure defined in Microsoft C++.
670
///
671
#define CODEVIEW_SIGNATURE_RSDS  SIGNATURE_32('R', 'S', 'D', 'S')
672
typedef struct {
673
  UINT32    Signature;                      ///< "RSDS".
674
  UINT32    Unknown;
675
  UINT32    Unknown2;
676
  UINT32    Unknown3;
677
  UINT32    Unknown4;
678
  UINT32    Unknown5;
679
  //
680
  // Filename of .PDB goes here
681
  //
682
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
683
684
///
685
/// Debug Data Structure defined by Apple Mach-O to Coff utility.
686
///
687
#define CODEVIEW_SIGNATURE_MTOC  SIGNATURE_32('M', 'T', 'O', 'C')
688
typedef struct {
689
  UINT32    Signature;                       ///< "MTOC".
690
  GUID      MachOUuid;
691
  //
692
  //  Filename of .DLL (Mach-O with debug info) goes here
693
  //
694
} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
695
696
//
697
// .pdata entries for X64
698
//
699
typedef struct {
700
  UINT32    FunctionStartAddress;
701
  UINT32    FunctionEndAddress;
702
  UINT32    UnwindInfoAddress;
703
} RUNTIME_FUNCTION;
704
705
typedef struct {
706
  UINT8    Version             : 3;
707
  UINT8    Flags               : 5;
708
  UINT8    SizeOfProlog;
709
  UINT8    CountOfUnwindCodes;
710
  UINT8    FrameRegister       : 4;
711
  UINT8    FrameRegisterOffset : 4;
712
} UNWIND_INFO;
713
714
///
715
/// Extended DLL Characteristics
716
///
717
#define EFI_IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT          0x0001
718
#define EFI_IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT  0x0040
719
720
typedef struct {
721
  UINT32    DllCharacteristicsEx;
722
} EFI_IMAGE_DEBUG_EX_DLLCHARACTERISTICS_ENTRY;
723
724
///
725
/// Resource format.
726
///
727
typedef struct {
728
  UINT32    Characteristics;
729
  UINT32    TimeDateStamp;
730
  UINT16    MajorVersion;
731
  UINT16    MinorVersion;
732
  UINT16    NumberOfNamedEntries;
733
  UINT16    NumberOfIdEntries;
734
  //
735
  // Array of EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY entries goes here.
736
  //
737
} EFI_IMAGE_RESOURCE_DIRECTORY;
738
739
///
740
/// Resource directory entry format.
741
///
742
typedef struct {
743
  union {
744
    struct {
745
      UINT32    NameOffset   : 31;
746
      UINT32    NameIsString : 1;
747
    } s;
748
    UINT32    Id;
749
  } u1;
750
  union {
751
    UINT32    OffsetToData;
752
    struct {
753
      UINT32    OffsetToDirectory : 31;
754
      UINT32    DataIsDirectory   : 1;
755
    } s;
756
  } u2;
757
} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
758
759
///
760
/// Resource directory entry for string.
761
///
762
typedef struct {
763
  UINT16    Length;
764
  CHAR16    String[1];
765
} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
766
767
///
768
/// Resource directory entry for data array.
769
///
770
typedef struct {
771
  UINT32    OffsetToData;
772
  UINT32    Size;
773
  UINT32    CodePage;
774
  UINT32    Reserved;
775
} EFI_IMAGE_RESOURCE_DATA_ENTRY;
776
777
///
778
/// Header format for TE images, defined in the PI Specification, 1.0.
779
///
780
typedef struct {
781
  UINT16                      Signature;           ///< The signature for TE format = "VZ".
782
  UINT16                      Machine;             ///< From the original file header.
783
  UINT8                       NumberOfSections;    ///< From the original file header.
784
  UINT8                       Subsystem;           ///< From original optional header.
785
  UINT16                      StrippedSize;        ///< Number of bytes we removed from the header.
786
  UINT32                      AddressOfEntryPoint; ///< Offset to entry point -- from original optional header.
787
  UINT32                      BaseOfCode;          ///< From original image -- required for ITP debug.
788
  UINT64                      ImageBase;           ///< From original file header.
789
  EFI_IMAGE_DATA_DIRECTORY    DataDirectory[2];    ///< Only base relocation and debug directory.
790
} EFI_TE_IMAGE_HEADER;
791
792
#define EFI_TE_IMAGE_HEADER_SIGNATURE  SIGNATURE_16('V', 'Z')
793
794
//
795
// Data directory indexes in our TE image header
796
//
797
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC  0
798
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG      1
799
800
///
801
/// Union of PE32, PE32+, and TE headers.
802
///
803
typedef union {
804
  EFI_IMAGE_NT_HEADERS32    Pe32;
805
  EFI_IMAGE_NT_HEADERS64    Pe32Plus;
806
  EFI_TE_IMAGE_HEADER       Te;
807
} EFI_IMAGE_OPTIONAL_HEADER_UNION;
808
809
typedef union {
810
  EFI_IMAGE_NT_HEADERS32             *Pe32;
811
  EFI_IMAGE_NT_HEADERS64             *Pe32Plus;
812
  EFI_TE_IMAGE_HEADER                *Te;
813
  EFI_IMAGE_OPTIONAL_HEADER_UNION    *Union;
814
} EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION;
815
816
#endif
(-)b/sys/contrib/edk2/Include/Library/BaseLib.h (-1304 / +1349 lines)
Lines 2-11 Link Here
2
  Provides string functions, linked list functions, math functions, synchronization
2
  Provides string functions, linked list functions, math functions, synchronization
3
  functions, file path functions, and CPU architecture-specific functions.
3
  functions, file path functions, and CPU architecture-specific functions.
4
4
5
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
6
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
6
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
7
Copyright (c) Microsoft Corporation.<BR>
7
Copyright (c) Microsoft Corporation.<BR>
8
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
8
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
9
Portions Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
9
10
10
SPDX-License-Identifier: BSD-2-Clause-Patent
11
SPDX-License-Identifier: BSD-2-Clause-Patent
11
12
Lines 22-37 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
22
/// The IA-32 architecture context buffer used by SetJump() and LongJump().
23
/// The IA-32 architecture context buffer used by SetJump() and LongJump().
23
///
24
///
24
typedef struct {
25
typedef struct {
25
  UINT32                            Ebx;
26
  UINT32    Ebx;
26
  UINT32                            Esi;
27
  UINT32    Esi;
27
  UINT32                            Edi;
28
  UINT32    Edi;
28
  UINT32                            Ebp;
29
  UINT32    Ebp;
29
  UINT32                            Esp;
30
  UINT32    Esp;
30
  UINT32                            Eip;
31
  UINT32    Eip;
31
  UINT32                            Ssp;
32
  UINT32    Ssp;
32
} BASE_LIBRARY_JUMP_BUFFER;
33
} BASE_LIBRARY_JUMP_BUFFER;
33
34
34
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
35
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  4
35
36
36
#endif // defined (MDE_CPU_IA32)
37
#endif // defined (MDE_CPU_IA32)
37
38
Lines 40-61 typedef struct { Link Here
40
/// The x64 architecture context buffer used by SetJump() and LongJump().
41
/// The x64 architecture context buffer used by SetJump() and LongJump().
41
///
42
///
42
typedef struct {
43
typedef struct {
43
  UINT64                            Rbx;
44
  UINT64    Rbx;
44
  UINT64                            Rsp;
45
  UINT64    Rsp;
45
  UINT64                            Rbp;
46
  UINT64    Rbp;
46
  UINT64                            Rdi;
47
  UINT64    Rdi;
47
  UINT64                            Rsi;
48
  UINT64    Rsi;
48
  UINT64                            R12;
49
  UINT64    R12;
49
  UINT64                            R13;
50
  UINT64    R13;
50
  UINT64                            R14;
51
  UINT64    R14;
51
  UINT64                            R15;
52
  UINT64    R15;
52
  UINT64                            Rip;
53
  UINT64    Rip;
53
  UINT64                            MxCsr;
54
  UINT64    MxCsr;
54
  UINT8                             XmmBuffer[160]; ///< XMM6-XMM15.
55
  UINT8     XmmBuffer[160];                         ///< XMM6-XMM15.
55
  UINT64                            Ssp;
56
  UINT64    Ssp;
56
} BASE_LIBRARY_JUMP_BUFFER;
57
} BASE_LIBRARY_JUMP_BUFFER;
57
58
58
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
59
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  8
59
60
60
#endif // defined (MDE_CPU_X64)
61
#endif // defined (MDE_CPU_X64)
61
62
Lines 64-77 typedef struct { Link Here
64
/// The EBC context buffer used by SetJump() and LongJump().
65
/// The EBC context buffer used by SetJump() and LongJump().
65
///
66
///
66
typedef struct {
67
typedef struct {
67
  UINT64                            R0;
68
  UINT64    R0;
68
  UINT64                            R1;
69
  UINT64    R1;
69
  UINT64                            R2;
70
  UINT64    R2;
70
  UINT64                            R3;
71
  UINT64    R3;
71
  UINT64                            IP;
72
  UINT64    IP;
72
} BASE_LIBRARY_JUMP_BUFFER;
73
} BASE_LIBRARY_JUMP_BUFFER;
73
74
74
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
75
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  8
75
76
76
#endif // defined (MDE_CPU_EBC)
77
#endif // defined (MDE_CPU_EBC)
77
78
Lines 91-99 typedef struct { Link Here
91
  UINT32    R14;
92
  UINT32    R14;
92
} BASE_LIBRARY_JUMP_BUFFER;
93
} BASE_LIBRARY_JUMP_BUFFER;
93
94
94
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4
95
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  4
95
96
96
#endif  // defined (MDE_CPU_ARM)
97
#endif // defined (MDE_CPU_ARM)
97
98
98
#if defined (MDE_CPU_AARCH64)
99
#if defined (MDE_CPU_AARCH64)
99
typedef struct {
100
typedef struct {
Lines 123-162 typedef struct { Link Here
123
  UINT64    D15;
124
  UINT64    D15;
124
} BASE_LIBRARY_JUMP_BUFFER;
125
} BASE_LIBRARY_JUMP_BUFFER;
125
126
126
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
127
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  8
127
128
128
#endif  // defined (MDE_CPU_AARCH64)
129
#endif // defined (MDE_CPU_AARCH64)
129
130
130
#if defined (MDE_CPU_RISCV64)
131
#if defined (MDE_CPU_RISCV64)
131
///
132
///
132
/// The RISC-V architecture context buffer used by SetJump() and LongJump().
133
/// The RISC-V architecture context buffer used by SetJump() and LongJump().
133
///
134
///
134
typedef struct {
135
typedef struct {
135
  UINT64                            RA;
136
  UINT64    RA;
136
  UINT64                            S0;
137
  UINT64    S0;
137
  UINT64                            S1;
138
  UINT64    S1;
138
  UINT64                            S2;
139
  UINT64    S2;
139
  UINT64                            S3;
140
  UINT64    S3;
140
  UINT64                            S4;
141
  UINT64    S4;
141
  UINT64                            S5;
142
  UINT64    S5;
142
  UINT64                            S6;
143
  UINT64    S6;
143
  UINT64                            S7;
144
  UINT64    S7;
144
  UINT64                            S8;
145
  UINT64    S8;
145
  UINT64                            S9;
146
  UINT64    S9;
146
  UINT64                            S10;
147
  UINT64    S10;
147
  UINT64                            S11;
148
  UINT64    S11;
148
  UINT64                            SP;
149
  UINT64    SP;
149
} BASE_LIBRARY_JUMP_BUFFER;
150
} BASE_LIBRARY_JUMP_BUFFER;
150
151
151
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
152
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  8
153
154
VOID
155
RiscVSetSupervisorScratch (
156
  IN UINT64
157
  );
158
159
UINT64
160
RiscVGetSupervisorScratch (
161
  VOID
162
  );
163
164
VOID
165
RiscVSetSupervisorStvec (
166
  IN UINT64
167
  );
168
169
UINT64
170
RiscVGetSupervisorStvec (
171
  VOID
172
  );
173
174
UINT64
175
RiscVGetSupervisorTrapCause (
176
  VOID
177
  );
178
179
VOID
180
RiscVSetSupervisorAddressTranslationRegister (
181
  IN UINT64
182
  );
183
184
UINT64
185
RiscVGetSupervisorAddressTranslationRegister (
186
  VOID
187
  );
188
189
UINT64
190
RiscVReadTimer (
191
  VOID
192
  );
193
194
VOID
195
RiscVSetSupervisorTimeCompareRegister (
196
  IN UINT64
197
  );
198
199
VOID
200
RiscVEnableTimerInterrupt (
201
  VOID
202
  );
203
204
VOID
205
RiscVDisableTimerInterrupt (
206
  VOID
207
  );
208
209
VOID
210
RiscVClearPendingTimerInterrupt (
211
  VOID
212
  );
213
214
/**
215
  RISC-V invalidate instruction cache.
216
217
**/
218
VOID
219
EFIAPI
220
RiscVInvalidateInstCacheFenceAsm (
221
  VOID
222
  );
223
224
/**
225
  RISC-V invalidate data cache.
226
227
**/
228
VOID
229
EFIAPI
230
RiscVInvalidateDataCacheFenceAsm (
231
  VOID
232
  );
233
234
/**
235
  RISC-V flush cache block. Atomically perform a clean operation
236
  followed by an invalidate operation
237
238
**/
239
VOID
240
EFIAPI
241
RiscVCpuCacheFlushCmoAsm (
242
  IN UINTN
243
  );
244
245
/**
246
Perform a write transfer to another cache or to memory if the
247
data in the copy of the cache block have been modified by a store
248
operation
249
250
**/
251
VOID
252
EFIAPI
253
RiscVCpuCacheCleanCmoAsm (
254
  IN UINTN
255
  );
256
257
/**
258
Deallocate the copy of the cache block
259
260
**/
261
VOID
262
EFIAPI
263
RiscVCpuCacheInvalCmoAsm (
264
  IN UINTN
265
  );
152
266
153
#endif // defined (MDE_CPU_RISCV64)
267
#endif // defined (MDE_CPU_RISCV64)
154
268
269
#if defined (MDE_CPU_LOONGARCH64)
270
///
271
/// The LoongArch architecture context buffer used by SetJump() and LongJump()
272
///
273
typedef struct {
274
  UINT64    S0;
275
  UINT64    S1;
276
  UINT64    S2;
277
  UINT64    S3;
278
  UINT64    S4;
279
  UINT64    S5;
280
  UINT64    S6;
281
  UINT64    S7;
282
  UINT64    S8;
283
  UINT64    SP;
284
  UINT64    FP;
285
  UINT64    RA;
286
} BASE_LIBRARY_JUMP_BUFFER;
287
288
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  8
289
290
/*
291
 * Set the exception base address for LoongArch.
292
 *
293
 * @param  ExceptionBaseAddress   The exception base address, must be aligned greater than or qeual to 4K .
294
 */
295
VOID
296
SetExceptionBaseAddress (
297
  IN UINT64
298
  );
299
300
/*
301
 * Set the TlbRebase address for LoongArch.
302
 *
303
 * @param  TlbRebaseAddress   The TlbRebase address, must be aligned greater than or qeual to 4K .
304
 */
305
VOID
306
SetTlbRebaseAddress (
307
  IN UINT64
308
  );
309
310
/**
311
  Enables local CPU interrupts.
312
313
  @param  Needs to enable local interrupt bit.
314
**/
315
VOID
316
EnableLocalInterrupts (
317
  IN UINT16
318
  );
319
320
/**
321
  Disables local CPU interrupts.
322
323
  @param  Needs to disable local interrupt bit.
324
**/
325
VOID
326
DisableLocalInterrupts (
327
  IN UINT16
328
  );
329
330
/**
331
  Read CPUCFG register.
332
333
  @param  Index  Specifies the register number of the CPUCFG to read the data.
334
  @param  Data   A pointer to the variable used to store the CPUCFG register value.
335
**/
336
VOID
337
AsmCpucfg (
338
  IN  UINT32  Index,
339
  OUT UINT32  *Data
340
  );
341
342
/**
343
  Gets the timer count value.
344
345
  @param[] VOID
346
  @retval  timer count value.
347
348
**/
349
UINTN
350
AsmReadStableCounter (
351
  VOID
352
  );
353
354
/**
355
  CSR read operation.
356
357
  @param[in]  Select   CSR read instruction select values.
358
359
  @return     The return value of csrrd instruction, return -1 means no CSR instruction
360
              is found.
361
**/
362
UINTN
363
CsrRead (
364
  IN UINT16  Select
365
  );
366
367
/**
368
  CSR write operation.
369
370
  @param[in]  Select   CSR write instruction select values.
371
  @param[in]  Value    The csrwr will write the value.
372
373
  @return     The return value of csrwr instruction, that is, store the old value of
374
              the register, return -1 means no CSR instruction is found.
375
**/
376
UINTN
377
CsrWrite (
378
  IN UINT16  Select,
379
  IN UINTN   Value
380
  );
381
382
/**
383
  CSR exchange operation.
384
385
  @param[in]  Select   CSR exchange instruction select values.
386
  @param[in]  Value    The csrxchg will write the value.
387
  @param[in]  Mask     The csrxchg mask value.
388
389
  @return     The return value of csrxchg instruction, that is, store the old value of
390
              the register, return -1 means no CSR instruction is found.
391
**/
392
UINTN
393
CsrXChg (
394
  IN UINT16  Select,
395
  IN UINTN   Value,
396
  IN UINTN   Mask
397
  );
398
399
/**
400
  IO CSR read byte operation.
401
402
  @param[in]  Select   IO CSR read instruction select values.
403
404
  @return     The return value of iocsrrd.b instruction.
405
406
**/
407
UINT8
408
IoCsrRead8 (
409
  IN UINTN  Select
410
  );
411
412
/**
413
  IO CSR read half word operation.
414
415
  @param[in]  Select   IO CSR read instruction select values.
416
417
  @return     The return value of iocsrrd.h instruction.
418
419
**/
420
UINT16
421
IoCsrRead16 (
422
  IN UINTN  Select
423
  );
424
425
/**
426
  IO CSR read word operation.
427
428
  @param[in]  Select   IO CSR read instruction select values.
429
430
  @return     The return value of iocsrrd.w instruction.
431
432
**/
433
UINT32
434
IoCsrRead32 (
435
  IN UINTN  Select
436
  );
437
438
/**
439
  IO CSR read double word operation. Only for LoongArch64.
440
441
  @param[in]  Select   IO CSR read instruction select values.
442
443
  @return     The return value of iocsrrd.d instruction.
444
445
**/
446
UINT64
447
IoCsrRead64 (
448
  IN UINTN  Select
449
  );
450
451
/**
452
  IO CSR write byte operation.
453
454
  @param[in]  Select   IO CSR write instruction select values.
455
  @param[in]  Value    The iocsrwr.b will write the value.
456
457
  @return     VOID.
458
459
**/
460
VOID
461
IoCsrWrite8 (
462
  IN UINTN  Select,
463
  IN UINT8  Value
464
  );
465
466
/**
467
  IO CSR write half word operation.
468
469
  @param[in]  Select   IO CSR write instruction select values.
470
  @param[in]  Value    The iocsrwr.h will write the value.
471
472
  @return     VOID.
473
474
**/
475
VOID
476
IoCsrWrite16 (
477
  IN UINTN   Select,
478
  IN UINT16  Value
479
  );
480
481
/**
482
  IO CSR write word operation.
483
484
  @param[in]  Select   IO CSR write instruction select values.
485
  @param[in]  Value    The iocsrwr.w will write the value.
486
487
  @return     VOID.
488
489
**/
490
VOID
491
IoCsrWrite32 (
492
  IN UINTN   Select,
493
  IN UINT32  Value
494
  );
495
496
/**
497
  IO CSR write double word operation. Only for LoongArch64.
498
499
  @param[in]  Select   IO CSR write instruction select values.
500
  @param[in]  Value    The iocsrwr.d will write the value.
501
502
  @return     VOID.
503
504
**/
505
VOID
506
IoCsrWrite64 (
507
  IN UINTN   Select,
508
  IN UINT64  Value
509
  );
510
511
#endif // defined (MDE_CPU_LOONGARCH64)
512
155
//
513
//
156
// String Services
514
// String Services
157
//
515
//
158
516
159
160
/**
517
/**
161
  Returns the length of a Null-terminated Unicode string.
518
  Returns the length of a Null-terminated Unicode string.
162
519
Lines 176-183 typedef struct { Link Here
176
UINTN
533
UINTN
177
EFIAPI
534
EFIAPI
178
StrnLenS (
535
StrnLenS (
179
  IN CONST CHAR16              *String,
536
  IN CONST CHAR16  *String,
180
  IN UINTN                     MaxSize
537
  IN UINTN         MaxSize
181
  );
538
  );
182
539
183
/**
540
/**
Lines 204-211 StrnLenS ( Link Here
204
UINTN
561
UINTN
205
EFIAPI
562
EFIAPI
206
StrnSizeS (
563
StrnSizeS (
207
  IN CONST CHAR16              *String,
564
  IN CONST CHAR16  *String,
208
  IN UINTN                     MaxSize
565
  IN UINTN         MaxSize
209
  );
566
  );
210
567
211
/**
568
/**
Lines 237-245 StrnSizeS ( Link Here
237
RETURN_STATUS
594
RETURN_STATUS
238
EFIAPI
595
EFIAPI
239
StrCpyS (
596
StrCpyS (
240
  OUT CHAR16       *Destination,
597
  OUT CHAR16        *Destination,
241
  IN  UINTN        DestMax,
598
  IN  UINTN         DestMax,
242
  IN  CONST CHAR16 *Source
599
  IN  CONST CHAR16  *Source
243
  );
600
  );
244
601
245
/**
602
/**
Lines 274-283 StrCpyS ( Link Here
274
RETURN_STATUS
631
RETURN_STATUS
275
EFIAPI
632
EFIAPI
276
StrnCpyS (
633
StrnCpyS (
277
  OUT CHAR16       *Destination,
634
  OUT CHAR16        *Destination,
278
  IN  UINTN        DestMax,
635
  IN  UINTN         DestMax,
279
  IN  CONST CHAR16 *Source,
636
  IN  CONST CHAR16  *Source,
280
  IN  UINTN        Length
637
  IN  UINTN         Length
281
  );
638
  );
282
639
283
/**
640
/**
Lines 312-320 StrnCpyS ( Link Here
312
RETURN_STATUS
669
RETURN_STATUS
313
EFIAPI
670
EFIAPI
314
StrCatS (
671
StrCatS (
315
  IN OUT CHAR16       *Destination,
672
  IN OUT CHAR16        *Destination,
316
  IN     UINTN        DestMax,
673
  IN     UINTN         DestMax,
317
  IN     CONST CHAR16 *Source
674
  IN     CONST CHAR16  *Source
318
  );
675
  );
319
676
320
/**
677
/**
Lines 352-361 StrCatS ( Link Here
352
RETURN_STATUS
709
RETURN_STATUS
353
EFIAPI
710
EFIAPI
354
StrnCatS (
711
StrnCatS (
355
  IN OUT CHAR16       *Destination,
712
  IN OUT CHAR16        *Destination,
356
  IN     UINTN        DestMax,
713
  IN     UINTN         DestMax,
357
  IN     CONST CHAR16 *Source,
714
  IN     CONST CHAR16  *Source,
358
  IN     UINTN        Length
715
  IN     UINTN         Length
359
  );
716
  );
360
717
361
/**
718
/**
Lines 404-412 StrnCatS ( Link Here
404
RETURN_STATUS
761
RETURN_STATUS
405
EFIAPI
762
EFIAPI
406
StrDecimalToUintnS (
763
StrDecimalToUintnS (
407
  IN  CONST CHAR16             *String,
764
  IN  CONST CHAR16  *String,
408
  OUT       CHAR16             **EndPointer,  OPTIONAL
765
  OUT       CHAR16  **EndPointer   OPTIONAL,
409
  OUT       UINTN              *Data
766
  OUT       UINTN   *Data
410
  );
767
  );
411
768
412
/**
769
/**
Lines 455-463 StrDecimalToUintnS ( Link Here
455
RETURN_STATUS
812
RETURN_STATUS
456
EFIAPI
813
EFIAPI
457
StrDecimalToUint64S (
814
StrDecimalToUint64S (
458
  IN  CONST CHAR16             *String,
815
  IN  CONST CHAR16  *String,
459
  OUT       CHAR16             **EndPointer,  OPTIONAL
816
  OUT       CHAR16  **EndPointer   OPTIONAL,
460
  OUT       UINT64             *Data
817
  OUT       UINT64  *Data
461
  );
818
  );
462
819
463
/**
820
/**
Lines 511-519 StrDecimalToUint64S ( Link Here
511
RETURN_STATUS
868
RETURN_STATUS
512
EFIAPI
869
EFIAPI
513
StrHexToUintnS (
870
StrHexToUintnS (
514
  IN  CONST CHAR16             *String,
871
  IN  CONST CHAR16  *String,
515
  OUT       CHAR16             **EndPointer,  OPTIONAL
872
  OUT       CHAR16  **EndPointer   OPTIONAL,
516
  OUT       UINTN              *Data
873
  OUT       UINTN   *Data
517
  );
874
  );
518
875
519
/**
876
/**
Lines 567-575 StrHexToUintnS ( Link Here
567
RETURN_STATUS
924
RETURN_STATUS
568
EFIAPI
925
EFIAPI
569
StrHexToUint64S (
926
StrHexToUint64S (
570
  IN  CONST CHAR16             *String,
927
  IN  CONST CHAR16  *String,
571
  OUT       CHAR16             **EndPointer,  OPTIONAL
928
  OUT       CHAR16  **EndPointer   OPTIONAL,
572
  OUT       UINT64             *Data
929
  OUT       UINT64  *Data
573
  );
930
  );
574
931
575
/**
932
/**
Lines 589-596 StrHexToUint64S ( Link Here
589
UINTN
946
UINTN
590
EFIAPI
947
EFIAPI
591
AsciiStrnLenS (
948
AsciiStrnLenS (
592
  IN CONST CHAR8               *String,
949
  IN CONST CHAR8  *String,
593
  IN UINTN                     MaxSize
950
  IN UINTN        MaxSize
594
  );
951
  );
595
952
596
/**
953
/**
Lines 615-622 AsciiStrnLenS ( Link Here
615
UINTN
972
UINTN
616
EFIAPI
973
EFIAPI
617
AsciiStrnSizeS (
974
AsciiStrnSizeS (
618
  IN CONST CHAR8               *String,
975
  IN CONST CHAR8  *String,
619
  IN UINTN                     MaxSize
976
  IN UINTN        MaxSize
620
  );
977
  );
621
978
622
/**
979
/**
Lines 801-809 AsciiStrnCatS ( Link Here
801
RETURN_STATUS
1158
RETURN_STATUS
802
EFIAPI
1159
EFIAPI
803
AsciiStrDecimalToUintnS (
1160
AsciiStrDecimalToUintnS (
804
  IN  CONST CHAR8              *String,
1161
  IN  CONST CHAR8  *String,
805
  OUT       CHAR8              **EndPointer,  OPTIONAL
1162
  OUT       CHAR8  **EndPointer   OPTIONAL,
806
  OUT       UINTN              *Data
1163
  OUT       UINTN  *Data
807
  );
1164
  );
808
1165
809
/**
1166
/**
Lines 850-858 AsciiStrDecimalToUintnS ( Link Here
850
RETURN_STATUS
1207
RETURN_STATUS
851
EFIAPI
1208
EFIAPI
852
AsciiStrDecimalToUint64S (
1209
AsciiStrDecimalToUint64S (
853
  IN  CONST CHAR8              *String,
1210
  IN  CONST CHAR8   *String,
854
  OUT       CHAR8              **EndPointer,  OPTIONAL
1211
  OUT       CHAR8   **EndPointer   OPTIONAL,
855
  OUT       UINT64             *Data
1212
  OUT       UINT64  *Data
856
  );
1213
  );
857
1214
858
/**
1215
/**
Lines 903-911 AsciiStrDecimalToUint64S ( Link Here
903
RETURN_STATUS
1260
RETURN_STATUS
904
EFIAPI
1261
EFIAPI
905
AsciiStrHexToUintnS (
1262
AsciiStrHexToUintnS (
906
  IN  CONST CHAR8              *String,
1263
  IN  CONST CHAR8  *String,
907
  OUT       CHAR8              **EndPointer,  OPTIONAL
1264
  OUT       CHAR8  **EndPointer   OPTIONAL,
908
  OUT       UINTN              *Data
1265
  OUT       UINTN  *Data
909
  );
1266
  );
910
1267
911
/**
1268
/**
Lines 956-1042 AsciiStrHexToUintnS ( Link Here
956
RETURN_STATUS
1313
RETURN_STATUS
957
EFIAPI
1314
EFIAPI
958
AsciiStrHexToUint64S (
1315
AsciiStrHexToUint64S (
959
  IN  CONST CHAR8              *String,
1316
  IN  CONST CHAR8   *String,
960
  OUT       CHAR8              **EndPointer,  OPTIONAL
1317
  OUT       CHAR8   **EndPointer   OPTIONAL,
961
  OUT       UINT64             *Data
1318
  OUT       UINT64  *Data
962
  );
963
964
965
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
966
967
/**
968
  [ATTENTION] This function is deprecated for security reason.
969
970
  Copies one Null-terminated Unicode string to another Null-terminated Unicode
971
  string and returns the new Unicode string.
972
973
  This function copies the contents of the Unicode string Source to the Unicode
974
  string Destination, and returns Destination. If Source and Destination
975
  overlap, then the results are undefined.
976
977
  If Destination is NULL, then ASSERT().
978
  If Destination is not aligned on a 16-bit boundary, then ASSERT().
979
  If Source is NULL, then ASSERT().
980
  If Source is not aligned on a 16-bit boundary, then ASSERT().
981
  If Source and Destination overlap, then ASSERT().
982
  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
983
  PcdMaximumUnicodeStringLength Unicode characters not including the
984
  Null-terminator, then ASSERT().
985
986
  @param  Destination The pointer to a Null-terminated Unicode string.
987
  @param  Source      The pointer to a Null-terminated Unicode string.
988
989
  @return Destination.
990
991
**/
992
CHAR16 *
993
EFIAPI
994
StrCpy (
995
  OUT     CHAR16                    *Destination,
996
  IN      CONST CHAR16              *Source
997
  );
998
999
1000
/**
1001
  [ATTENTION] This function is deprecated for security reason.
1002
1003
  Copies up to a specified length from one Null-terminated Unicode string to
1004
  another Null-terminated Unicode string and returns the new Unicode string.
1005
1006
  This function copies the contents of the Unicode string Source to the Unicode
1007
  string Destination, and returns Destination. At most, Length Unicode
1008
  characters are copied from Source to Destination. If Length is 0, then
1009
  Destination is returned unmodified. If Length is greater that the number of
1010
  Unicode characters in Source, then Destination is padded with Null Unicode
1011
  characters. If Source and Destination overlap, then the results are
1012
  undefined.
1013
1014
  If Length > 0 and Destination is NULL, then ASSERT().
1015
  If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
1016
  If Length > 0 and Source is NULL, then ASSERT().
1017
  If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
1018
  If Source and Destination overlap, then ASSERT().
1019
  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
1020
  PcdMaximumUnicodeStringLength, then ASSERT().
1021
  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1022
  PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
1023
  then ASSERT().
1024
1025
  @param  Destination The pointer to a Null-terminated Unicode string.
1026
  @param  Source      The pointer to a Null-terminated Unicode string.
1027
  @param  Length      The maximum number of Unicode characters to copy.
1028
1029
  @return Destination.
1030
1031
**/
1032
CHAR16 *
1033
EFIAPI
1034
StrnCpy (
1035
  OUT     CHAR16                    *Destination,
1036
  IN      CONST CHAR16              *Source,
1037
  IN      UINTN                     Length
1038
  );
1319
  );
1039
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
1040
1320
1041
/**
1321
/**
1042
  Returns the length of a Null-terminated Unicode string.
1322
  Returns the length of a Null-terminated Unicode string.
Lines 1058-1067 StrnCpy ( Link Here
1058
UINTN
1338
UINTN
1059
EFIAPI
1339
EFIAPI
1060
StrLen (
1340
StrLen (
1061
  IN      CONST CHAR16              *String
1341
  IN      CONST CHAR16  *String
1062
  );
1342
  );
1063
1343
1064
1065
/**
1344
/**
1066
  Returns the size of a Null-terminated Unicode string in bytes, including the
1345
  Returns the size of a Null-terminated Unicode string in bytes, including the
1067
  Null terminator.
1346
  Null terminator.
Lines 1083-1092 StrLen ( Link Here
1083
UINTN
1362
UINTN
1084
EFIAPI
1363
EFIAPI
1085
StrSize (
1364
StrSize (
1086
  IN      CONST CHAR16              *String
1365
  IN      CONST CHAR16  *String
1087
  );
1366
  );
1088
1367
1089
1090
/**
1368
/**
1091
  Compares two Null-terminated Unicode strings, and returns the difference
1369
  Compares two Null-terminated Unicode strings, and returns the difference
1092
  between the first mismatched Unicode characters.
1370
  between the first mismatched Unicode characters.
Lines 1118-1128 StrSize ( Link Here
1118
INTN
1396
INTN
1119
EFIAPI
1397
EFIAPI
1120
StrCmp (
1398
StrCmp (
1121
  IN      CONST CHAR16              *FirstString,
1399
  IN      CONST CHAR16  *FirstString,
1122
  IN      CONST CHAR16              *SecondString
1400
  IN      CONST CHAR16  *SecondString
1123
  );
1401
  );
1124
1402
1125
1126
/**
1403
/**
1127
  Compares up to a specified length the contents of two Null-terminated Unicode strings,
1404
  Compares up to a specified length the contents of two Null-terminated Unicode strings,
1128
  and returns the difference between the first mismatched Unicode characters.
1405
  and returns the difference between the first mismatched Unicode characters.
Lines 1158-1261 StrCmp ( Link Here
1158
INTN
1435
INTN
1159
EFIAPI
1436
EFIAPI
1160
StrnCmp (
1437
StrnCmp (
1161
  IN      CONST CHAR16              *FirstString,
1438
  IN      CONST CHAR16  *FirstString,
1162
  IN      CONST CHAR16              *SecondString,
1439
  IN      CONST CHAR16  *SecondString,
1163
  IN      UINTN                     Length
1440
  IN      UINTN         Length
1164
  );
1165
1166
1167
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1168
1169
/**
1170
  [ATTENTION] This function is deprecated for security reason.
1171
1172
  Concatenates one Null-terminated Unicode string to another Null-terminated
1173
  Unicode string, and returns the concatenated Unicode string.
1174
1175
  This function concatenates two Null-terminated Unicode strings. The contents
1176
  of Null-terminated Unicode string Source are concatenated to the end of
1177
  Null-terminated Unicode string Destination. The Null-terminated concatenated
1178
  Unicode String is returned. If Source and Destination overlap, then the
1179
  results are undefined.
1180
1181
  If Destination is NULL, then ASSERT().
1182
  If Destination is not aligned on a 16-bit boundary, then ASSERT().
1183
  If Source is NULL, then ASSERT().
1184
  If Source is not aligned on a 16-bit boundary, then ASSERT().
1185
  If Source and Destination overlap, then ASSERT().
1186
  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
1187
  than PcdMaximumUnicodeStringLength Unicode characters, not including the
1188
  Null-terminator, then ASSERT().
1189
  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1190
  PcdMaximumUnicodeStringLength Unicode characters, not including the
1191
  Null-terminator, then ASSERT().
1192
  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
1193
  and Source results in a Unicode string with more than
1194
  PcdMaximumUnicodeStringLength Unicode characters, not including the
1195
  Null-terminator, then ASSERT().
1196
1197
  @param  Destination The pointer to a Null-terminated Unicode string.
1198
  @param  Source      The pointer to a Null-terminated Unicode string.
1199
1200
  @return Destination.
1201
1202
**/
1203
CHAR16 *
1204
EFIAPI
1205
StrCat (
1206
  IN OUT  CHAR16                    *Destination,
1207
  IN      CONST CHAR16              *Source
1208
  );
1209
1210
1211
/**
1212
  [ATTENTION] This function is deprecated for security reason.
1213
1214
  Concatenates up to a specified length one Null-terminated Unicode to the end
1215
  of another Null-terminated Unicode string, and returns the concatenated
1216
  Unicode string.
1217
1218
  This function concatenates two Null-terminated Unicode strings. The contents
1219
  of Null-terminated Unicode string Source are concatenated to the end of
1220
  Null-terminated Unicode string Destination, and Destination is returned. At
1221
  most, Length Unicode characters are concatenated from Source to the end of
1222
  Destination, and Destination is always Null-terminated. If Length is 0, then
1223
  Destination is returned unmodified. If Source and Destination overlap, then
1224
  the results are undefined.
1225
1226
  If Destination is NULL, then ASSERT().
1227
  If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
1228
  If Length > 0 and Source is NULL, then ASSERT().
1229
  If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
1230
  If Source and Destination overlap, then ASSERT().
1231
  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
1232
  PcdMaximumUnicodeStringLength, then ASSERT().
1233
  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
1234
  than PcdMaximumUnicodeStringLength Unicode characters, not including the
1235
  Null-terminator, then ASSERT().
1236
  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
1237
  PcdMaximumUnicodeStringLength Unicode characters, not including the
1238
  Null-terminator, then ASSERT().
1239
  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
1240
  and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength
1241
  Unicode characters, not including the Null-terminator, then ASSERT().
1242
1243
  @param  Destination The pointer to a Null-terminated Unicode string.
1244
  @param  Source      The pointer to a Null-terminated Unicode string.
1245
  @param  Length      The maximum number of Unicode characters to concatenate from
1246
                      Source.
1247
1248
  @return Destination.
1249
1250
**/
1251
CHAR16 *
1252
EFIAPI
1253
StrnCat (
1254
  IN OUT  CHAR16                    *Destination,
1255
  IN      CONST CHAR16              *Source,
1256
  IN      UINTN                     Length
1257
  );
1441
  );
1258
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
1259
1442
1260
/**
1443
/**
1261
  Returns the first occurrence of a Null-terminated Unicode sub-string
1444
  Returns the first occurrence of a Null-terminated Unicode sub-string
Lines 1285-1292 StrnCat ( Link Here
1285
CHAR16 *
1468
CHAR16 *
1286
EFIAPI
1469
EFIAPI
1287
StrStr (
1470
StrStr (
1288
  IN      CONST CHAR16              *String,
1471
  IN      CONST CHAR16  *String,
1289
  IN      CONST CHAR16              *SearchString
1472
  IN      CONST CHAR16  *SearchString
1290
  );
1473
  );
1291
1474
1292
/**
1475
/**
Lines 1326-1332 StrStr ( Link Here
1326
UINTN
1509
UINTN
1327
EFIAPI
1510
EFIAPI
1328
StrDecimalToUintn (
1511
StrDecimalToUintn (
1329
  IN      CONST CHAR16              *String
1512
  IN      CONST CHAR16  *String
1330
  );
1513
  );
1331
1514
1332
/**
1515
/**
Lines 1366-1375 StrDecimalToUintn ( Link Here
1366
UINT64
1549
UINT64
1367
EFIAPI
1550
EFIAPI
1368
StrDecimalToUint64 (
1551
StrDecimalToUint64 (
1369
  IN      CONST CHAR16              *String
1552
  IN      CONST CHAR16  *String
1370
  );
1553
  );
1371
1554
1372
1373
/**
1555
/**
1374
  Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
1556
  Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
1375
1557
Lines 1408-1417 StrDecimalToUint64 ( Link Here
1408
UINTN
1590
UINTN
1409
EFIAPI
1591
EFIAPI
1410
StrHexToUintn (
1592
StrHexToUintn (
1411
  IN      CONST CHAR16              *String
1593
  IN      CONST CHAR16  *String
1412
  );
1594
  );
1413
1595
1414
1415
/**
1596
/**
1416
  Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
1597
  Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
1417
1598
Lines 1450-1456 StrHexToUintn ( Link Here
1450
UINT64
1631
UINT64
1451
EFIAPI
1632
EFIAPI
1452
StrHexToUint64 (
1633
StrHexToUint64 (
1453
  IN      CONST CHAR16             *String
1634
  IN      CONST CHAR16  *String
1454
  );
1635
  );
1455
1636
1456
/**
1637
/**
Lines 1506-1515 StrHexToUint64 ( Link Here
1506
RETURN_STATUS
1687
RETURN_STATUS
1507
EFIAPI
1688
EFIAPI
1508
StrToIpv6Address (
1689
StrToIpv6Address (
1509
  IN  CONST CHAR16       *String,
1690
  IN  CONST CHAR16  *String,
1510
  OUT CHAR16             **EndPointer, OPTIONAL
1691
  OUT CHAR16        **EndPointer  OPTIONAL,
1511
  OUT IPv6_ADDRESS       *Address,
1692
  OUT IPv6_ADDRESS  *Address,
1512
  OUT UINT8              *PrefixLength OPTIONAL
1693
  OUT UINT8         *PrefixLength OPTIONAL
1513
  );
1694
  );
1514
1695
1515
/**
1696
/**
Lines 1556-1565 StrToIpv6Address ( Link Here
1556
RETURN_STATUS
1737
RETURN_STATUS
1557
EFIAPI
1738
EFIAPI
1558
StrToIpv4Address (
1739
StrToIpv4Address (
1559
  IN  CONST CHAR16       *String,
1740
  IN  CONST CHAR16  *String,
1560
  OUT CHAR16             **EndPointer, OPTIONAL
1741
  OUT CHAR16        **EndPointer  OPTIONAL,
1561
  OUT IPv4_ADDRESS       *Address,
1742
  OUT IPv4_ADDRESS  *Address,
1562
  OUT UINT8              *PrefixLength OPTIONAL
1743
  OUT UINT8         *PrefixLength OPTIONAL
1563
  );
1744
  );
1564
1745
1565
#define GUID_STRING_LENGTH  36
1746
#define GUID_STRING_LENGTH  36
Lines 1609-1616 StrToIpv4Address ( Link Here
1609
RETURN_STATUS
1790
RETURN_STATUS
1610
EFIAPI
1791
EFIAPI
1611
StrToGuid (
1792
StrToGuid (
1612
  IN  CONST CHAR16       *String,
1793
  IN  CONST CHAR16  *String,
1613
  OUT GUID               *Guid
1794
  OUT GUID          *Guid
1614
  );
1795
  );
1615
1796
1616
/**
1797
/**
Lines 1649-1706 StrToGuid ( Link Here
1649
RETURN_STATUS
1830
RETURN_STATUS
1650
EFIAPI
1831
EFIAPI
1651
StrHexToBytes (
1832
StrHexToBytes (
1652
  IN  CONST CHAR16       *String,
1833
  IN  CONST CHAR16  *String,
1653
  IN  UINTN              Length,
1834
  IN  UINTN         Length,
1654
  OUT UINT8              *Buffer,
1835
  OUT UINT8         *Buffer,
1655
  IN  UINTN              MaxBufferSize
1836
  IN  UINTN         MaxBufferSize
1656
  );
1657
1658
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1659
1660
/**
1661
  [ATTENTION] This function is deprecated for security reason.
1662
1663
  Convert a Null-terminated Unicode string to a Null-terminated
1664
  ASCII string and returns the ASCII string.
1665
1666
  This function converts the content of the Unicode string Source
1667
  to the ASCII string Destination by copying the lower 8 bits of
1668
  each Unicode character. It returns Destination.
1669
1670
  The caller is responsible to make sure Destination points to a buffer with size
1671
  equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
1672
1673
  If any Unicode characters in Source contain non-zero value in
1674
  the upper 8 bits, then ASSERT().
1675
1676
  If Destination is NULL, then ASSERT().
1677
  If Source is NULL, then ASSERT().
1678
  If Source is not aligned on a 16-bit boundary, then ASSERT().
1679
  If Source and Destination overlap, then ASSERT().
1680
1681
  If PcdMaximumUnicodeStringLength is not zero, and Source contains
1682
  more than PcdMaximumUnicodeStringLength Unicode characters not including
1683
  the Null-terminator, then ASSERT().
1684
1685
  If PcdMaximumAsciiStringLength is not zero, and Source contains more
1686
  than PcdMaximumAsciiStringLength Unicode characters not including the
1687
  Null-terminator, then ASSERT().
1688
1689
  @param  Source        The pointer to a Null-terminated Unicode string.
1690
  @param  Destination   The pointer to a Null-terminated ASCII string.
1691
1692
  @return Destination.
1693
1694
**/
1695
CHAR8 *
1696
EFIAPI
1697
UnicodeStrToAsciiStr (
1698
  IN      CONST CHAR16              *Source,
1699
  OUT     CHAR8                     *Destination
1700
  );
1837
  );
1701
1838
1702
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
1703
1704
/**
1839
/**
1705
  Convert a Null-terminated Unicode string to a Null-terminated
1840
  Convert a Null-terminated Unicode string to a Null-terminated
1706
  ASCII string.
1841
  ASCII string.
Lines 1744-1752 UnicodeStrToAsciiStr ( Link Here
1744
RETURN_STATUS
1879
RETURN_STATUS
1745
EFIAPI
1880
EFIAPI
1746
UnicodeStrToAsciiStrS (
1881
UnicodeStrToAsciiStrS (
1747
  IN      CONST CHAR16              *Source,
1882
  IN      CONST CHAR16  *Source,
1748
  OUT     CHAR8                     *Destination,
1883
  OUT     CHAR8         *Destination,
1749
  IN      UINTN                     DestMax
1884
  IN      UINTN         DestMax
1750
  );
1885
  );
1751
1886
1752
/**
1887
/**
Lines 1795-1878 UnicodeStrToAsciiStrS ( Link Here
1795
RETURN_STATUS
1930
RETURN_STATUS
1796
EFIAPI
1931
EFIAPI
1797
UnicodeStrnToAsciiStrS (
1932
UnicodeStrnToAsciiStrS (
1798
  IN      CONST CHAR16              *Source,
1933
  IN      CONST CHAR16  *Source,
1799
  IN      UINTN                     Length,
1934
  IN      UINTN         Length,
1800
  OUT     CHAR8                     *Destination,
1935
  OUT     CHAR8         *Destination,
1801
  IN      UINTN                     DestMax,
1936
  IN      UINTN         DestMax,
1802
  OUT     UINTN                     *DestinationLength
1937
  OUT     UINTN         *DestinationLength
1803
  );
1804
1805
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1806
1807
/**
1808
  [ATTENTION] This function is deprecated for security reason.
1809
1810
  Copies one Null-terminated ASCII string to another Null-terminated ASCII
1811
  string and returns the new ASCII string.
1812
1813
  This function copies the contents of the ASCII string Source to the ASCII
1814
  string Destination, and returns Destination. If Source and Destination
1815
  overlap, then the results are undefined.
1816
1817
  If Destination is NULL, then ASSERT().
1818
  If Source is NULL, then ASSERT().
1819
  If Source and Destination overlap, then ASSERT().
1820
  If PcdMaximumAsciiStringLength is not zero and Source contains more than
1821
  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
1822
  then ASSERT().
1823
1824
  @param  Destination The pointer to a Null-terminated ASCII string.
1825
  @param  Source      The pointer to a Null-terminated ASCII string.
1826
1827
  @return Destination
1828
1829
**/
1830
CHAR8 *
1831
EFIAPI
1832
AsciiStrCpy (
1833
  OUT     CHAR8                     *Destination,
1834
  IN      CONST CHAR8               *Source
1835
  );
1938
  );
1836
1939
1837
1838
/**
1839
  [ATTENTION] This function is deprecated for security reason.
1840
1841
  Copies up to a specified length one Null-terminated ASCII string to another
1842
  Null-terminated ASCII string and returns the new ASCII string.
1843
1844
  This function copies the contents of the ASCII string Source to the ASCII
1845
  string Destination, and returns Destination. At most, Length ASCII characters
1846
  are copied from Source to Destination. If Length is 0, then Destination is
1847
  returned unmodified. If Length is greater that the number of ASCII characters
1848
  in Source, then Destination is padded with Null ASCII characters. If Source
1849
  and Destination overlap, then the results are undefined.
1850
1851
  If Destination is NULL, then ASSERT().
1852
  If Source is NULL, then ASSERT().
1853
  If Source and Destination overlap, then ASSERT().
1854
  If PcdMaximumAsciiStringLength is not zero, and Length is greater than
1855
  PcdMaximumAsciiStringLength, then ASSERT().
1856
  If PcdMaximumAsciiStringLength is not zero, and Source contains more than
1857
  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
1858
  then ASSERT().
1859
1860
  @param  Destination The pointer to a Null-terminated ASCII string.
1861
  @param  Source      The pointer to a Null-terminated ASCII string.
1862
  @param  Length      The maximum number of ASCII characters to copy.
1863
1864
  @return Destination
1865
1866
**/
1867
CHAR8 *
1868
EFIAPI
1869
AsciiStrnCpy (
1870
  OUT     CHAR8                     *Destination,
1871
  IN      CONST CHAR8               *Source,
1872
  IN      UINTN                     Length
1873
  );
1874
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
1875
1876
/**
1940
/**
1877
  Returns the length of a Null-terminated ASCII string.
1941
  Returns the length of a Null-terminated ASCII string.
1878
1942
Lines 1893-1902 AsciiStrnCpy ( Link Here
1893
UINTN
1957
UINTN
1894
EFIAPI
1958
EFIAPI
1895
AsciiStrLen (
1959
AsciiStrLen (
1896
  IN      CONST CHAR8               *String
1960
  IN      CONST CHAR8  *String
1897
  );
1961
  );
1898
1962
1899
1900
/**
1963
/**
1901
  Returns the size of a Null-terminated ASCII string in bytes, including the
1964
  Returns the size of a Null-terminated ASCII string in bytes, including the
1902
  Null terminator.
1965
  Null terminator.
Lines 1917-1926 AsciiStrLen ( Link Here
1917
UINTN
1980
UINTN
1918
EFIAPI
1981
EFIAPI
1919
AsciiStrSize (
1982
AsciiStrSize (
1920
  IN      CONST CHAR8               *String
1983
  IN      CONST CHAR8  *String
1921
  );
1984
  );
1922
1985
1923
1924
/**
1986
/**
1925
  Compares two Null-terminated ASCII strings, and returns the difference
1987
  Compares two Null-terminated ASCII strings, and returns the difference
1926
  between the first mismatched ASCII characters.
1988
  between the first mismatched ASCII characters.
Lines 1950-1960 AsciiStrSize ( Link Here
1950
INTN
2012
INTN
1951
EFIAPI
2013
EFIAPI
1952
AsciiStrCmp (
2014
AsciiStrCmp (
1953
  IN      CONST CHAR8               *FirstString,
2015
  IN      CONST CHAR8  *FirstString,
1954
  IN      CONST CHAR8               *SecondString
2016
  IN      CONST CHAR8  *SecondString
1955
  );
2017
  );
1956
2018
1957
1958
/**
2019
/**
1959
  Performs a case insensitive comparison of two Null-terminated ASCII strings,
2020
  Performs a case insensitive comparison of two Null-terminated ASCII strings,
1960
  and returns the difference between the first mismatched ASCII characters.
2021
  and returns the difference between the first mismatched ASCII characters.
Lines 1987-1997 AsciiStrCmp ( Link Here
1987
INTN
2048
INTN
1988
EFIAPI
2049
EFIAPI
1989
AsciiStriCmp (
2050
AsciiStriCmp (
1990
  IN      CONST CHAR8               *FirstString,
2051
  IN      CONST CHAR8  *FirstString,
1991
  IN      CONST CHAR8               *SecondString
2052
  IN      CONST CHAR8  *SecondString
1992
  );
2053
  );
1993
2054
1994
1995
/**
2055
/**
1996
  Compares two Null-terminated ASCII strings with maximum lengths, and returns
2056
  Compares two Null-terminated ASCII strings with maximum lengths, and returns
1997
  the difference between the first mismatched ASCII characters.
2057
  the difference between the first mismatched ASCII characters.
Lines 2025-2122 AsciiStriCmp ( Link Here
2025
INTN
2085
INTN
2026
EFIAPI
2086
EFIAPI
2027
AsciiStrnCmp (
2087
AsciiStrnCmp (
2028
  IN      CONST CHAR8               *FirstString,
2088
  IN      CONST CHAR8  *FirstString,
2029
  IN      CONST CHAR8               *SecondString,
2089
  IN      CONST CHAR8  *SecondString,
2030
  IN      UINTN                     Length
2090
  IN      UINTN        Length
2031
  );
2091
  );
2032
2092
2033
2034
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
2035
2036
/**
2037
  [ATTENTION] This function is deprecated for security reason.
2038
2039
  Concatenates one Null-terminated ASCII string to another Null-terminated
2040
  ASCII string, and returns the concatenated ASCII string.
2041
2042
  This function concatenates two Null-terminated ASCII strings. The contents of
2043
  Null-terminated ASCII string Source are concatenated to the end of Null-
2044
  terminated ASCII string Destination. The Null-terminated concatenated ASCII
2045
  String is returned.
2046
2047
  If Destination is NULL, then ASSERT().
2048
  If Source is NULL, then ASSERT().
2049
  If PcdMaximumAsciiStringLength is not zero and Destination contains more than
2050
  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2051
  then ASSERT().
2052
  If PcdMaximumAsciiStringLength is not zero and Source contains more than
2053
  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2054
  then ASSERT().
2055
  If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
2056
  Source results in a ASCII string with more than PcdMaximumAsciiStringLength
2057
  ASCII characters, then ASSERT().
2058
2059
  @param  Destination The pointer to a Null-terminated ASCII string.
2060
  @param  Source      The pointer to a Null-terminated ASCII string.
2061
2062
  @return Destination
2063
2064
**/
2065
CHAR8 *
2066
EFIAPI
2067
AsciiStrCat (
2068
  IN OUT CHAR8    *Destination,
2069
  IN CONST CHAR8  *Source
2070
  );
2071
2072
2073
/**
2074
  [ATTENTION] This function is deprecated for security reason.
2075
2076
  Concatenates up to a specified length one Null-terminated ASCII string to
2077
  the end of another Null-terminated ASCII string, and returns the
2078
  concatenated ASCII string.
2079
2080
  This function concatenates two Null-terminated ASCII strings. The contents
2081
  of Null-terminated ASCII string Source are concatenated to the end of Null-
2082
  terminated ASCII string Destination, and Destination is returned. At most,
2083
  Length ASCII characters are concatenated from Source to the end of
2084
  Destination, and Destination is always Null-terminated. If Length is 0, then
2085
  Destination is returned unmodified. If Source and Destination overlap, then
2086
  the results are undefined.
2087
2088
  If Length > 0 and Destination is NULL, then ASSERT().
2089
  If Length > 0 and Source is NULL, then ASSERT().
2090
  If Source and Destination overlap, then ASSERT().
2091
  If PcdMaximumAsciiStringLength is not zero, and Length is greater than
2092
  PcdMaximumAsciiStringLength, then ASSERT().
2093
  If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
2094
  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2095
  then ASSERT().
2096
  If PcdMaximumAsciiStringLength is not zero, and Source contains more than
2097
  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
2098
  then ASSERT().
2099
  If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
2100
  Source results in a ASCII string with more than PcdMaximumAsciiStringLength
2101
  ASCII characters, not including the Null-terminator, then ASSERT().
2102
2103
  @param  Destination The pointer to a Null-terminated ASCII string.
2104
  @param  Source      The pointer to a Null-terminated ASCII string.
2105
  @param  Length      The maximum number of ASCII characters to concatenate from
2106
                      Source.
2107
2108
  @return Destination
2109
2110
**/
2111
CHAR8 *
2112
EFIAPI
2113
AsciiStrnCat (
2114
  IN OUT  CHAR8                     *Destination,
2115
  IN      CONST CHAR8               *Source,
2116
  IN      UINTN                     Length
2117
  );
2118
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
2119
2120
/**
2093
/**
2121
  Returns the first occurrence of a Null-terminated ASCII sub-string
2094
  Returns the first occurrence of a Null-terminated ASCII sub-string
2122
  in a Null-terminated ASCII string.
2095
  in a Null-terminated ASCII string.
Lines 2144-2154 AsciiStrnCat ( Link Here
2144
CHAR8 *
2117
CHAR8 *
2145
EFIAPI
2118
EFIAPI
2146
AsciiStrStr (
2119
AsciiStrStr (
2147
  IN      CONST CHAR8               *String,
2120
  IN      CONST CHAR8  *String,
2148
  IN      CONST CHAR8               *SearchString
2121
  IN      CONST CHAR8  *SearchString
2149
  );
2122
  );
2150
2123
2151
2152
/**
2124
/**
2153
  Convert a Null-terminated ASCII decimal string to a value of type
2125
  Convert a Null-terminated ASCII decimal string to a value of type
2154
  UINTN.
2126
  UINTN.
Lines 2182-2191 AsciiStrStr ( Link Here
2182
UINTN
2154
UINTN
2183
EFIAPI
2155
EFIAPI
2184
AsciiStrDecimalToUintn (
2156
AsciiStrDecimalToUintn (
2185
  IN      CONST CHAR8               *String
2157
  IN      CONST CHAR8  *String
2186
  );
2158
  );
2187
2159
2188
2189
/**
2160
/**
2190
  Convert a Null-terminated ASCII decimal string to a value of type
2161
  Convert a Null-terminated ASCII decimal string to a value of type
2191
  UINT64.
2162
  UINT64.
Lines 2219-2228 AsciiStrDecimalToUintn ( Link Here
2219
UINT64
2190
UINT64
2220
EFIAPI
2191
EFIAPI
2221
AsciiStrDecimalToUint64 (
2192
AsciiStrDecimalToUint64 (
2222
  IN      CONST CHAR8               *String
2193
  IN      CONST CHAR8  *String
2223
  );
2194
  );
2224
2195
2225
2226
/**
2196
/**
2227
  Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
2197
  Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
2228
2198
Lines 2260-2269 AsciiStrDecimalToUint64 ( Link Here
2260
UINTN
2230
UINTN
2261
EFIAPI
2231
EFIAPI
2262
AsciiStrHexToUintn (
2232
AsciiStrHexToUintn (
2263
  IN      CONST CHAR8               *String
2233
  IN      CONST CHAR8  *String
2264
  );
2234
  );
2265
2235
2266
2267
/**
2236
/**
2268
  Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
2237
  Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
2269
2238
Lines 2301-2307 AsciiStrHexToUintn ( Link Here
2301
UINT64
2270
UINT64
2302
EFIAPI
2271
EFIAPI
2303
AsciiStrHexToUint64 (
2272
AsciiStrHexToUint64 (
2304
  IN      CONST CHAR8                *String
2273
  IN      CONST CHAR8  *String
2305
  );
2274
  );
2306
2275
2307
/**
2276
/**
Lines 2355-2364 AsciiStrHexToUint64 ( Link Here
2355
RETURN_STATUS
2324
RETURN_STATUS
2356
EFIAPI
2325
EFIAPI
2357
AsciiStrToIpv6Address (
2326
AsciiStrToIpv6Address (
2358
  IN  CONST CHAR8        *String,
2327
  IN  CONST CHAR8   *String,
2359
  OUT CHAR8              **EndPointer, OPTIONAL
2328
  OUT CHAR8         **EndPointer  OPTIONAL,
2360
  OUT IPv6_ADDRESS       *Address,
2329
  OUT IPv6_ADDRESS  *Address,
2361
  OUT UINT8              *PrefixLength OPTIONAL
2330
  OUT UINT8         *PrefixLength OPTIONAL
2362
  );
2331
  );
2363
2332
2364
/**
2333
/**
Lines 2403-2412 AsciiStrToIpv6Address ( Link Here
2403
RETURN_STATUS
2372
RETURN_STATUS
2404
EFIAPI
2373
EFIAPI
2405
AsciiStrToIpv4Address (
2374
AsciiStrToIpv4Address (
2406
  IN  CONST CHAR8        *String,
2375
  IN  CONST CHAR8   *String,
2407
  OUT CHAR8              **EndPointer, OPTIONAL
2376
  OUT CHAR8         **EndPointer  OPTIONAL,
2408
  OUT IPv4_ADDRESS       *Address,
2377
  OUT IPv4_ADDRESS  *Address,
2409
  OUT UINT8              *PrefixLength OPTIONAL
2378
  OUT UINT8         *PrefixLength OPTIONAL
2410
  );
2379
  );
2411
2380
2412
/**
2381
/**
Lines 2452-2459 AsciiStrToIpv4Address ( Link Here
2452
RETURN_STATUS
2421
RETURN_STATUS
2453
EFIAPI
2422
EFIAPI
2454
AsciiStrToGuid (
2423
AsciiStrToGuid (
2455
  IN  CONST CHAR8        *String,
2424
  IN  CONST CHAR8  *String,
2456
  OUT GUID               *Guid
2425
  OUT GUID         *Guid
2457
  );
2426
  );
2458
2427
2459
/**
2428
/**
Lines 2490-2541 AsciiStrToGuid ( Link Here
2490
RETURN_STATUS
2459
RETURN_STATUS
2491
EFIAPI
2460
EFIAPI
2492
AsciiStrHexToBytes (
2461
AsciiStrHexToBytes (
2493
  IN  CONST CHAR8        *String,
2462
  IN  CONST CHAR8  *String,
2494
  IN  UINTN              Length,
2463
  IN  UINTN        Length,
2495
  OUT UINT8              *Buffer,
2464
  OUT UINT8        *Buffer,
2496
  IN  UINTN              MaxBufferSize
2465
  IN  UINTN        MaxBufferSize
2497
  );
2466
  );
2498
2467
2499
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
2500
2501
/**
2502
  [ATTENTION] This function is deprecated for security reason.
2503
2504
  Convert one Null-terminated ASCII string to a Null-terminated
2505
  Unicode string and returns the Unicode string.
2506
2507
  This function converts the contents of the ASCII string Source to the Unicode
2508
  string Destination, and returns Destination.  The function terminates the
2509
  Unicode string Destination by appending a Null-terminator character at the end.
2510
  The caller is responsible to make sure Destination points to a buffer with size
2511
  equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
2512
2513
  If Destination is NULL, then ASSERT().
2514
  If Destination is not aligned on a 16-bit boundary, then ASSERT().
2515
  If Source is NULL, then ASSERT().
2516
  If Source and Destination overlap, then ASSERT().
2517
  If PcdMaximumAsciiStringLength is not zero, and Source contains more than
2518
  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
2519
  then ASSERT().
2520
  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
2521
  PcdMaximumUnicodeStringLength ASCII characters not including the
2522
  Null-terminator, then ASSERT().
2523
2524
  @param  Source        The pointer to a Null-terminated ASCII string.
2525
  @param  Destination   The pointer to a Null-terminated Unicode string.
2526
2527
  @return Destination.
2528
2529
**/
2530
CHAR16 *
2531
EFIAPI
2532
AsciiStrToUnicodeStr (
2533
  IN      CONST CHAR8               *Source,
2534
  OUT     CHAR16                    *Destination
2535
  );
2536
2537
#endif // !defined (DISABLE_NEW_DEPRECATED_INTERFACES)
2538
2539
/**
2468
/**
2540
  Convert one Null-terminated ASCII string to a Null-terminated
2469
  Convert one Null-terminated ASCII string to a Null-terminated
2541
  Unicode string.
2470
  Unicode string.
Lines 2575-2583 AsciiStrToUnicodeStr ( Link Here
2575
RETURN_STATUS
2504
RETURN_STATUS
2576
EFIAPI
2505
EFIAPI
2577
AsciiStrToUnicodeStrS (
2506
AsciiStrToUnicodeStrS (
2578
  IN      CONST CHAR8               *Source,
2507
  IN      CONST CHAR8  *Source,
2579
  OUT     CHAR16                    *Destination,
2508
  OUT     CHAR16       *Destination,
2580
  IN      UINTN                     DestMax
2509
  IN      UINTN        DestMax
2581
  );
2510
  );
2582
2511
2583
/**
2512
/**
Lines 2625-2635 AsciiStrToUnicodeStrS ( Link Here
2625
RETURN_STATUS
2554
RETURN_STATUS
2626
EFIAPI
2555
EFIAPI
2627
AsciiStrnToUnicodeStrS (
2556
AsciiStrnToUnicodeStrS (
2628
  IN      CONST CHAR8               *Source,
2557
  IN      CONST CHAR8  *Source,
2629
  IN      UINTN                     Length,
2558
  IN      UINTN        Length,
2630
  OUT     CHAR16                    *Destination,
2559
  OUT     CHAR16       *Destination,
2631
  IN      UINTN                     DestMax,
2560
  IN      UINTN        DestMax,
2632
  OUT     UINTN                     *DestinationLength
2561
  OUT     UINTN        *DestinationLength
2633
  );
2562
  );
2634
2563
2635
/**
2564
/**
Lines 2650-2656 AsciiStrnToUnicodeStrS ( Link Here
2650
CHAR16
2579
CHAR16
2651
EFIAPI
2580
EFIAPI
2652
CharToUpper (
2581
CharToUpper (
2653
  IN      CHAR16                    Char
2582
  IN      CHAR16  Char
2654
  );
2583
  );
2655
2584
2656
/**
2585
/**
Lines 2669-2675 CharToUpper ( Link Here
2669
CHAR8
2598
CHAR8
2670
EFIAPI
2599
EFIAPI
2671
AsciiCharToUpper (
2600
AsciiCharToUpper (
2672
  IN      CHAR8                     Chr
2601
  IN      CHAR8  Chr
2673
  );
2602
  );
2674
2603
2675
/**
2604
/**
Lines 2695-2701 RETURN_STATUS Link Here
2695
EFIAPI
2624
EFIAPI
2696
Base64Encode (
2625
Base64Encode (
2697
  IN  CONST UINT8  *Source,
2626
  IN  CONST UINT8  *Source,
2698
  IN        UINTN   SourceLength,
2627
  IN        UINTN  SourceLength,
2699
  OUT       CHAR8  *Destination  OPTIONAL,
2628
  OUT       CHAR8  *Destination  OPTIONAL,
2700
  IN OUT    UINTN  *DestinationSize
2629
  IN OUT    UINTN  *DestinationSize
2701
  );
2630
  );
Lines 2785-2794 Base64Encode ( Link Here
2785
RETURN_STATUS
2714
RETURN_STATUS
2786
EFIAPI
2715
EFIAPI
2787
Base64Decode (
2716
Base64Decode (
2788
  IN     CONST CHAR8 *Source          OPTIONAL,
2717
  IN     CONST CHAR8  *Source          OPTIONAL,
2789
  IN     UINTN       SourceSize,
2718
  IN     UINTN        SourceSize,
2790
  OUT    UINT8       *Destination     OPTIONAL,
2719
  OUT    UINT8        *Destination     OPTIONAL,
2791
  IN OUT UINTN       *DestinationSize
2720
  IN OUT UINTN        *DestinationSize
2792
  );
2721
  );
2793
2722
2794
/**
2723
/**
Lines 2807-2816 Base64Decode ( Link Here
2807
UINT8
2736
UINT8
2808
EFIAPI
2737
EFIAPI
2809
DecimalToBcd8 (
2738
DecimalToBcd8 (
2810
  IN      UINT8                     Value
2739
  IN      UINT8  Value
2811
  );
2740
  );
2812
2741
2813
2814
/**
2742
/**
2815
  Converts an 8-bit BCD value to an 8-bit value.
2743
  Converts an 8-bit BCD value to an 8-bit value.
2816
2744
Lines 2828-2834 DecimalToBcd8 ( Link Here
2828
UINT8
2756
UINT8
2829
EFIAPI
2757
EFIAPI
2830
BcdToDecimal8 (
2758
BcdToDecimal8 (
2831
  IN      UINT8                     Value
2759
  IN      UINT8  Value
2832
  );
2760
  );
2833
2761
2834
//
2762
//
Lines 2845-2852 BcdToDecimal8 ( Link Here
2845
**/
2773
**/
2846
BOOLEAN
2774
BOOLEAN
2847
EFIAPI
2775
EFIAPI
2848
PathRemoveLastItem(
2776
PathRemoveLastItem (
2849
  IN OUT CHAR16 *Path
2777
  IN OUT CHAR16  *Path
2850
  );
2778
  );
2851
2779
2852
/**
2780
/**
Lines 2862-2871 PathRemoveLastItem( Link Here
2862
2790
2863
  @return       Returns Path, otherwise returns NULL to indicate that an error has occurred.
2791
  @return       Returns Path, otherwise returns NULL to indicate that an error has occurred.
2864
**/
2792
**/
2865
CHAR16*
2793
CHAR16 *
2866
EFIAPI
2794
EFIAPI
2867
PathCleanUpDirectories(
2795
PathCleanUpDirectories (
2868
  IN CHAR16 *Path
2796
  IN CHAR16  *Path
2869
  );
2797
  );
2870
2798
2871
//
2799
//
Lines 2937-2947 PathCleanUpDirectories( Link Here
2937
BOOLEAN
2865
BOOLEAN
2938
EFIAPI
2866
EFIAPI
2939
IsNodeInList (
2867
IsNodeInList (
2940
  IN      CONST LIST_ENTRY      *FirstEntry,
2868
  IN      CONST LIST_ENTRY  *FirstEntry,
2941
  IN      CONST LIST_ENTRY      *SecondEntry
2869
  IN      CONST LIST_ENTRY  *SecondEntry
2942
  );
2870
  );
2943
2871
2944
2945
/**
2872
/**
2946
  Initializes the head node of a doubly linked list, and returns the pointer to
2873
  Initializes the head node of a doubly linked list, and returns the pointer to
2947
  the head node of the doubly linked list.
2874
  the head node of the doubly linked list.
Lines 2961-2970 IsNodeInList ( Link Here
2961
LIST_ENTRY *
2888
LIST_ENTRY *
2962
EFIAPI
2889
EFIAPI
2963
InitializeListHead (
2890
InitializeListHead (
2964
  IN OUT  LIST_ENTRY                *ListHead
2891
  IN OUT  LIST_ENTRY  *ListHead
2965
  );
2892
  );
2966
2893
2967
2968
/**
2894
/**
2969
  Adds a node to the beginning of a doubly linked list, and returns the pointer
2895
  Adds a node to the beginning of a doubly linked list, and returns the pointer
2970
  to the head node of the doubly linked list.
2896
  to the head node of the doubly linked list.
Lines 2990-3000 InitializeListHead ( Link Here
2990
LIST_ENTRY *
2916
LIST_ENTRY *
2991
EFIAPI
2917
EFIAPI
2992
InsertHeadList (
2918
InsertHeadList (
2993
  IN OUT  LIST_ENTRY                *ListHead,
2919
  IN OUT  LIST_ENTRY  *ListHead,
2994
  IN OUT  LIST_ENTRY                *Entry
2920
  IN OUT  LIST_ENTRY  *Entry
2995
  );
2921
  );
2996
2922
2997
2998
/**
2923
/**
2999
  Adds a node to the end of a doubly linked list, and returns the pointer to
2924
  Adds a node to the end of a doubly linked list, and returns the pointer to
3000
  the head node of the doubly linked list.
2925
  the head node of the doubly linked list.
Lines 3020-3030 InsertHeadList ( Link Here
3020
LIST_ENTRY *
2945
LIST_ENTRY *
3021
EFIAPI
2946
EFIAPI
3022
InsertTailList (
2947
InsertTailList (
3023
  IN OUT  LIST_ENTRY                *ListHead,
2948
  IN OUT  LIST_ENTRY  *ListHead,
3024
  IN OUT  LIST_ENTRY                *Entry
2949
  IN OUT  LIST_ENTRY  *Entry
3025
  );
2950
  );
3026
2951
3027
3028
/**
2952
/**
3029
  Retrieves the first node of a doubly linked list.
2953
  Retrieves the first node of a doubly linked list.
3030
2954
Lines 3048-3057 InsertTailList ( Link Here
3048
LIST_ENTRY *
2972
LIST_ENTRY *
3049
EFIAPI
2973
EFIAPI
3050
GetFirstNode (
2974
GetFirstNode (
3051
  IN      CONST LIST_ENTRY          *List
2975
  IN      CONST LIST_ENTRY  *List
3052
  );
2976
  );
3053
2977
3054
3055
/**
2978
/**
3056
  Retrieves the next node of a doubly linked list.
2979
  Retrieves the next node of a doubly linked list.
3057
2980
Lines 3076-3086 GetFirstNode ( Link Here
3076
LIST_ENTRY *
2999
LIST_ENTRY *
3077
EFIAPI
3000
EFIAPI
3078
GetNextNode (
3001
GetNextNode (
3079
  IN      CONST LIST_ENTRY          *List,
3002
  IN      CONST LIST_ENTRY  *List,
3080
  IN      CONST LIST_ENTRY          *Node
3003
  IN      CONST LIST_ENTRY  *Node
3081
  );
3004
  );
3082
3005
3083
3084
/**
3006
/**
3085
  Retrieves the previous node of a doubly linked list.
3007
  Retrieves the previous node of a doubly linked list.
3086
3008
Lines 3105-3115 GetNextNode ( Link Here
3105
LIST_ENTRY *
3027
LIST_ENTRY *
3106
EFIAPI
3028
EFIAPI
3107
GetPreviousNode (
3029
GetPreviousNode (
3108
  IN      CONST LIST_ENTRY          *List,
3030
  IN      CONST LIST_ENTRY  *List,
3109
  IN      CONST LIST_ENTRY          *Node
3031
  IN      CONST LIST_ENTRY  *Node
3110
  );
3032
  );
3111
3033
3112
3113
/**
3034
/**
3114
  Checks to see if a doubly linked list is empty or not.
3035
  Checks to see if a doubly linked list is empty or not.
3115
3036
Lines 3132-3141 GetPreviousNode ( Link Here
3132
BOOLEAN
3053
BOOLEAN
3133
EFIAPI
3054
EFIAPI
3134
IsListEmpty (
3055
IsListEmpty (
3135
  IN      CONST LIST_ENTRY          *ListHead
3056
  IN      CONST LIST_ENTRY  *ListHead
3136
  );
3057
  );
3137
3058
3138
3139
/**
3059
/**
3140
  Determines if a node in a doubly linked list is the head node of a the same
3060
  Determines if a node in a doubly linked list is the head node of a the same
3141
  doubly linked list.  This function is typically used to terminate a loop that
3061
  doubly linked list.  This function is typically used to terminate a loop that
Lines 3165-3175 IsListEmpty ( Link Here
3165
BOOLEAN
3085
BOOLEAN
3166
EFIAPI
3086
EFIAPI
3167
IsNull (
3087
IsNull (
3168
  IN      CONST LIST_ENTRY          *List,
3088
  IN      CONST LIST_ENTRY  *List,
3169
  IN      CONST LIST_ENTRY          *Node
3089
  IN      CONST LIST_ENTRY  *Node
3170
  );
3090
  );
3171
3091
3172
3173
/**
3092
/**
3174
  Determines if a node the last node in a doubly linked list.
3093
  Determines if a node the last node in a doubly linked list.
3175
3094
Lines 3196-3206 IsNull ( Link Here
3196
BOOLEAN
3115
BOOLEAN
3197
EFIAPI
3116
EFIAPI
3198
IsNodeAtEnd (
3117
IsNodeAtEnd (
3199
  IN      CONST LIST_ENTRY          *List,
3118
  IN      CONST LIST_ENTRY  *List,
3200
  IN      CONST LIST_ENTRY          *Node
3119
  IN      CONST LIST_ENTRY  *Node
3201
  );
3120
  );
3202
3121
3203
3204
/**
3122
/**
3205
  Swaps the location of two nodes in a doubly linked list, and returns the
3123
  Swaps the location of two nodes in a doubly linked list, and returns the
3206
  first node after the swap.
3124
  first node after the swap.
Lines 3230-3240 IsNodeAtEnd ( Link Here
3230
LIST_ENTRY *
3148
LIST_ENTRY *
3231
EFIAPI
3149
EFIAPI
3232
SwapListEntries (
3150
SwapListEntries (
3233
  IN OUT  LIST_ENTRY                *FirstEntry,
3151
  IN OUT  LIST_ENTRY  *FirstEntry,
3234
  IN OUT  LIST_ENTRY                *SecondEntry
3152
  IN OUT  LIST_ENTRY  *SecondEntry
3235
  );
3153
  );
3236
3154
3237
3238
/**
3155
/**
3239
  Removes a node from a doubly linked list, and returns the node that follows
3156
  Removes a node from a doubly linked list, and returns the node that follows
3240
  the removed node.
3157
  the removed node.
Lines 3259-3271 SwapListEntries ( Link Here
3259
LIST_ENTRY *
3176
LIST_ENTRY *
3260
EFIAPI
3177
EFIAPI
3261
RemoveEntryList (
3178
RemoveEntryList (
3262
  IN      CONST LIST_ENTRY          *Entry
3179
  IN      CONST LIST_ENTRY  *Entry
3263
  );
3180
  );
3264
3181
3265
//
3182
//
3266
// Math Services
3183
// Math Services
3267
//
3184
//
3268
3185
3186
/**
3187
  Prototype for comparison function for any two element types.
3188
3189
  @param[in] Buffer1                  The pointer to first buffer.
3190
  @param[in] Buffer2                  The pointer to second buffer.
3191
3192
  @retval 0                           Buffer1 equal to Buffer2.
3193
  @return <0                          Buffer1 is less than Buffer2.
3194
  @return >0                          Buffer1 is greater than Buffer2.
3195
**/
3196
typedef
3197
INTN
3198
(EFIAPI *BASE_SORT_COMPARE)(
3199
  IN CONST VOID                 *Buffer1,
3200
  IN CONST VOID                 *Buffer2
3201
  );
3202
3203
/**
3204
  This function is identical to perform QuickSort,
3205
  except that is uses the pre-allocated buffer so the in place sorting does not need to
3206
  allocate and free buffers constantly.
3207
3208
  Each element must be equal sized.
3209
3210
  if BufferToSort is NULL, then ASSERT.
3211
  if CompareFunction is NULL, then ASSERT.
3212
  if BufferOneElement is NULL, then ASSERT.
3213
  if ElementSize is < 1, then ASSERT.
3214
3215
  if Count is < 2 then perform no action.
3216
3217
  @param[in, out] BufferToSort   on call a Buffer of (possibly sorted) elements
3218
                                 on return a buffer of sorted elements
3219
  @param[in] Count               the number of elements in the buffer to sort
3220
  @param[in] ElementSize         Size of an element in bytes
3221
  @param[in] CompareFunction     The function to call to perform the comparison
3222
                                 of any 2 elements
3223
  @param[out] BufferOneElement   Caller provided buffer whose size equals to ElementSize.
3224
                                 It's used by QuickSort() for swapping in sorting.
3225
**/
3226
VOID
3227
EFIAPI
3228
QuickSort (
3229
  IN OUT VOID                 *BufferToSort,
3230
  IN CONST UINTN              Count,
3231
  IN CONST UINTN              ElementSize,
3232
  IN       BASE_SORT_COMPARE  CompareFunction,
3233
  OUT VOID                    *BufferOneElement
3234
  );
3235
3269
/**
3236
/**
3270
  Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
3237
  Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
3271
  with zeros. The shifted value is returned.
3238
  with zeros. The shifted value is returned.
Lines 3284-3294 RemoveEntryList ( Link Here
3284
UINT64
3251
UINT64
3285
EFIAPI
3252
EFIAPI
3286
LShiftU64 (
3253
LShiftU64 (
3287
  IN      UINT64                    Operand,
3254
  IN      UINT64  Operand,
3288
  IN      UINTN                     Count
3255
  IN      UINTN   Count
3289
  );
3256
  );
3290
3257
3291
3292
/**
3258
/**
3293
  Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
3259
  Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
3294
  filled with zeros. The shifted value is returned.
3260
  filled with zeros. The shifted value is returned.
Lines 3307-3317 LShiftU64 ( Link Here
3307
UINT64
3273
UINT64
3308
EFIAPI
3274
EFIAPI
3309
RShiftU64 (
3275
RShiftU64 (
3310
  IN      UINT64                    Operand,
3276
  IN      UINT64  Operand,
3311
  IN      UINTN                     Count
3277
  IN      UINTN   Count
3312
  );
3278
  );
3313
3279
3314
3315
/**
3280
/**
3316
  Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
3281
  Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
3317
  with original integer's bit 63. The shifted value is returned.
3282
  with original integer's bit 63. The shifted value is returned.
Lines 3330-3340 RShiftU64 ( Link Here
3330
UINT64
3295
UINT64
3331
EFIAPI
3296
EFIAPI
3332
ARShiftU64 (
3297
ARShiftU64 (
3333
  IN      UINT64                    Operand,
3298
  IN      UINT64  Operand,
3334
  IN      UINTN                     Count
3299
  IN      UINTN   Count
3335
  );
3300
  );
3336
3301
3337
3338
/**
3302
/**
3339
  Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
3303
  Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
3340
  with the high bits that were rotated.
3304
  with the high bits that were rotated.
Lines 3354-3364 ARShiftU64 ( Link Here
3354
UINT32
3318
UINT32
3355
EFIAPI
3319
EFIAPI
3356
LRotU32 (
3320
LRotU32 (
3357
  IN      UINT32                    Operand,
3321
  IN      UINT32  Operand,
3358
  IN      UINTN                     Count
3322
  IN      UINTN   Count
3359
  );
3323
  );
3360
3324
3361
3362
/**
3325
/**
3363
  Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
3326
  Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
3364
  with the low bits that were rotated.
3327
  with the low bits that were rotated.
Lines 3378-3388 LRotU32 ( Link Here
3378
UINT32
3341
UINT32
3379
EFIAPI
3342
EFIAPI
3380
RRotU32 (
3343
RRotU32 (
3381
  IN      UINT32                    Operand,
3344
  IN      UINT32  Operand,
3382
  IN      UINTN                     Count
3345
  IN      UINTN   Count
3383
  );
3346
  );
3384
3347
3385
3386
/**
3348
/**
3387
  Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
3349
  Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
3388
  with the high bits that were rotated.
3350
  with the high bits that were rotated.
Lines 3402-3412 RRotU32 ( Link Here
3402
UINT64
3364
UINT64
3403
EFIAPI
3365
EFIAPI
3404
LRotU64 (
3366
LRotU64 (
3405
  IN      UINT64                    Operand,
3367
  IN      UINT64  Operand,
3406
  IN      UINTN                     Count
3368
  IN      UINTN   Count
3407
  );
3369
  );
3408
3370
3409
3410
/**
3371
/**
3411
  Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
3372
  Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
3412
  with the high low bits that were rotated.
3373
  with the high low bits that were rotated.
Lines 3426-3436 LRotU64 ( Link Here
3426
UINT64
3387
UINT64
3427
EFIAPI
3388
EFIAPI
3428
RRotU64 (
3389
RRotU64 (
3429
  IN      UINT64                    Operand,
3390
  IN      UINT64  Operand,
3430
  IN      UINTN                     Count
3391
  IN      UINTN   Count
3431
  );
3392
  );
3432
3393
3433
3434
/**
3394
/**
3435
  Returns the bit position of the lowest bit set in a 32-bit value.
3395
  Returns the bit position of the lowest bit set in a 32-bit value.
3436
3396
Lines 3447-3456 RRotU64 ( Link Here
3447
INTN
3407
INTN
3448
EFIAPI
3408
EFIAPI
3449
LowBitSet32 (
3409
LowBitSet32 (
3450
  IN      UINT32                    Operand
3410
  IN      UINT32  Operand
3451
  );
3411
  );
3452
3412
3453
3454
/**
3413
/**
3455
  Returns the bit position of the lowest bit set in a 64-bit value.
3414
  Returns the bit position of the lowest bit set in a 64-bit value.
3456
3415
Lines 3468-3477 LowBitSet32 ( Link Here
3468
INTN
3427
INTN
3469
EFIAPI
3428
EFIAPI
3470
LowBitSet64 (
3429
LowBitSet64 (
3471
  IN      UINT64                    Operand
3430
  IN      UINT64  Operand
3472
  );
3431
  );
3473
3432
3474
3475
/**
3433
/**
3476
  Returns the bit position of the highest bit set in a 32-bit value. Equivalent
3434
  Returns the bit position of the highest bit set in a 32-bit value. Equivalent
3477
  to log2(x).
3435
  to log2(x).
Lines 3489-3498 LowBitSet64 ( Link Here
3489
INTN
3447
INTN
3490
EFIAPI
3448
EFIAPI
3491
HighBitSet32 (
3449
HighBitSet32 (
3492
  IN      UINT32                    Operand
3450
  IN      UINT32  Operand
3493
  );
3451
  );
3494
3452
3495
3496
/**
3453
/**
3497
  Returns the bit position of the highest bit set in a 64-bit value. Equivalent
3454
  Returns the bit position of the highest bit set in a 64-bit value. Equivalent
3498
  to log2(x).
3455
  to log2(x).
Lines 3510-3519 HighBitSet32 ( Link Here
3510
INTN
3467
INTN
3511
EFIAPI
3468
EFIAPI
3512
HighBitSet64 (
3469
HighBitSet64 (
3513
  IN      UINT64                    Operand
3470
  IN      UINT64  Operand
3514
  );
3471
  );
3515
3472
3516
3517
/**
3473
/**
3518
  Returns the value of the highest bit set in a 32-bit value. Equivalent to
3474
  Returns the value of the highest bit set in a 32-bit value. Equivalent to
3519
  1 << log2(x).
3475
  1 << log2(x).
Lines 3530-3539 HighBitSet64 ( Link Here
3530
UINT32
3486
UINT32
3531
EFIAPI
3487
EFIAPI
3532
GetPowerOfTwo32 (
3488
GetPowerOfTwo32 (
3533
  IN      UINT32                    Operand
3489
  IN      UINT32  Operand
3534
  );
3490
  );
3535
3491
3536
3537
/**
3492
/**
3538
  Returns the value of the highest bit set in a 64-bit value. Equivalent to
3493
  Returns the value of the highest bit set in a 64-bit value. Equivalent to
3539
  1 << log2(x).
3494
  1 << log2(x).
Lines 3550-3559 GetPowerOfTwo32 ( Link Here
3550
UINT64
3505
UINT64
3551
EFIAPI
3506
EFIAPI
3552
GetPowerOfTwo64 (
3507
GetPowerOfTwo64 (
3553
  IN      UINT64                    Operand
3508
  IN      UINT64  Operand
3554
  );
3509
  );
3555
3510
3556
3557
/**
3511
/**
3558
  Switches the endianness of a 16-bit integer.
3512
  Switches the endianness of a 16-bit integer.
3559
3513
Lines 3569-3578 GetPowerOfTwo64 ( Link Here
3569
UINT16
3523
UINT16
3570
EFIAPI
3524
EFIAPI
3571
SwapBytes16 (
3525
SwapBytes16 (
3572
  IN      UINT16                    Value
3526
  IN      UINT16  Value
3573
  );
3527
  );
3574
3528
3575
3576
/**
3529
/**
3577
  Switches the endianness of a 32-bit integer.
3530
  Switches the endianness of a 32-bit integer.
3578
3531
Lines 3588-3597 SwapBytes16 ( Link Here
3588
UINT32
3541
UINT32
3589
EFIAPI
3542
EFIAPI
3590
SwapBytes32 (
3543
SwapBytes32 (
3591
  IN      UINT32                    Value
3544
  IN      UINT32  Value
3592
  );
3545
  );
3593
3546
3594
3595
/**
3547
/**
3596
  Switches the endianness of a 64-bit integer.
3548
  Switches the endianness of a 64-bit integer.
3597
3549
Lines 3607-3616 SwapBytes32 ( Link Here
3607
UINT64
3559
UINT64
3608
EFIAPI
3560
EFIAPI
3609
SwapBytes64 (
3561
SwapBytes64 (
3610
  IN      UINT64                    Value
3562
  IN      UINT64  Value
3611
  );
3563
  );
3612
3564
3613
3614
/**
3565
/**
3615
  Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
3566
  Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
3616
  generates a 64-bit unsigned result.
3567
  generates a 64-bit unsigned result.
Lines 3628-3638 SwapBytes64 ( Link Here
3628
UINT64
3579
UINT64
3629
EFIAPI
3580
EFIAPI
3630
MultU64x32 (
3581
MultU64x32 (
3631
  IN      UINT64                    Multiplicand,
3582
  IN      UINT64  Multiplicand,
3632
  IN      UINT32                    Multiplier
3583
  IN      UINT32  Multiplier
3633
  );
3584
  );
3634
3585
3635
3636
/**
3586
/**
3637
  Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
3587
  Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
3638
  generates a 64-bit unsigned result.
3588
  generates a 64-bit unsigned result.
Lines 3650-3660 MultU64x32 ( Link Here
3650
UINT64
3600
UINT64
3651
EFIAPI
3601
EFIAPI
3652
MultU64x64 (
3602
MultU64x64 (
3653
  IN      UINT64                    Multiplicand,
3603
  IN      UINT64  Multiplicand,
3654
  IN      UINT64                    Multiplier
3604
  IN      UINT64  Multiplier
3655
  );
3605
  );
3656
3606
3657
3658
/**
3607
/**
3659
  Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
3608
  Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
3660
  64-bit signed result.
3609
  64-bit signed result.
Lines 3672-3682 MultU64x64 ( Link Here
3672
INT64
3621
INT64
3673
EFIAPI
3622
EFIAPI
3674
MultS64x64 (
3623
MultS64x64 (
3675
  IN      INT64                     Multiplicand,
3624
  IN      INT64  Multiplicand,
3676
  IN      INT64                     Multiplier
3625
  IN      INT64  Multiplier
3677
  );
3626
  );
3678
3627
3679
3680
/**
3628
/**
3681
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3629
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3682
  a 64-bit unsigned result.
3630
  a 64-bit unsigned result.
Lines 3696-3706 MultS64x64 ( Link Here
3696
UINT64
3644
UINT64
3697
EFIAPI
3645
EFIAPI
3698
DivU64x32 (
3646
DivU64x32 (
3699
  IN      UINT64                    Dividend,
3647
  IN      UINT64  Dividend,
3700
  IN      UINT32                    Divisor
3648
  IN      UINT32  Divisor
3701
  );
3649
  );
3702
3650
3703
3704
/**
3651
/**
3705
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3652
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3706
  a 32-bit unsigned remainder.
3653
  a 32-bit unsigned remainder.
Lines 3720-3730 DivU64x32 ( Link Here
3720
UINT32
3667
UINT32
3721
EFIAPI
3668
EFIAPI
3722
ModU64x32 (
3669
ModU64x32 (
3723
  IN      UINT64                    Dividend,
3670
  IN      UINT64  Dividend,
3724
  IN      UINT32                    Divisor
3671
  IN      UINT32  Divisor
3725
  );
3672
  );
3726
3673
3727
3728
/**
3674
/**
3729
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3675
  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
3730
  a 64-bit unsigned result and an optional 32-bit unsigned remainder.
3676
  a 64-bit unsigned result and an optional 32-bit unsigned remainder.
Lines 3747-3758 ModU64x32 ( Link Here
3747
UINT64
3693
UINT64
3748
EFIAPI
3694
EFIAPI
3749
DivU64x32Remainder (
3695
DivU64x32Remainder (
3750
  IN      UINT64                    Dividend,
3696
  IN      UINT64  Dividend,
3751
  IN      UINT32                    Divisor,
3697
  IN      UINT32  Divisor,
3752
  OUT     UINT32                    *Remainder  OPTIONAL
3698
  OUT     UINT32  *Remainder  OPTIONAL
3753
  );
3699
  );
3754
3700
3755
3756
/**
3701
/**
3757
  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
3702
  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
3758
  a 64-bit unsigned result and an optional 64-bit unsigned remainder.
3703
  a 64-bit unsigned result and an optional 64-bit unsigned remainder.
Lines 3775-3786 DivU64x32Remainder ( Link Here
3775
UINT64
3720
UINT64
3776
EFIAPI
3721
EFIAPI
3777
DivU64x64Remainder (
3722
DivU64x64Remainder (
3778
  IN      UINT64                    Dividend,
3723
  IN      UINT64  Dividend,
3779
  IN      UINT64                    Divisor,
3724
  IN      UINT64  Divisor,
3780
  OUT     UINT64                    *Remainder  OPTIONAL
3725
  OUT     UINT64  *Remainder  OPTIONAL
3781
  );
3726
  );
3782
3727
3783
3784
/**
3728
/**
3785
  Divides a 64-bit signed integer by a 64-bit signed integer and generates a
3729
  Divides a 64-bit signed integer by a 64-bit signed integer and generates a
3786
  64-bit signed result and a optional 64-bit signed remainder.
3730
  64-bit signed result and a optional 64-bit signed remainder.
Lines 3807-3818 DivU64x64Remainder ( Link Here
3807
INT64
3751
INT64
3808
EFIAPI
3752
EFIAPI
3809
DivS64x64Remainder (
3753
DivS64x64Remainder (
3810
  IN      INT64                     Dividend,
3754
  IN      INT64  Dividend,
3811
  IN      INT64                     Divisor,
3755
  IN      INT64  Divisor,
3812
  OUT     INT64                     *Remainder  OPTIONAL
3756
  OUT     INT64  *Remainder  OPTIONAL
3813
  );
3757
  );
3814
3758
3815
3816
/**
3759
/**
3817
  Reads a 16-bit value from memory that may be unaligned.
3760
  Reads a 16-bit value from memory that may be unaligned.
3818
3761
Lines 3829-3838 DivS64x64Remainder ( Link Here
3829
UINT16
3772
UINT16
3830
EFIAPI
3773
EFIAPI
3831
ReadUnaligned16 (
3774
ReadUnaligned16 (
3832
  IN CONST UINT16              *Buffer
3775
  IN CONST UINT16  *Buffer
3833
  );
3776
  );
3834
3777
3835
3836
/**
3778
/**
3837
  Writes a 16-bit value to memory that may be unaligned.
3779
  Writes a 16-bit value to memory that may be unaligned.
3838
3780
Lines 3851-3861 ReadUnaligned16 ( Link Here
3851
UINT16
3793
UINT16
3852
EFIAPI
3794
EFIAPI
3853
WriteUnaligned16 (
3795
WriteUnaligned16 (
3854
  OUT UINT16                    *Buffer,
3796
  OUT UINT16  *Buffer,
3855
  IN  UINT16                    Value
3797
  IN  UINT16  Value
3856
  );
3798
  );
3857
3799
3858
3859
/**
3800
/**
3860
  Reads a 24-bit value from memory that may be unaligned.
3801
  Reads a 24-bit value from memory that may be unaligned.
3861
3802
Lines 3872-3881 WriteUnaligned16 ( Link Here
3872
UINT32
3813
UINT32
3873
EFIAPI
3814
EFIAPI
3874
ReadUnaligned24 (
3815
ReadUnaligned24 (
3875
  IN CONST UINT32              *Buffer
3816
  IN CONST UINT32  *Buffer
3876
  );
3817
  );
3877
3818
3878
3879
/**
3819
/**
3880
  Writes a 24-bit value to memory that may be unaligned.
3820
  Writes a 24-bit value to memory that may be unaligned.
3881
3821
Lines 3894-3904 ReadUnaligned24 ( Link Here
3894
UINT32
3834
UINT32
3895
EFIAPI
3835
EFIAPI
3896
WriteUnaligned24 (
3836
WriteUnaligned24 (
3897
  OUT UINT32                    *Buffer,
3837
  OUT UINT32  *Buffer,
3898
  IN  UINT32                    Value
3838
  IN  UINT32  Value
3899
  );
3839
  );
3900
3840
3901
3902
/**
3841
/**
3903
  Reads a 32-bit value from memory that may be unaligned.
3842
  Reads a 32-bit value from memory that may be unaligned.
3904
3843
Lines 3915-3924 WriteUnaligned24 ( Link Here
3915
UINT32
3854
UINT32
3916
EFIAPI
3855
EFIAPI
3917
ReadUnaligned32 (
3856
ReadUnaligned32 (
3918
  IN CONST UINT32              *Buffer
3857
  IN CONST UINT32  *Buffer
3919
  );
3858
  );
3920
3859
3921
3922
/**
3860
/**
3923
  Writes a 32-bit value to memory that may be unaligned.
3861
  Writes a 32-bit value to memory that may be unaligned.
3924
3862
Lines 3937-3947 ReadUnaligned32 ( Link Here
3937
UINT32
3875
UINT32
3938
EFIAPI
3876
EFIAPI
3939
WriteUnaligned32 (
3877
WriteUnaligned32 (
3940
  OUT UINT32                    *Buffer,
3878
  OUT UINT32  *Buffer,
3941
  IN  UINT32                    Value
3879
  IN  UINT32  Value
3942
  );
3880
  );
3943
3881
3944
3945
/**
3882
/**
3946
  Reads a 64-bit value from memory that may be unaligned.
3883
  Reads a 64-bit value from memory that may be unaligned.
3947
3884
Lines 3958-3967 WriteUnaligned32 ( Link Here
3958
UINT64
3895
UINT64
3959
EFIAPI
3896
EFIAPI
3960
ReadUnaligned64 (
3897
ReadUnaligned64 (
3961
  IN CONST UINT64              *Buffer
3898
  IN CONST UINT64  *Buffer
3962
  );
3899
  );
3963
3900
3964
3965
/**
3901
/**
3966
  Writes a 64-bit value to memory that may be unaligned.
3902
  Writes a 64-bit value to memory that may be unaligned.
3967
3903
Lines 3980-3990 ReadUnaligned64 ( Link Here
3980
UINT64
3916
UINT64
3981
EFIAPI
3917
EFIAPI
3982
WriteUnaligned64 (
3918
WriteUnaligned64 (
3983
  OUT UINT64                    *Buffer,
3919
  OUT UINT64  *Buffer,
3984
  IN  UINT64                    Value
3920
  IN  UINT64  Value
3985
  );
3921
  );
3986
3922
3987
3988
//
3923
//
3989
// Bit Field Functions
3924
// Bit Field Functions
3990
//
3925
//
Lines 4011-4022 WriteUnaligned64 ( Link Here
4011
UINT8
3946
UINT8
4012
EFIAPI
3947
EFIAPI
4013
BitFieldRead8 (
3948
BitFieldRead8 (
4014
  IN      UINT8                     Operand,
3949
  IN      UINT8  Operand,
4015
  IN      UINTN                     StartBit,
3950
  IN      UINTN  StartBit,
4016
  IN      UINTN                     EndBit
3951
  IN      UINTN  EndBit
4017
  );
3952
  );
4018
3953
4019
4020
/**
3954
/**
4021
  Writes a bit field to an 8-bit value, and returns the result.
3955
  Writes a bit field to an 8-bit value, and returns the result.
4022
3956
Lines 4043-4055 BitFieldRead8 ( Link Here
4043
UINT8
3977
UINT8
4044
EFIAPI
3978
EFIAPI
4045
BitFieldWrite8 (
3979
BitFieldWrite8 (
4046
  IN      UINT8                     Operand,
3980
  IN      UINT8  Operand,
4047
  IN      UINTN                     StartBit,
3981
  IN      UINTN  StartBit,
4048
  IN      UINTN                     EndBit,
3982
  IN      UINTN  EndBit,
4049
  IN      UINT8                     Value
3983
  IN      UINT8  Value
4050
  );
3984
  );
4051
3985
4052
4053
/**
3986
/**
4054
  Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
3987
  Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
4055
  result.
3988
  result.
Lines 4077-4089 BitFieldWrite8 ( Link Here
4077
UINT8
4010
UINT8
4078
EFIAPI
4011
EFIAPI
4079
BitFieldOr8 (
4012
BitFieldOr8 (
4080
  IN      UINT8                     Operand,
4013
  IN      UINT8  Operand,
4081
  IN      UINTN                     StartBit,
4014
  IN      UINTN  StartBit,
4082
  IN      UINTN                     EndBit,
4015
  IN      UINTN  EndBit,
4083
  IN      UINT8                     OrData
4016
  IN      UINT8  OrData
4084
  );
4017
  );
4085
4018
4086
4087
/**
4019
/**
4088
  Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
4020
  Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
4089
  the result.
4021
  the result.
Lines 4111-4123 BitFieldOr8 ( Link Here
4111
UINT8
4043
UINT8
4112
EFIAPI
4044
EFIAPI
4113
BitFieldAnd8 (
4045
BitFieldAnd8 (
4114
  IN      UINT8                     Operand,
4046
  IN      UINT8  Operand,
4115
  IN      UINTN                     StartBit,
4047
  IN      UINTN  StartBit,
4116
  IN      UINTN                     EndBit,
4048
  IN      UINTN  EndBit,
4117
  IN      UINT8                     AndData
4049
  IN      UINT8  AndData
4118
  );
4050
  );
4119
4051
4120
4121
/**
4052
/**
4122
  Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
4053
  Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
4123
  bitwise OR, and returns the result.
4054
  bitwise OR, and returns the result.
Lines 4148-4161 BitFieldAnd8 ( Link Here
4148
UINT8
4079
UINT8
4149
EFIAPI
4080
EFIAPI
4150
BitFieldAndThenOr8 (
4081
BitFieldAndThenOr8 (
4151
  IN      UINT8                     Operand,
4082
  IN      UINT8  Operand,
4152
  IN      UINTN                     StartBit,
4083
  IN      UINTN  StartBit,
4153
  IN      UINTN                     EndBit,
4084
  IN      UINTN  EndBit,
4154
  IN      UINT8                     AndData,
4085
  IN      UINT8  AndData,
4155
  IN      UINT8                     OrData
4086
  IN      UINT8  OrData
4156
  );
4087
  );
4157
4088
4158
4159
/**
4089
/**
4160
  Returns a bit field from a 16-bit value.
4090
  Returns a bit field from a 16-bit value.
4161
4091
Lines 4178-4189 BitFieldAndThenOr8 ( Link Here
4178
UINT16
4108
UINT16
4179
EFIAPI
4109
EFIAPI
4180
BitFieldRead16 (
4110
BitFieldRead16 (
4181
  IN      UINT16                    Operand,
4111
  IN      UINT16  Operand,
4182
  IN      UINTN                     StartBit,
4112
  IN      UINTN   StartBit,
4183
  IN      UINTN                     EndBit
4113
  IN      UINTN   EndBit
4184
  );
4114
  );
4185
4115
4186
4187
/**
4116
/**
4188
  Writes a bit field to a 16-bit value, and returns the result.
4117
  Writes a bit field to a 16-bit value, and returns the result.
4189
4118
Lines 4210-4222 BitFieldRead16 ( Link Here
4210
UINT16
4139
UINT16
4211
EFIAPI
4140
EFIAPI
4212
BitFieldWrite16 (
4141
BitFieldWrite16 (
4213
  IN      UINT16                    Operand,
4142
  IN      UINT16  Operand,
4214
  IN      UINTN                     StartBit,
4143
  IN      UINTN   StartBit,
4215
  IN      UINTN                     EndBit,
4144
  IN      UINTN   EndBit,
4216
  IN      UINT16                    Value
4145
  IN      UINT16  Value
4217
  );
4146
  );
4218
4147
4219
4220
/**
4148
/**
4221
  Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
4149
  Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
4222
  result.
4150
  result.
Lines 4244-4256 BitFieldWrite16 ( Link Here
4244
UINT16
4172
UINT16
4245
EFIAPI
4173
EFIAPI
4246
BitFieldOr16 (
4174
BitFieldOr16 (
4247
  IN      UINT16                    Operand,
4175
  IN      UINT16  Operand,
4248
  IN      UINTN                     StartBit,
4176
  IN      UINTN   StartBit,
4249
  IN      UINTN                     EndBit,
4177
  IN      UINTN   EndBit,
4250
  IN      UINT16                    OrData
4178
  IN      UINT16  OrData
4251
  );
4179
  );
4252
4180
4253
4254
/**
4181
/**
4255
  Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
4182
  Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
4256
  the result.
4183
  the result.
Lines 4278-4290 BitFieldOr16 ( Link Here
4278
UINT16
4205
UINT16
4279
EFIAPI
4206
EFIAPI
4280
BitFieldAnd16 (
4207
BitFieldAnd16 (
4281
  IN      UINT16                    Operand,
4208
  IN      UINT16  Operand,
4282
  IN      UINTN                     StartBit,
4209
  IN      UINTN   StartBit,
4283
  IN      UINTN                     EndBit,
4210
  IN      UINTN   EndBit,
4284
  IN      UINT16                    AndData
4211
  IN      UINT16  AndData
4285
  );
4212
  );
4286
4213
4287
4288
/**
4214
/**
4289
  Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
4215
  Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
4290
  bitwise OR, and returns the result.
4216
  bitwise OR, and returns the result.
Lines 4315-4328 BitFieldAnd16 ( Link Here
4315
UINT16
4241
UINT16
4316
EFIAPI
4242
EFIAPI
4317
BitFieldAndThenOr16 (
4243
BitFieldAndThenOr16 (
4318
  IN      UINT16                    Operand,
4244
  IN      UINT16  Operand,
4319
  IN      UINTN                     StartBit,
4245
  IN      UINTN   StartBit,
4320
  IN      UINTN                     EndBit,
4246
  IN      UINTN   EndBit,
4321
  IN      UINT16                    AndData,
4247
  IN      UINT16  AndData,
4322
  IN      UINT16                    OrData
4248
  IN      UINT16  OrData
4323
  );
4249
  );
4324
4250
4325
4326
/**
4251
/**
4327
  Returns a bit field from a 32-bit value.
4252
  Returns a bit field from a 32-bit value.
4328
4253
Lines 4345-4356 BitFieldAndThenOr16 ( Link Here
4345
UINT32
4270
UINT32
4346
EFIAPI
4271
EFIAPI
4347
BitFieldRead32 (
4272
BitFieldRead32 (
4348
  IN      UINT32                    Operand,
4273
  IN      UINT32  Operand,
4349
  IN      UINTN                     StartBit,
4274
  IN      UINTN   StartBit,
4350
  IN      UINTN                     EndBit
4275
  IN      UINTN   EndBit
4351
  );
4276
  );
4352
4277
4353
4354
/**
4278
/**
4355
  Writes a bit field to a 32-bit value, and returns the result.
4279
  Writes a bit field to a 32-bit value, and returns the result.
4356
4280
Lines 4377-4389 BitFieldRead32 ( Link Here
4377
UINT32
4301
UINT32
4378
EFIAPI
4302
EFIAPI
4379
BitFieldWrite32 (
4303
BitFieldWrite32 (
4380
  IN      UINT32                    Operand,
4304
  IN      UINT32  Operand,
4381
  IN      UINTN                     StartBit,
4305
  IN      UINTN   StartBit,
4382
  IN      UINTN                     EndBit,
4306
  IN      UINTN   EndBit,
4383
  IN      UINT32                    Value
4307
  IN      UINT32  Value
4384
  );
4308
  );
4385
4309
4386
4387
/**
4310
/**
4388
  Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
4311
  Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
4389
  result.
4312
  result.
Lines 4411-4423 BitFieldWrite32 ( Link Here
4411
UINT32
4334
UINT32
4412
EFIAPI
4335
EFIAPI
4413
BitFieldOr32 (
4336
BitFieldOr32 (
4414
  IN      UINT32                    Operand,
4337
  IN      UINT32  Operand,
4415
  IN      UINTN                     StartBit,
4338
  IN      UINTN   StartBit,
4416
  IN      UINTN                     EndBit,
4339
  IN      UINTN   EndBit,
4417
  IN      UINT32                    OrData
4340
  IN      UINT32  OrData
4418
  );
4341
  );
4419
4342
4420
4421
/**
4343
/**
4422
  Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
4344
  Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
4423
  the result.
4345
  the result.
Lines 4445-4457 BitFieldOr32 ( Link Here
4445
UINT32
4367
UINT32
4446
EFIAPI
4368
EFIAPI
4447
BitFieldAnd32 (
4369
BitFieldAnd32 (
4448
  IN      UINT32                    Operand,
4370
  IN      UINT32  Operand,
4449
  IN      UINTN                     StartBit,
4371
  IN      UINTN   StartBit,
4450
  IN      UINTN                     EndBit,
4372
  IN      UINTN   EndBit,
4451
  IN      UINT32                    AndData
4373
  IN      UINT32  AndData
4452
  );
4374
  );
4453
4375
4454
4455
/**
4376
/**
4456
  Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
4377
  Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
4457
  bitwise OR, and returns the result.
4378
  bitwise OR, and returns the result.
Lines 4482-4495 BitFieldAnd32 ( Link Here
4482
UINT32
4403
UINT32
4483
EFIAPI
4404
EFIAPI
4484
BitFieldAndThenOr32 (
4405
BitFieldAndThenOr32 (
4485
  IN      UINT32                    Operand,
4406
  IN      UINT32  Operand,
4486
  IN      UINTN                     StartBit,
4407
  IN      UINTN   StartBit,
4487
  IN      UINTN                     EndBit,
4408
  IN      UINTN   EndBit,
4488
  IN      UINT32                    AndData,
4409
  IN      UINT32  AndData,
4489
  IN      UINT32                    OrData
4410
  IN      UINT32  OrData
4490
  );
4411
  );
4491
4412
4492
4493
/**
4413
/**
4494
  Returns a bit field from a 64-bit value.
4414
  Returns a bit field from a 64-bit value.
4495
4415
Lines 4512-4523 BitFieldAndThenOr32 ( Link Here
4512
UINT64
4432
UINT64
4513
EFIAPI
4433
EFIAPI
4514
BitFieldRead64 (
4434
BitFieldRead64 (
4515
  IN      UINT64                    Operand,
4435
  IN      UINT64  Operand,
4516
  IN      UINTN                     StartBit,
4436
  IN      UINTN   StartBit,
4517
  IN      UINTN                     EndBit
4437
  IN      UINTN   EndBit
4518
  );
4438
  );
4519
4439
4520
4521
/**
4440
/**
4522
  Writes a bit field to a 64-bit value, and returns the result.
4441
  Writes a bit field to a 64-bit value, and returns the result.
4523
4442
Lines 4544-4556 BitFieldRead64 ( Link Here
4544
UINT64
4463
UINT64
4545
EFIAPI
4464
EFIAPI
4546
BitFieldWrite64 (
4465
BitFieldWrite64 (
4547
  IN      UINT64                    Operand,
4466
  IN      UINT64  Operand,
4548
  IN      UINTN                     StartBit,
4467
  IN      UINTN   StartBit,
4549
  IN      UINTN                     EndBit,
4468
  IN      UINTN   EndBit,
4550
  IN      UINT64                    Value
4469
  IN      UINT64  Value
4551
  );
4470
  );
4552
4471
4553
4554
/**
4472
/**
4555
  Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
4473
  Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
4556
  result.
4474
  result.
Lines 4578-4590 BitFieldWrite64 ( Link Here
4578
UINT64
4496
UINT64
4579
EFIAPI
4497
EFIAPI
4580
BitFieldOr64 (
4498
BitFieldOr64 (
4581
  IN      UINT64                    Operand,
4499
  IN      UINT64  Operand,
4582
  IN      UINTN                     StartBit,
4500
  IN      UINTN   StartBit,
4583
  IN      UINTN                     EndBit,
4501
  IN      UINTN   EndBit,
4584
  IN      UINT64                    OrData
4502
  IN      UINT64  OrData
4585
  );
4503
  );
4586
4504
4587
4588
/**
4505
/**
4589
  Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
4506
  Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
4590
  the result.
4507
  the result.
Lines 4612-4624 BitFieldOr64 ( Link Here
4612
UINT64
4529
UINT64
4613
EFIAPI
4530
EFIAPI
4614
BitFieldAnd64 (
4531
BitFieldAnd64 (
4615
  IN      UINT64                    Operand,
4532
  IN      UINT64  Operand,
4616
  IN      UINTN                     StartBit,
4533
  IN      UINTN   StartBit,
4617
  IN      UINTN                     EndBit,
4534
  IN      UINTN   EndBit,
4618
  IN      UINT64                    AndData
4535
  IN      UINT64  AndData
4619
  );
4536
  );
4620
4537
4621
4622
/**
4538
/**
4623
  Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
4539
  Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
4624
  bitwise OR, and returns the result.
4540
  bitwise OR, and returns the result.
Lines 4649-4659 BitFieldAnd64 ( Link Here
4649
UINT64
4565
UINT64
4650
EFIAPI
4566
EFIAPI
4651
BitFieldAndThenOr64 (
4567
BitFieldAndThenOr64 (
4652
  IN      UINT64                    Operand,
4568
  IN      UINT64  Operand,
4653
  IN      UINTN                     StartBit,
4569
  IN      UINTN   StartBit,
4654
  IN      UINTN                     EndBit,
4570
  IN      UINTN   EndBit,
4655
  IN      UINT64                    AndData,
4571
  IN      UINT64  AndData,
4656
  IN      UINT64                    OrData
4572
  IN      UINT64  OrData
4657
  );
4573
  );
4658
4574
4659
/**
4575
/**
Lines 4679-4687 BitFieldAndThenOr64 ( Link Here
4679
UINT8
4595
UINT8
4680
EFIAPI
4596
EFIAPI
4681
BitFieldCountOnes32 (
4597
BitFieldCountOnes32 (
4682
  IN       UINT32                   Operand,
4598
  IN       UINT32  Operand,
4683
  IN       UINTN                    StartBit,
4599
  IN       UINTN   StartBit,
4684
  IN       UINTN                    EndBit
4600
  IN       UINTN   EndBit
4685
  );
4601
  );
4686
4602
4687
/**
4603
/**
Lines 4707-4715 BitFieldCountOnes32 ( Link Here
4707
UINT8
4623
UINT8
4708
EFIAPI
4624
EFIAPI
4709
BitFieldCountOnes64 (
4625
BitFieldCountOnes64 (
4710
  IN       UINT64                   Operand,
4626
  IN       UINT64  Operand,
4711
  IN       UINTN                    StartBit,
4627
  IN       UINTN   StartBit,
4712
  IN       UINTN                    EndBit
4628
  IN       UINTN   EndBit
4713
  );
4629
  );
4714
4630
4715
//
4631
//
Lines 4737-4747 BitFieldCountOnes64 ( Link Here
4737
UINT8
4653
UINT8
4738
EFIAPI
4654
EFIAPI
4739
CalculateSum8 (
4655
CalculateSum8 (
4740
  IN      CONST UINT8              *Buffer,
4656
  IN      CONST UINT8  *Buffer,
4741
  IN      UINTN                     Length
4657
  IN      UINTN        Length
4742
  );
4658
  );
4743
4659
4744
4745
/**
4660
/**
4746
  Returns the two's complement checksum of all elements in a buffer
4661
  Returns the two's complement checksum of all elements in a buffer
4747
  of 8-bit values.
4662
  of 8-bit values.
Lines 4763-4773 CalculateSum8 ( Link Here
4763
UINT8
4678
UINT8
4764
EFIAPI
4679
EFIAPI
4765
CalculateCheckSum8 (
4680
CalculateCheckSum8 (
4766
  IN      CONST UINT8              *Buffer,
4681
  IN      CONST UINT8  *Buffer,
4767
  IN      UINTN                     Length
4682
  IN      UINTN        Length
4768
  );
4683
  );
4769
4684
4770
4771
/**
4685
/**
4772
  Returns the sum of all elements in a buffer of 16-bit values.  During
4686
  Returns the sum of all elements in a buffer of 16-bit values.  During
4773
  calculation, the carry bits are dropped.
4687
  calculation, the carry bits are dropped.
Lines 4790-4800 CalculateCheckSum8 ( Link Here
4790
UINT16
4704
UINT16
4791
EFIAPI
4705
EFIAPI
4792
CalculateSum16 (
4706
CalculateSum16 (
4793
  IN      CONST UINT16             *Buffer,
4707
  IN      CONST UINT16  *Buffer,
4794
  IN      UINTN                     Length
4708
  IN      UINTN         Length
4795
  );
4709
  );
4796
4710
4797
4798
/**
4711
/**
4799
  Returns the two's complement checksum of all elements in a buffer of
4712
  Returns the two's complement checksum of all elements in a buffer of
4800
  16-bit values.
4713
  16-bit values.
Lines 4818-4828 CalculateSum16 ( Link Here
4818
UINT16
4731
UINT16
4819
EFIAPI
4732
EFIAPI
4820
CalculateCheckSum16 (
4733
CalculateCheckSum16 (
4821
  IN      CONST UINT16             *Buffer,
4734
  IN      CONST UINT16  *Buffer,
4822
  IN      UINTN                     Length
4735
  IN      UINTN         Length
4823
  );
4736
  );
4824
4737
4825
4826
/**
4738
/**
4827
  Returns the sum of all elements in a buffer of 32-bit values. During
4739
  Returns the sum of all elements in a buffer of 32-bit values. During
4828
  calculation, the carry bits are dropped.
4740
  calculation, the carry bits are dropped.
Lines 4845-4855 CalculateCheckSum16 ( Link Here
4845
UINT32
4757
UINT32
4846
EFIAPI
4758
EFIAPI
4847
CalculateSum32 (
4759
CalculateSum32 (
4848
  IN      CONST UINT32             *Buffer,
4760
  IN      CONST UINT32  *Buffer,
4849
  IN      UINTN                     Length
4761
  IN      UINTN         Length
4850
  );
4762
  );
4851
4763
4852
4853
/**
4764
/**
4854
  Returns the two's complement checksum of all elements in a buffer of
4765
  Returns the two's complement checksum of all elements in a buffer of
4855
  32-bit values.
4766
  32-bit values.
Lines 4873-4883 CalculateSum32 ( Link Here
4873
UINT32
4784
UINT32
4874
EFIAPI
4785
EFIAPI
4875
CalculateCheckSum32 (
4786
CalculateCheckSum32 (
4876
  IN      CONST UINT32             *Buffer,
4787
  IN      CONST UINT32  *Buffer,
4877
  IN      UINTN                     Length
4788
  IN      UINTN         Length
4878
  );
4789
  );
4879
4790
4880
4881
/**
4791
/**
4882
  Returns the sum of all elements in a buffer of 64-bit values.  During
4792
  Returns the sum of all elements in a buffer of 64-bit values.  During
4883
  calculation, the carry bits are dropped.
4793
  calculation, the carry bits are dropped.
Lines 4900-4910 CalculateCheckSum32 ( Link Here
4900
UINT64
4810
UINT64
4901
EFIAPI
4811
EFIAPI
4902
CalculateSum64 (
4812
CalculateSum64 (
4903
  IN      CONST UINT64             *Buffer,
4813
  IN      CONST UINT64  *Buffer,
4904
  IN      UINTN                     Length
4814
  IN      UINTN         Length
4905
  );
4815
  );
4906
4816
4907
4908
/**
4817
/**
4909
  Returns the two's complement checksum of all elements in a buffer of
4818
  Returns the two's complement checksum of all elements in a buffer of
4910
  64-bit values.
4819
  64-bit values.
Lines 4928-4935 CalculateSum64 ( Link Here
4928
UINT64
4837
UINT64
4929
EFIAPI
4838
EFIAPI
4930
CalculateCheckSum64 (
4839
CalculateCheckSum64 (
4931
  IN      CONST UINT64             *Buffer,
4840
  IN      CONST UINT64  *Buffer,
4932
  IN      UINTN                     Length
4841
  IN      UINTN         Length
4933
  );
4842
  );
4934
4843
4935
/**
4844
/**
Lines 4947-4955 CalculateCheckSum64 ( Link Here
4947
**/
4856
**/
4948
UINT32
4857
UINT32
4949
EFIAPI
4858
EFIAPI
4950
CalculateCrc32(
4859
CalculateCrc32 (
4951
  IN  VOID                         *Buffer,
4860
  IN  VOID   *Buffer,
4952
  IN  UINTN                        Length
4861
  IN  UINTN  Length
4862
  );
4863
4864
/**
4865
   Calculates the CRC16-ANSI checksum of the given buffer.
4866
4867
   @param[in]      Buffer        Pointer to the buffer.
4868
   @param[in]      Length        Length of the buffer, in bytes.
4869
   @param[in]      InitialValue  Initial value of the CRC.
4870
4871
   @return The CRC16-ANSI checksum.
4872
**/
4873
UINT16
4874
EFIAPI
4875
CalculateCrc16Ansi (
4876
  IN  CONST VOID  *Buffer,
4877
  IN  UINTN       Length,
4878
  IN  UINT16      InitialValue
4879
  );
4880
4881
//
4882
// Initial value for the CRC16-ANSI algorithm, when no prior checksum has been calculated.
4883
//
4884
#define CRC16ANSI_INIT  0xffff
4885
4886
/**
4887
   Calculates the CRC32c checksum of the given buffer.
4888
4889
   @param[in]      Buffer        Pointer to the buffer.
4890
   @param[in]      Length        Length of the buffer, in bytes.
4891
   @param[in]      InitialValue  Initial value of the CRC.
4892
4893
   @return The CRC32c checksum.
4894
**/
4895
UINT32
4896
EFIAPI
4897
CalculateCrc32c (
4898
  IN CONST VOID  *Buffer,
4899
  IN UINTN       Length,
4900
  IN UINT32      InitialValue
4953
  );
4901
  );
4954
4902
4955
//
4903
//
Lines 4961-4976 CalculateCrc32( Link Here
4961
4909
4962
  @param  Context1        Context1 parameter passed into SwitchStack().
4910
  @param  Context1        Context1 parameter passed into SwitchStack().
4963
  @param  Context2        Context2 parameter passed into SwitchStack().
4911
  @param  Context2        Context2 parameter passed into SwitchStack().
4964
4965
**/
4912
**/
4966
typedef
4913
typedef
4967
VOID
4914
VOID
4968
(EFIAPI *SWITCH_STACK_ENTRY_POINT)(
4915
(EFIAPI *SWITCH_STACK_ENTRY_POINT)(
4969
  IN      VOID                      *Context1,  OPTIONAL
4916
  IN      VOID                      *Context1   OPTIONAL,
4970
  IN      VOID                      *Context2   OPTIONAL
4917
  IN      VOID                      *Context2   OPTIONAL
4971
  );
4918
  );
4972
4919
4973
4974
/**
4920
/**
4975
  Used to serialize load and store operations.
4921
  Used to serialize load and store operations.
4976
4922
Lines 4984-4990 MemoryFence ( Link Here
4984
  VOID
4930
  VOID
4985
  );
4931
  );
4986
4932
4987
4988
/**
4933
/**
4989
  Saves the current CPU context that can be restored with a call to LongJump()
4934
  Saves the current CPU context that can be restored with a call to LongJump()
4990
  and returns 0.
4935
  and returns 0.
Lines 5013-5019 SetJump ( Link Here
5013
  OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
4958
  OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer
5014
  );
4959
  );
5015
4960
5016
5017
/**
4961
/**
5018
  Restores the CPU context that was saved with SetJump().
4962
  Restores the CPU context that was saved with SetJump().
5019
4963
Lines 5037-5043 LongJump ( Link Here
5037
  IN      UINTN                     Value
4981
  IN      UINTN                     Value
5038
  );
4982
  );
5039
4983
5040
5041
/**
4984
/**
5042
  Enables CPU interrupts.
4985
  Enables CPU interrupts.
5043
4986
Lines 5048-5054 EnableInterrupts ( Link Here
5048
  VOID
4991
  VOID
5049
  );
4992
  );
5050
4993
5051
5052
/**
4994
/**
5053
  Disables CPU interrupts.
4995
  Disables CPU interrupts.
5054
4996
Lines 5059-5065 DisableInterrupts ( Link Here
5059
  VOID
5001
  VOID
5060
  );
5002
  );
5061
5003
5062
5063
/**
5004
/**
5064
  Disables CPU interrupts and returns the interrupt state prior to the disable
5005
  Disables CPU interrupts and returns the interrupt state prior to the disable
5065
  operation.
5006
  operation.
Lines 5074-5080 SaveAndDisableInterrupts ( Link Here
5074
  VOID
5015
  VOID
5075
  );
5016
  );
5076
5017
5077
5078
/**
5018
/**
5079
  Enables CPU interrupts for the smallest window required to capture any
5019
  Enables CPU interrupts for the smallest window required to capture any
5080
  pending interrupts.
5020
  pending interrupts.
Lines 5086-5092 EnableDisableInterrupts ( Link Here
5086
  VOID
5026
  VOID
5087
  );
5027
  );
5088
5028
5089
5090
/**
5029
/**
5091
  Retrieves the current CPU interrupt state.
5030
  Retrieves the current CPU interrupt state.
5092
5031
Lines 5103-5109 GetInterruptState ( Link Here
5103
  VOID
5042
  VOID
5104
  );
5043
  );
5105
5044
5106
5107
/**
5045
/**
5108
  Set the current CPU interrupt state.
5046
  Set the current CPU interrupt state.
5109
5047
Lines 5121-5130 GetInterruptState ( Link Here
5121
BOOLEAN
5059
BOOLEAN
5122
EFIAPI
5060
EFIAPI
5123
SetInterruptState (
5061
SetInterruptState (
5124
  IN      BOOLEAN                   InterruptState
5062
  IN      BOOLEAN  InterruptState
5125
  );
5063
  );
5126
5064
5127
5128
/**
5065
/**
5129
  Requests CPU to pause for a short period of time.
5066
  Requests CPU to pause for a short period of time.
5130
5067
Lines 5138-5144 CpuPause ( Link Here
5138
  VOID
5075
  VOID
5139
  );
5076
  );
5140
5077
5141
5142
/**
5078
/**
5143
  Transfers control to a function starting with a new stack.
5079
  Transfers control to a function starting with a new stack.
5144
5080
Lines 5172-5184 VOID Link Here
5172
EFIAPI
5108
EFIAPI
5173
SwitchStack (
5109
SwitchStack (
5174
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
5110
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
5175
  IN      VOID                      *Context1,  OPTIONAL
5111
  IN      VOID                      *Context1   OPTIONAL,
5176
  IN      VOID                      *Context2,  OPTIONAL
5112
  IN      VOID                      *Context2   OPTIONAL,
5177
  IN      VOID                      *NewStack,
5113
  IN      VOID                      *NewStack,
5178
  ...
5114
  ...
5179
  );
5115
  );
5180
5116
5181
5182
/**
5117
/**
5183
  Generates a breakpoint on the CPU.
5118
  Generates a breakpoint on the CPU.
5184
5119
Lines 5192-5198 CpuBreakpoint ( Link Here
5192
  VOID
5127
  VOID
5193
  );
5128
  );
5194
5129
5195
5196
/**
5130
/**
5197
  Executes an infinite loop.
5131
  Executes an infinite loop.
5198
5132
Lines 5208-5214 CpuDeadLoop ( Link Here
5208
  VOID
5142
  VOID
5209
  );
5143
  );
5210
5144
5211
5212
/**
5145
/**
5213
  Uses as a barrier to stop speculative execution.
5146
  Uses as a barrier to stop speculative execution.
5214
5147
Lines 5222-5227 SpeculationBarrier ( Link Here
5222
  VOID
5155
  VOID
5223
  );
5156
  );
5224
5157
5158
#if defined (MDE_CPU_X64) || defined (MDE_CPU_IA32)
5159
5160
/**
5161
  The TDCALL instruction causes a VM exit to the Intel TDX module.  It is
5162
  used to call guest-side Intel TDX functions, either local or a TD exit
5163
  to the host VMM, as selected by Leaf.
5164
5165
  @param[in]      Leaf        Leaf number of TDCALL instruction
5166
  @param[in]      Arg1        Arg1
5167
  @param[in]      Arg2        Arg2
5168
  @param[in]      Arg3        Arg3
5169
  @param[in,out]  Results  Returned result of the Leaf function
5170
5171
  @return 0               A successful call
5172
  @return Other           See individual leaf functions
5173
**/
5174
UINTN
5175
EFIAPI
5176
TdCall (
5177
  IN UINT64    Leaf,
5178
  IN UINT64    Arg1,
5179
  IN UINT64    Arg2,
5180
  IN UINT64    Arg3,
5181
  IN OUT VOID  *Results
5182
  );
5183
5184
/**
5185
  TDVMALL is a leaf function 0 for TDCALL. It helps invoke services from the
5186
  host VMM to pass/receive information.
5187
5188
  @param[in]     Leaf        Number of sub-functions
5189
  @param[in]     Arg1        Arg1
5190
  @param[in]     Arg2        Arg2
5191
  @param[in]     Arg3        Arg3
5192
  @param[in]     Arg4        Arg4
5193
  @param[in,out] Results     Returned result of the sub-function
5194
5195
  @return 0               A successful call
5196
  @return Other           See individual sub-functions
5197
5198
**/
5199
UINTN
5200
EFIAPI
5201
TdVmCall (
5202
  IN UINT64    Leaf,
5203
  IN UINT64    Arg1,
5204
  IN UINT64    Arg2,
5205
  IN UINT64    Arg3,
5206
  IN UINT64    Arg4,
5207
  IN OUT VOID  *Results
5208
  );
5209
5210
/**
5211
  Probe if TD is enabled.
5212
5213
  @return TRUE    TD is enabled.
5214
  @return FALSE   TD is not enabled.
5215
**/
5216
BOOLEAN
5217
EFIAPI
5218
TdIsEnabled (
5219
  VOID
5220
  );
5221
5222
#endif
5223
5224
#if defined (MDE_CPU_X64)
5225
//
5226
// The page size for the PVALIDATE instruction
5227
//
5228
typedef enum {
5229
  PvalidatePageSize4K = 0,
5230
  PvalidatePageSize2MB,
5231
} PVALIDATE_PAGE_SIZE;
5232
5233
//
5234
// PVALIDATE Return Code.
5235
//
5236
#define PVALIDATE_RET_SUCCESS        0
5237
#define PVALIDATE_RET_FAIL_INPUT     1
5238
#define PVALIDATE_RET_SIZE_MISMATCH  6
5239
5240
//
5241
// The PVALIDATE instruction did not make any changes to the RMP entry.
5242
//
5243
#define PVALIDATE_RET_NO_RMPUPDATE  255
5244
5245
/**
5246
 Execute a PVALIDATE instruction to validate or to rescinds validation of a guest
5247
 page's RMP entry.
5248
5249
 The instruction is available only when CPUID Fn8000_001F_EAX[SNP]=1.
5250
5251
 The function is available on X64.
5252
5253
 @param[in]    PageSize         The page size to use.
5254
 @param[in]    Validate         If TRUE, validate the guest virtual address
5255
                                otherwise invalidate the guest virtual address.
5256
 @param[in]    Address          The guest virtual address.
5257
5258
 @retval PVALIDATE_RET_SUCCESS        The PVALIDATE instruction succeeded, and
5259
                                      updated the RMP entry.
5260
 @retval PVALIDATE_RET_NO_RMPUPDATE   The PVALIDATE instruction succeeded, but
5261
                                      did not update the RMP entry.
5262
 @return                              Failure code from the PVALIDATE
5263
                                      instruction.
5264
**/
5265
UINT32
5266
EFIAPI
5267
AsmPvalidate (
5268
  IN   PVALIDATE_PAGE_SIZE  PageSize,
5269
  IN   BOOLEAN              Validate,
5270
  IN   PHYSICAL_ADDRESS     Address
5271
  );
5272
5273
//
5274
// RDX settings for RMPADJUST
5275
//
5276
#define RMPADJUST_VMPL_MAX               3
5277
#define RMPADJUST_VMPL_MASK              0xFF
5278
#define RMPADJUST_VMPL_SHIFT             0
5279
#define RMPADJUST_PERMISSION_MASK_MASK   0xFF
5280
#define RMPADJUST_PERMISSION_MASK_SHIFT  8
5281
#define RMPADJUST_VMSA_PAGE_BIT          BIT16
5282
5283
/**
5284
  Adjusts the permissions of an SEV-SNP guest page.
5285
5286
  Executes a RMPADJUST instruction with the register state specified by Rax,
5287
  Rcx, and Rdx. Returns Eax. This function is only available on X64.
5288
5289
  The instruction is available only when CPUID Fn8000_001F_EAX[SNP]=1.
5290
5291
  @param[in]  Rax   The value to load into RAX before executing the RMPADJUST
5292
                    instruction.
5293
  @param[in]  Rcx   The value to load into RCX before executing the RMPADJUST
5294
                    instruction.
5295
  @param[in]  Rdx   The value to load into RDX before executing the RMPADJUST
5296
                    instruction.
5297
5298
  @return     Eax
5299
**/
5300
UINT32
5301
EFIAPI
5302
AsmRmpAdjust (
5303
  IN      UINT64  Rax,
5304
  IN      UINT64  Rcx,
5305
  IN      UINT64  Rdx
5306
  );
5307
5308
#endif
5225
5309
5226
#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
5310
#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
5227
///
5311
///
Lines 5230-5250 SpeculationBarrier ( Link Here
5230
///
5314
///
5231
typedef union {
5315
typedef union {
5232
  struct {
5316
  struct {
5233
    UINT32  CF:1;           ///< Carry Flag.
5317
    UINT32    CF         : 1; ///< Carry Flag.
5234
    UINT32  Reserved_0:1;   ///< Reserved.
5318
    UINT32    Reserved_0 : 1; ///< Reserved.
5235
    UINT32  PF:1;           ///< Parity Flag.
5319
    UINT32    PF         : 1; ///< Parity Flag.
5236
    UINT32  Reserved_1:1;   ///< Reserved.
5320
    UINT32    Reserved_1 : 1; ///< Reserved.
5237
    UINT32  AF:1;           ///< Auxiliary Carry Flag.
5321
    UINT32    AF         : 1; ///< Auxiliary Carry Flag.
5238
    UINT32  Reserved_2:1;   ///< Reserved.
5322
    UINT32    Reserved_2 : 1; ///< Reserved.
5239
    UINT32  ZF:1;           ///< Zero Flag.
5323
    UINT32    ZF         : 1; ///< Zero Flag.
5240
    UINT32  SF:1;           ///< Sign Flag.
5324
    UINT32    SF         : 1; ///< Sign Flag.
5241
    UINT32  TF:1;           ///< Trap Flag.
5325
    UINT32    TF         : 1; ///< Trap Flag.
5242
    UINT32  IF:1;           ///< Interrupt Enable Flag.
5326
    UINT32    IF         : 1; ///< Interrupt Enable Flag.
5243
    UINT32  DF:1;           ///< Direction Flag.
5327
    UINT32    DF         : 1; ///< Direction Flag.
5244
    UINT32  OF:1;           ///< Overflow Flag.
5328
    UINT32    OF         : 1; ///< Overflow Flag.
5245
    UINT32  IOPL:2;         ///< I/O Privilege Level.
5329
    UINT32    IOPL       : 2; ///< I/O Privilege Level.
5246
    UINT32  NT:1;           ///< Nested Task.
5330
    UINT32    NT         : 1; ///< Nested Task.
5247
    UINT32  Reserved_3:1;   ///< Reserved.
5331
    UINT32    Reserved_3 : 1; ///< Reserved.
5248
  } Bits;
5332
  } Bits;
5249
  UINT16    Uint16;
5333
  UINT16    Uint16;
5250
} IA32_FLAGS16;
5334
} IA32_FLAGS16;
Lines 5256-5285 typedef union { Link Here
5256
///
5340
///
5257
typedef union {
5341
typedef union {
5258
  struct {
5342
  struct {
5259
    UINT32  CF:1;           ///< Carry Flag.
5343
    UINT32    CF         : 1;  ///< Carry Flag.
5260
    UINT32  Reserved_0:1;   ///< Reserved.
5344
    UINT32    Reserved_0 : 1;  ///< Reserved.
5261
    UINT32  PF:1;           ///< Parity Flag.
5345
    UINT32    PF         : 1;  ///< Parity Flag.
5262
    UINT32  Reserved_1:1;   ///< Reserved.
5346
    UINT32    Reserved_1 : 1;  ///< Reserved.
5263
    UINT32  AF:1;           ///< Auxiliary Carry Flag.
5347
    UINT32    AF         : 1;  ///< Auxiliary Carry Flag.
5264
    UINT32  Reserved_2:1;   ///< Reserved.
5348
    UINT32    Reserved_2 : 1;  ///< Reserved.
5265
    UINT32  ZF:1;           ///< Zero Flag.
5349
    UINT32    ZF         : 1;  ///< Zero Flag.
5266
    UINT32  SF:1;           ///< Sign Flag.
5350
    UINT32    SF         : 1;  ///< Sign Flag.
5267
    UINT32  TF:1;           ///< Trap Flag.
5351
    UINT32    TF         : 1;  ///< Trap Flag.
5268
    UINT32  IF:1;           ///< Interrupt Enable Flag.
5352
    UINT32    IF         : 1;  ///< Interrupt Enable Flag.
5269
    UINT32  DF:1;           ///< Direction Flag.
5353
    UINT32    DF         : 1;  ///< Direction Flag.
5270
    UINT32  OF:1;           ///< Overflow Flag.
5354
    UINT32    OF         : 1;  ///< Overflow Flag.
5271
    UINT32  IOPL:2;         ///< I/O Privilege Level.
5355
    UINT32    IOPL       : 2;  ///< I/O Privilege Level.
5272
    UINT32  NT:1;           ///< Nested Task.
5356
    UINT32    NT         : 1;  ///< Nested Task.
5273
    UINT32  Reserved_3:1;   ///< Reserved.
5357
    UINT32    Reserved_3 : 1;  ///< Reserved.
5274
    UINT32  RF:1;           ///< Resume Flag.
5358
    UINT32    RF         : 1;  ///< Resume Flag.
5275
    UINT32  VM:1;           ///< Virtual 8086 Mode.
5359
    UINT32    VM         : 1;  ///< Virtual 8086 Mode.
5276
    UINT32  AC:1;           ///< Alignment Check.
5360
    UINT32    AC         : 1;  ///< Alignment Check.
5277
    UINT32  VIF:1;          ///< Virtual Interrupt Flag.
5361
    UINT32    VIF        : 1;  ///< Virtual Interrupt Flag.
5278
    UINT32  VIP:1;          ///< Virtual Interrupt Pending.
5362
    UINT32    VIP        : 1;  ///< Virtual Interrupt Pending.
5279
    UINT32  ID:1;           ///< ID Flag.
5363
    UINT32    ID         : 1;  ///< ID Flag.
5280
    UINT32  Reserved_4:10;  ///< Reserved.
5364
    UINT32    Reserved_4 : 10; ///< Reserved.
5281
  } Bits;
5365
  } Bits;
5282
  UINTN     UintN;
5366
  UINTN    UintN;
5283
} IA32_EFLAGS32;
5367
} IA32_EFLAGS32;
5284
5368
5285
///
5369
///
Lines 5289-5310 typedef union { Link Here
5289
///
5373
///
5290
typedef union {
5374
typedef union {
5291
  struct {
5375
  struct {
5292
    UINT32  PE:1;           ///< Protection Enable.
5376
    UINT32    PE         : 1;  ///< Protection Enable.
5293
    UINT32  MP:1;           ///< Monitor Coprocessor.
5377
    UINT32    MP         : 1;  ///< Monitor Coprocessor.
5294
    UINT32  EM:1;           ///< Emulation.
5378
    UINT32    EM         : 1;  ///< Emulation.
5295
    UINT32  TS:1;           ///< Task Switched.
5379
    UINT32    TS         : 1;  ///< Task Switched.
5296
    UINT32  ET:1;           ///< Extension Type.
5380
    UINT32    ET         : 1;  ///< Extension Type.
5297
    UINT32  NE:1;           ///< Numeric Error.
5381
    UINT32    NE         : 1;  ///< Numeric Error.
5298
    UINT32  Reserved_0:10;  ///< Reserved.
5382
    UINT32    Reserved_0 : 10; ///< Reserved.
5299
    UINT32  WP:1;           ///< Write Protect.
5383
    UINT32    WP         : 1;  ///< Write Protect.
5300
    UINT32  Reserved_1:1;   ///< Reserved.
5384
    UINT32    Reserved_1 : 1;  ///< Reserved.
5301
    UINT32  AM:1;           ///< Alignment Mask.
5385
    UINT32    AM         : 1;  ///< Alignment Mask.
5302
    UINT32  Reserved_2:10;  ///< Reserved.
5386
    UINT32    Reserved_2 : 10; ///< Reserved.
5303
    UINT32  NW:1;           ///< Mot Write-through.
5387
    UINT32    NW         : 1;  ///< Mot Write-through.
5304
    UINT32  CD:1;           ///< Cache Disable.
5388
    UINT32    CD         : 1;  ///< Cache Disable.
5305
    UINT32  PG:1;           ///< Paging.
5389
    UINT32    PG         : 1;  ///< Paging.
5306
  } Bits;
5390
  } Bits;
5307
  UINTN     UintN;
5391
  UINTN    UintN;
5308
} IA32_CR0;
5392
} IA32_CR0;
5309
5393
5310
///
5394
///
Lines 5314-5349 typedef union { Link Here
5314
///
5398
///
5315
typedef union {
5399
typedef union {
5316
  struct {
5400
  struct {
5317
    UINT32  VME:1;          ///< Virtual-8086 Mode Extensions.
5401
    UINT32    VME        : 1; ///< Virtual-8086 Mode Extensions.
5318
    UINT32  PVI:1;          ///< Protected-Mode Virtual Interrupts.
5402
    UINT32    PVI        : 1; ///< Protected-Mode Virtual Interrupts.
5319
    UINT32  TSD:1;          ///< Time Stamp Disable.
5403
    UINT32    TSD        : 1; ///< Time Stamp Disable.
5320
    UINT32  DE:1;           ///< Debugging Extensions.
5404
    UINT32    DE         : 1; ///< Debugging Extensions.
5321
    UINT32  PSE:1;          ///< Page Size Extensions.
5405
    UINT32    PSE        : 1; ///< Page Size Extensions.
5322
    UINT32  PAE:1;          ///< Physical Address Extension.
5406
    UINT32    PAE        : 1; ///< Physical Address Extension.
5323
    UINT32  MCE:1;          ///< Machine Check Enable.
5407
    UINT32    MCE        : 1; ///< Machine Check Enable.
5324
    UINT32  PGE:1;          ///< Page Global Enable.
5408
    UINT32    PGE        : 1; ///< Page Global Enable.
5325
    UINT32  PCE:1;          ///< Performance Monitoring Counter
5409
    UINT32    PCE        : 1; ///< Performance Monitoring Counter
5326
                            ///< Enable.
5410
                              ///< Enable.
5327
    UINT32  OSFXSR:1;       ///< Operating System Support for
5411
    UINT32    OSFXSR     : 1; ///< Operating System Support for
5328
                            ///< FXSAVE and FXRSTOR instructions
5412
                              ///< FXSAVE and FXRSTOR instructions
5329
    UINT32  OSXMMEXCPT:1;   ///< Operating System Support for
5413
    UINT32    OSXMMEXCPT : 1; ///< Operating System Support for
5330
                            ///< Unmasked SIMD Floating Point
5414
                              ///< Unmasked SIMD Floating Point
5331
                            ///< Exceptions.
5415
                              ///< Exceptions.
5332
    UINT32  UMIP:1;         ///< User-Mode Instruction Prevention.
5416
    UINT32    UMIP       : 1; ///< User-Mode Instruction Prevention.
5333
    UINT32  LA57:1;         ///< Linear Address 57bit.
5417
    UINT32    LA57       : 1; ///< Linear Address 57bit.
5334
    UINT32  VMXE:1;         ///< VMX Enable.
5418
    UINT32    VMXE       : 1; ///< VMX Enable.
5335
    UINT32  SMXE:1;         ///< SMX Enable.
5419
    UINT32    SMXE       : 1; ///< SMX Enable.
5336
    UINT32  Reserved_3:1;   ///< Reserved.
5420
    UINT32    Reserved_3 : 1; ///< Reserved.
5337
    UINT32  FSGSBASE:1;     ///< FSGSBASE Enable.
5421
    UINT32    FSGSBASE   : 1; ///< FSGSBASE Enable.
5338
    UINT32  PCIDE:1;        ///< PCID Enable.
5422
    UINT32    PCIDE      : 1; ///< PCID Enable.
5339
    UINT32  OSXSAVE:1;      ///< XSAVE and Processor Extended States Enable.
5423
    UINT32    OSXSAVE    : 1; ///< XSAVE and Processor Extended States Enable.
5340
    UINT32  Reserved_4:1;   ///< Reserved.
5424
    UINT32    Reserved_4 : 1; ///< Reserved.
5341
    UINT32  SMEP:1;         ///< SMEP Enable.
5425
    UINT32    SMEP       : 1; ///< SMEP Enable.
5342
    UINT32  SMAP:1;         ///< SMAP Enable.
5426
    UINT32    SMAP       : 1; ///< SMAP Enable.
5343
    UINT32  PKE:1;          ///< Protection-Key Enable.
5427
    UINT32    PKE        : 1; ///< Protection-Key Enable.
5344
    UINT32  Reserved_5:9;   ///< Reserved.
5428
    UINT32    Reserved_5 : 9; ///< Reserved.
5345
  } Bits;
5429
  } Bits;
5346
  UINTN     UintN;
5430
  UINTN    UintN;
5347
} IA32_CR4;
5431
} IA32_CR4;
5348
5432
5349
///
5433
///
Lines 5351-5382 typedef union { Link Here
5351
///
5435
///
5352
typedef union {
5436
typedef union {
5353
  struct {
5437
  struct {
5354
    UINT32  LimitLow:16;
5438
    UINT32    LimitLow  : 16;
5355
    UINT32  BaseLow:16;
5439
    UINT32    BaseLow   : 16;
5356
    UINT32  BaseMid:8;
5440
    UINT32    BaseMid   : 8;
5357
    UINT32  Type:4;
5441
    UINT32    Type      : 4;
5358
    UINT32  S:1;
5442
    UINT32    S         : 1;
5359
    UINT32  DPL:2;
5443
    UINT32    DPL       : 2;
5360
    UINT32  P:1;
5444
    UINT32    P         : 1;
5361
    UINT32  LimitHigh:4;
5445
    UINT32    LimitHigh : 4;
5362
    UINT32  AVL:1;
5446
    UINT32    AVL       : 1;
5363
    UINT32  L:1;
5447
    UINT32    L         : 1;
5364
    UINT32  DB:1;
5448
    UINT32    DB        : 1;
5365
    UINT32  G:1;
5449
    UINT32    G         : 1;
5366
    UINT32  BaseHigh:8;
5450
    UINT32    BaseHigh  : 8;
5367
  } Bits;
5451
  } Bits;
5368
  UINT64  Uint64;
5452
  UINT64    Uint64;
5369
} IA32_SEGMENT_DESCRIPTOR;
5453
} IA32_SEGMENT_DESCRIPTOR;
5370
5454
5371
///
5455
///
5372
/// Byte packed structure for an IDTR, GDTR, LDTR descriptor.
5456
/// Byte packed structure for an IDTR, GDTR, LDTR descriptor.
5373
///
5457
///
5374
#pragma pack (1)
5458
  #pragma pack (1)
5375
typedef struct {
5459
typedef struct {
5376
  UINT16  Limit;
5460
  UINT16    Limit;
5377
  UINTN   Base;
5461
  UINTN     Base;
5378
} IA32_DESCRIPTOR;
5462
} IA32_DESCRIPTOR;
5379
#pragma pack ()
5463
  #pragma pack ()
5380
5464
5381
#define IA32_IDT_GATE_TYPE_TASK          0x85
5465
#define IA32_IDT_GATE_TYPE_TASK          0x85
5382
#define IA32_IDT_GATE_TYPE_INTERRUPT_16  0x86
5466
#define IA32_IDT_GATE_TYPE_INTERRUPT_16  0x86
Lines 5384-5408 typedef struct { Link Here
5384
#define IA32_IDT_GATE_TYPE_INTERRUPT_32  0x8E
5468
#define IA32_IDT_GATE_TYPE_INTERRUPT_32  0x8E
5385
#define IA32_IDT_GATE_TYPE_TRAP_32       0x8F
5469
#define IA32_IDT_GATE_TYPE_TRAP_32       0x8F
5386
5470
5387
#define IA32_GDT_TYPE_TSS               0x9
5471
#define IA32_GDT_TYPE_TSS   0x9
5388
#define IA32_GDT_ALIGNMENT              8
5472
#define IA32_GDT_ALIGNMENT  8
5389
5473
5390
#if defined (MDE_CPU_IA32)
5474
  #if defined (MDE_CPU_IA32)
5391
///
5475
///
5392
/// Byte packed structure for an IA-32 Interrupt Gate Descriptor.
5476
/// Byte packed structure for an IA-32 Interrupt Gate Descriptor.
5393
///
5477
///
5394
typedef union {
5478
typedef union {
5395
  struct {
5479
  struct {
5396
    UINT32  OffsetLow:16;   ///< Offset bits 15..0.
5480
    UINT32    OffsetLow  : 16; ///< Offset bits 15..0.
5397
    UINT32  Selector:16;    ///< Selector.
5481
    UINT32    Selector   : 16; ///< Selector.
5398
    UINT32  Reserved_0:8;   ///< Reserved.
5482
    UINT32    Reserved_0 : 8;  ///< Reserved.
5399
    UINT32  GateType:8;     ///< Gate Type.  See #defines above.
5483
    UINT32    GateType   : 8;  ///< Gate Type.  See #defines above.
5400
    UINT32  OffsetHigh:16;  ///< Offset bits 31..16.
5484
    UINT32    OffsetHigh : 16; ///< Offset bits 31..16.
5401
  } Bits;
5485
  } Bits;
5402
  UINT64  Uint64;
5486
  UINT64    Uint64;
5403
} IA32_IDT_GATE_DESCRIPTOR;
5487
} IA32_IDT_GATE_DESCRIPTOR;
5404
5488
5405
#pragma pack (1)
5489
    #pragma pack (1)
5406
//
5490
//
5407
// IA32 Task-State Segment Definition
5491
// IA32 Task-State Segment Definition
5408
//
5492
//
Lines 5449-5494 typedef struct { Link Here
5449
5533
5450
typedef union {
5534
typedef union {
5451
  struct {
5535
  struct {
5452
    UINT32  LimitLow:16;    ///< Segment Limit 15..00
5536
    UINT32    LimitLow    : 16; ///< Segment Limit 15..00
5453
    UINT32  BaseLow:16;     ///< Base Address  15..00
5537
    UINT32    BaseLow     : 16; ///< Base Address  15..00
5454
    UINT32  BaseMid:8;      ///< Base Address  23..16
5538
    UINT32    BaseMid     : 8;  ///< Base Address  23..16
5455
    UINT32  Type:4;         ///< Type (1 0 B 1)
5539
    UINT32    Type        : 4;  ///< Type (1 0 B 1)
5456
    UINT32  Reserved_43:1;  ///< 0
5540
    UINT32    Reserved_43 : 1;  ///< 0
5457
    UINT32  DPL:2;          ///< Descriptor Privilege Level
5541
    UINT32    DPL         : 2;  ///< Descriptor Privilege Level
5458
    UINT32  P:1;            ///< Segment Present
5542
    UINT32    P           : 1;  ///< Segment Present
5459
    UINT32  LimitHigh:4;    ///< Segment Limit 19..16
5543
    UINT32    LimitHigh   : 4;  ///< Segment Limit 19..16
5460
    UINT32  AVL:1;          ///< Available for use by system software
5544
    UINT32    AVL         : 1;  ///< Available for use by system software
5461
    UINT32  Reserved_52:2;  ///< 0 0
5545
    UINT32    Reserved_52 : 2;  ///< 0 0
5462
    UINT32  G:1;            ///< Granularity
5546
    UINT32    G           : 1;  ///< Granularity
5463
    UINT32  BaseHigh:8;     ///< Base Address 31..24
5547
    UINT32    BaseHigh    : 8;  ///< Base Address 31..24
5464
  } Bits;
5548
  } Bits;
5465
  UINT64  Uint64;
5549
  UINT64    Uint64;
5466
} IA32_TSS_DESCRIPTOR;
5550
} IA32_TSS_DESCRIPTOR;
5467
#pragma pack ()
5551
    #pragma pack ()
5468
5552
5469
#endif // defined (MDE_CPU_IA32)
5553
  #endif // defined (MDE_CPU_IA32)
5470
5554
5471
#if defined (MDE_CPU_X64)
5555
  #if defined (MDE_CPU_X64)
5472
///
5556
///
5473
/// Byte packed structure for an x64 Interrupt Gate Descriptor.
5557
/// Byte packed structure for an x64 Interrupt Gate Descriptor.
5474
///
5558
///
5475
typedef union {
5559
typedef union {
5476
  struct {
5560
  struct {
5477
    UINT32  OffsetLow:16;   ///< Offset bits 15..0.
5561
    UINT32    OffsetLow   : 16; ///< Offset bits 15..0.
5478
    UINT32  Selector:16;    ///< Selector.
5562
    UINT32    Selector    : 16; ///< Selector.
5479
    UINT32  Reserved_0:8;   ///< Reserved.
5563
    UINT32    Reserved_0  : 8;  ///< Reserved.
5480
    UINT32  GateType:8;     ///< Gate Type.  See #defines above.
5564
    UINT32    GateType    : 8;  ///< Gate Type.  See #defines above.
5481
    UINT32  OffsetHigh:16;  ///< Offset bits 31..16.
5565
    UINT32    OffsetHigh  : 16; ///< Offset bits 31..16.
5482
    UINT32  OffsetUpper:32; ///< Offset bits 63..32.
5566
    UINT32    OffsetUpper : 32; ///< Offset bits 63..32.
5483
    UINT32  Reserved_1:32;  ///< Reserved.
5567
    UINT32    Reserved_1  : 32; ///< Reserved.
5484
  } Bits;
5568
  } Bits;
5485
  struct {
5569
  struct {
5486
    UINT64  Uint64;
5570
    UINT64    Uint64;
5487
    UINT64  Uint64_1;
5571
    UINT64    Uint64_1;
5488
  } Uint128;
5572
  } Uint128;
5489
} IA32_IDT_GATE_DESCRIPTOR;
5573
} IA32_IDT_GATE_DESCRIPTOR;
5490
5574
5491
#pragma pack (1)
5575
    #pragma pack (1)
5492
//
5576
//
5493
// IA32 Task-State Segment Definition
5577
// IA32 Task-State Segment Definition
5494
//
5578
//
Lines 5506-5621 typedef struct { Link Here
5506
5590
5507
typedef union {
5591
typedef union {
5508
  struct {
5592
  struct {
5509
    UINT32  LimitLow:16;    ///< Segment Limit 15..00
5593
    UINT32    LimitLow    : 16; ///< Segment Limit 15..00
5510
    UINT32  BaseLow:16;     ///< Base Address  15..00
5594
    UINT32    BaseLow     : 16; ///< Base Address  15..00
5511
    UINT32  BaseMidl:8;     ///< Base Address  23..16
5595
    UINT32    BaseMidl    : 8;  ///< Base Address  23..16
5512
    UINT32  Type:4;         ///< Type (1 0 B 1)
5596
    UINT32    Type        : 4;  ///< Type (1 0 B 1)
5513
    UINT32  Reserved_43:1;  ///< 0
5597
    UINT32    Reserved_43 : 1;  ///< 0
5514
    UINT32  DPL:2;          ///< Descriptor Privilege Level
5598
    UINT32    DPL         : 2;  ///< Descriptor Privilege Level
5515
    UINT32  P:1;            ///< Segment Present
5599
    UINT32    P           : 1;  ///< Segment Present
5516
    UINT32  LimitHigh:4;    ///< Segment Limit 19..16
5600
    UINT32    LimitHigh   : 4;  ///< Segment Limit 19..16
5517
    UINT32  AVL:1;          ///< Available for use by system software
5601
    UINT32    AVL         : 1;  ///< Available for use by system software
5518
    UINT32  Reserved_52:2;  ///< 0 0
5602
    UINT32    Reserved_52 : 2;  ///< 0 0
5519
    UINT32  G:1;            ///< Granularity
5603
    UINT32    G           : 1;  ///< Granularity
5520
    UINT32  BaseMidh:8;     ///< Base Address  31..24
5604
    UINT32    BaseMidh    : 8;  ///< Base Address  31..24
5521
    UINT32  BaseHigh:32;    ///< Base Address  63..32
5605
    UINT32    BaseHigh    : 32; ///< Base Address  63..32
5522
    UINT32  Reserved_96:32; ///< Reserved
5606
    UINT32    Reserved_96 : 32; ///< Reserved
5523
  } Bits;
5607
  } Bits;
5524
  struct {
5608
  struct {
5525
    UINT64  Uint64;
5609
    UINT64    Uint64;
5526
    UINT64  Uint64_1;
5610
    UINT64    Uint64_1;
5527
  } Uint128;
5611
  } Uint128;
5528
} IA32_TSS_DESCRIPTOR;
5612
} IA32_TSS_DESCRIPTOR;
5529
#pragma pack ()
5613
    #pragma pack ()
5530
5614
5531
#endif // defined (MDE_CPU_X64)
5615
  #endif // defined (MDE_CPU_X64)
5532
5616
5533
///
5617
///
5534
/// Byte packed structure for an FP/SSE/SSE2 context.
5618
/// Byte packed structure for an FP/SSE/SSE2 context.
5535
///
5619
///
5536
typedef struct {
5620
typedef struct {
5537
  UINT8  Buffer[512];
5621
  UINT8    Buffer[512];
5538
} IA32_FX_BUFFER;
5622
} IA32_FX_BUFFER;
5539
5623
5540
///
5624
///
5541
/// Structures for the 16-bit real mode thunks.
5625
/// Structures for the 16-bit real mode thunks.
5542
///
5626
///
5543
typedef struct {
5627
typedef struct {
5544
  UINT32                            Reserved1;
5628
  UINT32    Reserved1;
5545
  UINT32                            Reserved2;
5629
  UINT32    Reserved2;
5546
  UINT32                            Reserved3;
5630
  UINT32    Reserved3;
5547
  UINT32                            Reserved4;
5631
  UINT32    Reserved4;
5548
  UINT8                             BL;
5632
  UINT8     BL;
5549
  UINT8                             BH;
5633
  UINT8     BH;
5550
  UINT16                            Reserved5;
5634
  UINT16    Reserved5;
5551
  UINT8                             DL;
5635
  UINT8     DL;
5552
  UINT8                             DH;
5636
  UINT8     DH;
5553
  UINT16                            Reserved6;
5637
  UINT16    Reserved6;
5554
  UINT8                             CL;
5638
  UINT8     CL;
5555
  UINT8                             CH;
5639
  UINT8     CH;
5556
  UINT16                            Reserved7;
5640
  UINT16    Reserved7;
5557
  UINT8                             AL;
5641
  UINT8     AL;
5558
  UINT8                             AH;
5642
  UINT8     AH;
5559
  UINT16                            Reserved8;
5643
  UINT16    Reserved8;
5560
} IA32_BYTE_REGS;
5644
} IA32_BYTE_REGS;
5561
5645
5562
typedef struct {
5646
typedef struct {
5563
  UINT16                            DI;
5647
  UINT16    DI;
5564
  UINT16                            Reserved1;
5648
  UINT16    Reserved1;
5565
  UINT16                            SI;
5649
  UINT16    SI;
5566
  UINT16                            Reserved2;
5650
  UINT16    Reserved2;
5567
  UINT16                            BP;
5651
  UINT16    BP;
5568
  UINT16                            Reserved3;
5652
  UINT16    Reserved3;
5569
  UINT16                            SP;
5653
  UINT16    SP;
5570
  UINT16                            Reserved4;
5654
  UINT16    Reserved4;
5571
  UINT16                            BX;
5655
  UINT16    BX;
5572
  UINT16                            Reserved5;
5656
  UINT16    Reserved5;
5573
  UINT16                            DX;
5657
  UINT16    DX;
5574
  UINT16                            Reserved6;
5658
  UINT16    Reserved6;
5575
  UINT16                            CX;
5659
  UINT16    CX;
5576
  UINT16                            Reserved7;
5660
  UINT16    Reserved7;
5577
  UINT16                            AX;
5661
  UINT16    AX;
5578
  UINT16                            Reserved8;
5662
  UINT16    Reserved8;
5579
} IA32_WORD_REGS;
5663
} IA32_WORD_REGS;
5580
5664
5581
typedef struct {
5665
typedef struct {
5582
  UINT32                            EDI;
5666
  UINT32           EDI;
5583
  UINT32                            ESI;
5667
  UINT32           ESI;
5584
  UINT32                            EBP;
5668
  UINT32           EBP;
5585
  UINT32                            ESP;
5669
  UINT32           ESP;
5586
  UINT32                            EBX;
5670
  UINT32           EBX;
5587
  UINT32                            EDX;
5671
  UINT32           EDX;
5588
  UINT32                            ECX;
5672
  UINT32           ECX;
5589
  UINT32                            EAX;
5673
  UINT32           EAX;
5590
  UINT16                            DS;
5674
  UINT16           DS;
5591
  UINT16                            ES;
5675
  UINT16           ES;
5592
  UINT16                            FS;
5676
  UINT16           FS;
5593
  UINT16                            GS;
5677
  UINT16           GS;
5594
  IA32_EFLAGS32                     EFLAGS;
5678
  IA32_EFLAGS32    EFLAGS;
5595
  UINT32                            Eip;
5679
  UINT32           Eip;
5596
  UINT16                            CS;
5680
  UINT16           CS;
5597
  UINT16                            SS;
5681
  UINT16           SS;
5598
} IA32_DWORD_REGS;
5682
} IA32_DWORD_REGS;
5599
5683
5600
typedef union {
5684
typedef union {
5601
  IA32_DWORD_REGS                   E;
5685
  IA32_DWORD_REGS    E;
5602
  IA32_WORD_REGS                    X;
5686
  IA32_WORD_REGS     X;
5603
  IA32_BYTE_REGS                    H;
5687
  IA32_BYTE_REGS     H;
5604
} IA32_REGISTER_SET;
5688
} IA32_REGISTER_SET;
5605
5689
5606
///
5690
///
5607
/// Byte packed structure for an 16-bit real mode thunks.
5691
/// Byte packed structure for an 16-bit real mode thunks.
5608
///
5692
///
5609
typedef struct {
5693
typedef struct {
5610
  IA32_REGISTER_SET                 *RealModeState;
5694
  IA32_REGISTER_SET    *RealModeState;
5611
  VOID                              *RealModeBuffer;
5695
  VOID                 *RealModeBuffer;
5612
  UINT32                            RealModeBufferSize;
5696
  UINT32               RealModeBufferSize;
5613
  UINT32                            ThunkAttributes;
5697
  UINT32               ThunkAttributes;
5614
} THUNK_CONTEXT;
5698
} THUNK_CONTEXT;
5615
5699
5616
#define THUNK_ATTRIBUTE_BIG_REAL_MODE             0x00000001
5700
#define THUNK_ATTRIBUTE_BIG_REAL_MODE              0x00000001
5617
#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15   0x00000002
5701
#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15    0x00000002
5618
#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004
5702
#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL  0x00000004
5619
5703
5620
///
5704
///
5621
/// Type definition for representing labels in NASM source code that allow for
5705
/// Type definition for representing labels in NASM source code that allow for
Lines 5629-5635 typedef struct { Link Here
5629
/// edk2 coding style for function (or pointer-to-function) typedefs. The VOID
5713
/// edk2 coding style for function (or pointer-to-function) typedefs. The VOID
5630
/// return type and the VOID argument list are merely artifacts.
5714
/// return type and the VOID argument list are merely artifacts.
5631
///
5715
///
5632
typedef VOID (X86_ASSEMBLY_PATCH_LABEL) (VOID);
5716
typedef VOID (X86_ASSEMBLY_PATCH_LABEL) (
5717
  VOID
5718
  );
5633
5719
5634
/**
5720
/**
5635
  Retrieves CPUID information.
5721
  Retrieves CPUID information.
Lines 5659-5672 typedef VOID (X86_ASSEMBLY_PATCH_LABEL) (VOID); Link Here
5659
UINT32
5745
UINT32
5660
EFIAPI
5746
EFIAPI
5661
AsmCpuid (
5747
AsmCpuid (
5662
  IN      UINT32                    Index,
5748
  IN      UINT32  Index,
5663
  OUT     UINT32                    *Eax,  OPTIONAL
5749
  OUT     UINT32  *Eax   OPTIONAL,
5664
  OUT     UINT32                    *Ebx,  OPTIONAL
5750
  OUT     UINT32  *Ebx   OPTIONAL,
5665
  OUT     UINT32                    *Ecx,  OPTIONAL
5751
  OUT     UINT32  *Ecx   OPTIONAL,
5666
  OUT     UINT32                    *Edx   OPTIONAL
5752
  OUT     UINT32  *Edx   OPTIONAL
5667
  );
5753
  );
5668
5754
5669
5670
/**
5755
/**
5671
  Retrieves CPUID information using an extended leaf identifier.
5756
  Retrieves CPUID information using an extended leaf identifier.
5672
5757
Lines 5702-5716 AsmCpuid ( Link Here
5702
UINT32
5787
UINT32
5703
EFIAPI
5788
EFIAPI
5704
AsmCpuidEx (
5789
AsmCpuidEx (
5705
  IN      UINT32                    Index,
5790
  IN      UINT32  Index,
5706
  IN      UINT32                    SubIndex,
5791
  IN      UINT32  SubIndex,
5707
  OUT     UINT32                    *Eax,  OPTIONAL
5792
  OUT     UINT32  *Eax   OPTIONAL,
5708
  OUT     UINT32                    *Ebx,  OPTIONAL
5793
  OUT     UINT32  *Ebx   OPTIONAL,
5709
  OUT     UINT32                    *Ecx,  OPTIONAL
5794
  OUT     UINT32  *Ecx   OPTIONAL,
5710
  OUT     UINT32                    *Edx   OPTIONAL
5795
  OUT     UINT32  *Edx   OPTIONAL
5711
  );
5796
  );
5712
5797
5713
5714
/**
5798
/**
5715
  Set CD bit and clear NW bit of CR0 followed by a WBINVD.
5799
  Set CD bit and clear NW bit of CR0 followed by a WBINVD.
5716
5800
Lines 5724-5730 AsmDisableCache ( Link Here
5724
  VOID
5808
  VOID
5725
  );
5809
  );
5726
5810
5727
5728
/**
5811
/**
5729
  Perform a WBINVD and clear both the CD and NW bits of CR0.
5812
  Perform a WBINVD and clear both the CD and NW bits of CR0.
5730
5813
Lines 5738-5744 AsmEnableCache ( Link Here
5738
  VOID
5821
  VOID
5739
  );
5822
  );
5740
5823
5741
5742
/**
5824
/**
5743
  Returns the lower 32-bits of a Machine Specific Register(MSR).
5825
  Returns the lower 32-bits of a Machine Specific Register(MSR).
5744
5826
Lines 5756-5765 AsmEnableCache ( Link Here
5756
UINT32
5838
UINT32
5757
EFIAPI
5839
EFIAPI
5758
AsmReadMsr32 (
5840
AsmReadMsr32 (
5759
  IN      UINT32                    Index
5841
  IN      UINT32  Index
5760
  );
5842
  );
5761
5843
5762
5763
/**
5844
/**
5764
  Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
5845
  Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.
5765
  The upper 32-bits of the MSR are set to zero.
5846
  The upper 32-bits of the MSR are set to zero.
Lines 5780-5790 AsmReadMsr32 ( Link Here
5780
UINT32
5861
UINT32
5781
EFIAPI
5862
EFIAPI
5782
AsmWriteMsr32 (
5863
AsmWriteMsr32 (
5783
  IN      UINT32                    Index,
5864
  IN      UINT32  Index,
5784
  IN      UINT32                    Value
5865
  IN      UINT32  Value
5785
  );
5866
  );
5786
5867
5787
5788
/**
5868
/**
5789
  Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and
5869
  Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and
5790
  writes the result back to the 64-bit MSR.
5870
  writes the result back to the 64-bit MSR.
Lines 5807-5817 AsmWriteMsr32 ( Link Here
5807
UINT32
5887
UINT32
5808
EFIAPI
5888
EFIAPI
5809
AsmMsrOr32 (
5889
AsmMsrOr32 (
5810
  IN      UINT32                    Index,
5890
  IN      UINT32  Index,
5811
  IN      UINT32                    OrData
5891
  IN      UINT32  OrData
5812
  );
5892
  );
5813
5893
5814
5815
/**
5894
/**
5816
  Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
5895
  Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
5817
  the result back to the 64-bit MSR.
5896
  the result back to the 64-bit MSR.
Lines 5834-5844 AsmMsrOr32 ( Link Here
5834
UINT32
5913
UINT32
5835
EFIAPI
5914
EFIAPI
5836
AsmMsrAnd32 (
5915
AsmMsrAnd32 (
5837
  IN      UINT32                    Index,
5916
  IN      UINT32  Index,
5838
  IN      UINT32                    AndData
5917
  IN      UINT32  AndData
5839
  );
5918
  );
5840
5919
5841
5842
/**
5920
/**
5843
  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR
5921
  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR
5844
  on the lower 32-bits, and writes the result back to the 64-bit MSR.
5922
  on the lower 32-bits, and writes the result back to the 64-bit MSR.
Lines 5864-5875 AsmMsrAnd32 ( Link Here
5864
UINT32
5942
UINT32
5865
EFIAPI
5943
EFIAPI
5866
AsmMsrAndThenOr32 (
5944
AsmMsrAndThenOr32 (
5867
  IN      UINT32                    Index,
5945
  IN      UINT32  Index,
5868
  IN      UINT32                    AndData,
5946
  IN      UINT32  AndData,
5869
  IN      UINT32                    OrData
5947
  IN      UINT32  OrData
5870
  );
5948
  );
5871
5949
5872
5873
/**
5950
/**
5874
  Reads a bit field of an MSR.
5951
  Reads a bit field of an MSR.
5875
5952
Lines 5895-5906 AsmMsrAndThenOr32 ( Link Here
5895
UINT32
5972
UINT32
5896
EFIAPI
5973
EFIAPI
5897
AsmMsrBitFieldRead32 (
5974
AsmMsrBitFieldRead32 (
5898
  IN      UINT32                    Index,
5975
  IN      UINT32  Index,
5899
  IN      UINTN                     StartBit,
5976
  IN      UINTN   StartBit,
5900
  IN      UINTN                     EndBit
5977
  IN      UINTN   EndBit
5901
  );
5978
  );
5902
5979
5903
5904
/**
5980
/**
5905
  Writes a bit field to an MSR.
5981
  Writes a bit field to an MSR.
5906
5982
Lines 5929-5941 AsmMsrBitFieldRead32 ( Link Here
5929
UINT32
6005
UINT32
5930
EFIAPI
6006
EFIAPI
5931
AsmMsrBitFieldWrite32 (
6007
AsmMsrBitFieldWrite32 (
5932
  IN      UINT32                    Index,
6008
  IN      UINT32  Index,
5933
  IN      UINTN                     StartBit,
6009
  IN      UINTN   StartBit,
5934
  IN      UINTN                     EndBit,
6010
  IN      UINTN   EndBit,
5935
  IN      UINT32                    Value
6011
  IN      UINT32  Value
5936
  );
6012
  );
5937
6013
5938
5939
/**
6014
/**
5940
  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
6015
  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
5941
  result back to the bit field in the 64-bit MSR.
6016
  result back to the bit field in the 64-bit MSR.
Lines 5966-5978 AsmMsrBitFieldWrite32 ( Link Here
5966
UINT32
6041
UINT32
5967
EFIAPI
6042
EFIAPI
5968
AsmMsrBitFieldOr32 (
6043
AsmMsrBitFieldOr32 (
5969
  IN      UINT32                    Index,
6044
  IN      UINT32  Index,
5970
  IN      UINTN                     StartBit,
6045
  IN      UINTN   StartBit,
5971
  IN      UINTN                     EndBit,
6046
  IN      UINTN   EndBit,
5972
  IN      UINT32                    OrData
6047
  IN      UINT32  OrData
5973
  );
6048
  );
5974
6049
5975
5976
/**
6050
/**
5977
  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
6051
  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
5978
  result back to the bit field in the 64-bit MSR.
6052
  result back to the bit field in the 64-bit MSR.
Lines 6003-6015 AsmMsrBitFieldOr32 ( Link Here
6003
UINT32
6077
UINT32
6004
EFIAPI
6078
EFIAPI
6005
AsmMsrBitFieldAnd32 (
6079
AsmMsrBitFieldAnd32 (
6006
  IN      UINT32                    Index,
6080
  IN      UINT32  Index,
6007
  IN      UINTN                     StartBit,
6081
  IN      UINTN   StartBit,
6008
  IN      UINTN                     EndBit,
6082
  IN      UINTN   EndBit,
6009
  IN      UINT32                    AndData
6083
  IN      UINT32  AndData
6010
  );
6084
  );
6011
6085
6012
6013
/**
6086
/**
6014
  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6087
  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6015
  bitwise OR, and writes the result back to the bit field in the
6088
  bitwise OR, and writes the result back to the bit field in the
Lines 6044-6057 AsmMsrBitFieldAnd32 ( Link Here
6044
UINT32
6117
UINT32
6045
EFIAPI
6118
EFIAPI
6046
AsmMsrBitFieldAndThenOr32 (
6119
AsmMsrBitFieldAndThenOr32 (
6047
  IN      UINT32                    Index,
6120
  IN      UINT32  Index,
6048
  IN      UINTN                     StartBit,
6121
  IN      UINTN   StartBit,
6049
  IN      UINTN                     EndBit,
6122
  IN      UINTN   EndBit,
6050
  IN      UINT32                    AndData,
6123
  IN      UINT32  AndData,
6051
  IN      UINT32                    OrData
6124
  IN      UINT32  OrData
6052
  );
6125
  );
6053
6126
6054
6055
/**
6127
/**
6056
  Returns a 64-bit Machine Specific Register(MSR).
6128
  Returns a 64-bit Machine Specific Register(MSR).
6057
6129
Lines 6069-6078 AsmMsrBitFieldAndThenOr32 ( Link Here
6069
UINT64
6141
UINT64
6070
EFIAPI
6142
EFIAPI
6071
AsmReadMsr64 (
6143
AsmReadMsr64 (
6072
  IN      UINT32                    Index
6144
  IN      UINT32  Index
6073
  );
6145
  );
6074
6146
6075
6076
/**
6147
/**
6077
  Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
6148
  Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
6078
  value.
6149
  value.
Lines 6093-6103 AsmReadMsr64 ( Link Here
6093
UINT64
6164
UINT64
6094
EFIAPI
6165
EFIAPI
6095
AsmWriteMsr64 (
6166
AsmWriteMsr64 (
6096
  IN      UINT32                    Index,
6167
  IN      UINT32  Index,
6097
  IN      UINT64                    Value
6168
  IN      UINT64  Value
6098
  );
6169
  );
6099
6170
6100
6101
/**
6171
/**
6102
  Reads a 64-bit MSR, performs a bitwise OR, and writes the result
6172
  Reads a 64-bit MSR, performs a bitwise OR, and writes the result
6103
  back to the 64-bit MSR.
6173
  back to the 64-bit MSR.
Lines 6119-6129 AsmWriteMsr64 ( Link Here
6119
UINT64
6189
UINT64
6120
EFIAPI
6190
EFIAPI
6121
AsmMsrOr64 (
6191
AsmMsrOr64 (
6122
  IN      UINT32                    Index,
6192
  IN      UINT32  Index,
6123
  IN      UINT64                    OrData
6193
  IN      UINT64  OrData
6124
  );
6194
  );
6125
6195
6126
6127
/**
6196
/**
6128
  Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
6197
  Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
6129
  64-bit MSR.
6198
  64-bit MSR.
Lines 6145-6155 AsmMsrOr64 ( Link Here
6145
UINT64
6214
UINT64
6146
EFIAPI
6215
EFIAPI
6147
AsmMsrAnd64 (
6216
AsmMsrAnd64 (
6148
  IN      UINT32                    Index,
6217
  IN      UINT32  Index,
6149
  IN      UINT64                    AndData
6218
  IN      UINT64  AndData
6150
  );
6219
  );
6151
6220
6152
6153
/**
6221
/**
6154
  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise
6222
  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise
6155
  OR, and writes the result back to the 64-bit MSR.
6223
  OR, and writes the result back to the 64-bit MSR.
Lines 6174-6185 AsmMsrAnd64 ( Link Here
6174
UINT64
6242
UINT64
6175
EFIAPI
6243
EFIAPI
6176
AsmMsrAndThenOr64 (
6244
AsmMsrAndThenOr64 (
6177
  IN      UINT32                    Index,
6245
  IN      UINT32  Index,
6178
  IN      UINT64                    AndData,
6246
  IN      UINT64  AndData,
6179
  IN      UINT64                    OrData
6247
  IN      UINT64  OrData
6180
  );
6248
  );
6181
6249
6182
6183
/**
6250
/**
6184
  Reads a bit field of an MSR.
6251
  Reads a bit field of an MSR.
6185
6252
Lines 6205-6216 AsmMsrAndThenOr64 ( Link Here
6205
UINT64
6272
UINT64
6206
EFIAPI
6273
EFIAPI
6207
AsmMsrBitFieldRead64 (
6274
AsmMsrBitFieldRead64 (
6208
  IN      UINT32                    Index,
6275
  IN      UINT32  Index,
6209
  IN      UINTN                     StartBit,
6276
  IN      UINTN   StartBit,
6210
  IN      UINTN                     EndBit
6277
  IN      UINTN   EndBit
6211
  );
6278
  );
6212
6279
6213
6214
/**
6280
/**
6215
  Writes a bit field to an MSR.
6281
  Writes a bit field to an MSR.
6216
6282
Lines 6238-6250 AsmMsrBitFieldRead64 ( Link Here
6238
UINT64
6304
UINT64
6239
EFIAPI
6305
EFIAPI
6240
AsmMsrBitFieldWrite64 (
6306
AsmMsrBitFieldWrite64 (
6241
  IN      UINT32                    Index,
6307
  IN      UINT32  Index,
6242
  IN      UINTN                     StartBit,
6308
  IN      UINTN   StartBit,
6243
  IN      UINTN                     EndBit,
6309
  IN      UINTN   EndBit,
6244
  IN      UINT64                    Value
6310
  IN      UINT64  Value
6245
  );
6311
  );
6246
6312
6247
6248
/**
6313
/**
6249
  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and
6314
  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and
6250
  writes the result back to the bit field in the 64-bit MSR.
6315
  writes the result back to the bit field in the 64-bit MSR.
Lines 6275-6287 AsmMsrBitFieldWrite64 ( Link Here
6275
UINT64
6340
UINT64
6276
EFIAPI
6341
EFIAPI
6277
AsmMsrBitFieldOr64 (
6342
AsmMsrBitFieldOr64 (
6278
  IN      UINT32                    Index,
6343
  IN      UINT32  Index,
6279
  IN      UINTN                     StartBit,
6344
  IN      UINTN   StartBit,
6280
  IN      UINTN                     EndBit,
6345
  IN      UINTN   EndBit,
6281
  IN      UINT64                    OrData
6346
  IN      UINT64  OrData
6282
  );
6347
  );
6283
6348
6284
6285
/**
6349
/**
6286
  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
6350
  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
6287
  result back to the bit field in the 64-bit MSR.
6351
  result back to the bit field in the 64-bit MSR.
Lines 6312-6324 AsmMsrBitFieldOr64 ( Link Here
6312
UINT64
6376
UINT64
6313
EFIAPI
6377
EFIAPI
6314
AsmMsrBitFieldAnd64 (
6378
AsmMsrBitFieldAnd64 (
6315
  IN      UINT32                    Index,
6379
  IN      UINT32  Index,
6316
  IN      UINTN                     StartBit,
6380
  IN      UINTN   StartBit,
6317
  IN      UINTN                     EndBit,
6381
  IN      UINTN   EndBit,
6318
  IN      UINT64                    AndData
6382
  IN      UINT64  AndData
6319
  );
6383
  );
6320
6384
6321
6322
/**
6385
/**
6323
  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6386
  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
6324
  bitwise OR, and writes the result back to the bit field in the
6387
  bitwise OR, and writes the result back to the bit field in the
Lines 6352-6365 AsmMsrBitFieldAnd64 ( Link Here
6352
UINT64
6415
UINT64
6353
EFIAPI
6416
EFIAPI
6354
AsmMsrBitFieldAndThenOr64 (
6417
AsmMsrBitFieldAndThenOr64 (
6355
  IN      UINT32                    Index,
6418
  IN      UINT32  Index,
6356
  IN      UINTN                     StartBit,
6419
  IN      UINTN   StartBit,
6357
  IN      UINTN                     EndBit,
6420
  IN      UINTN   EndBit,
6358
  IN      UINT64                    AndData,
6421
  IN      UINT64  AndData,
6359
  IN      UINT64                    OrData
6422
  IN      UINT64  OrData
6360
  );
6423
  );
6361
6424
6362
6363
/**
6425
/**
6364
  Reads the current value of the EFLAGS register.
6426
  Reads the current value of the EFLAGS register.
6365
6427
Lines 6376-6382 AsmReadEflags ( Link Here
6376
  VOID
6438
  VOID
6377
  );
6439
  );
6378
6440
6379
6380
/**
6441
/**
6381
  Reads the current value of the Control Register 0 (CR0).
6442
  Reads the current value of the Control Register 0 (CR0).
6382
6443
Lines 6393-6399 AsmReadCr0 ( Link Here
6393
  VOID
6454
  VOID
6394
  );
6455
  );
6395
6456
6396
6397
/**
6457
/**
6398
  Reads the current value of the Control Register 2 (CR2).
6458
  Reads the current value of the Control Register 2 (CR2).
6399
6459
Lines 6410-6416 AsmReadCr2 ( Link Here
6410
  VOID
6470
  VOID
6411
  );
6471
  );
6412
6472
6413
6414
/**
6473
/**
6415
  Reads the current value of the Control Register 3 (CR3).
6474
  Reads the current value of the Control Register 3 (CR3).
6416
6475
Lines 6427-6433 AsmReadCr3 ( Link Here
6427
  VOID
6486
  VOID
6428
  );
6487
  );
6429
6488
6430
6431
/**
6489
/**
6432
  Reads the current value of the Control Register 4 (CR4).
6490
  Reads the current value of the Control Register 4 (CR4).
6433
6491
Lines 6444-6450 AsmReadCr4 ( Link Here
6444
  VOID
6502
  VOID
6445
  );
6503
  );
6446
6504
6447
6448
/**
6505
/**
6449
  Writes a value to Control Register 0 (CR0).
6506
  Writes a value to Control Register 0 (CR0).
6450
6507
Lines 6462-6468 AsmWriteCr0 ( Link Here
6462
  UINTN  Cr0
6519
  UINTN  Cr0
6463
  );
6520
  );
6464
6521
6465
6466
/**
6522
/**
6467
  Writes a value to Control Register 2 (CR2).
6523
  Writes a value to Control Register 2 (CR2).
6468
6524
Lines 6480-6486 AsmWriteCr2 ( Link Here
6480
  UINTN  Cr2
6536
  UINTN  Cr2
6481
  );
6537
  );
6482
6538
6483
6484
/**
6539
/**
6485
  Writes a value to Control Register 3 (CR3).
6540
  Writes a value to Control Register 3 (CR3).
6486
6541
Lines 6498-6504 AsmWriteCr3 ( Link Here
6498
  UINTN  Cr3
6553
  UINTN  Cr3
6499
  );
6554
  );
6500
6555
6501
6502
/**
6556
/**
6503
  Writes a value to Control Register 4 (CR4).
6557
  Writes a value to Control Register 4 (CR4).
6504
6558
Lines 6516-6522 AsmWriteCr4 ( Link Here
6516
  UINTN  Cr4
6570
  UINTN  Cr4
6517
  );
6571
  );
6518
6572
6519
6520
/**
6573
/**
6521
  Reads the current value of Debug Register 0 (DR0).
6574
  Reads the current value of Debug Register 0 (DR0).
6522
6575
Lines 6533-6539 AsmReadDr0 ( Link Here
6533
  VOID
6586
  VOID
6534
  );
6587
  );
6535
6588
6536
6537
/**
6589
/**
6538
  Reads the current value of Debug Register 1 (DR1).
6590
  Reads the current value of Debug Register 1 (DR1).
6539
6591
Lines 6550-6556 AsmReadDr1 ( Link Here
6550
  VOID
6602
  VOID
6551
  );
6603
  );
6552
6604
6553
6554
/**
6605
/**
6555
  Reads the current value of Debug Register 2 (DR2).
6606
  Reads the current value of Debug Register 2 (DR2).
6556
6607
Lines 6567-6573 AsmReadDr2 ( Link Here
6567
  VOID
6618
  VOID
6568
  );
6619
  );
6569
6620
6570
6571
/**
6621
/**
6572
  Reads the current value of Debug Register 3 (DR3).
6622
  Reads the current value of Debug Register 3 (DR3).
6573
6623
Lines 6584-6590 AsmReadDr3 ( Link Here
6584
  VOID
6634
  VOID
6585
  );
6635
  );
6586
6636
6587
6588
/**
6637
/**
6589
  Reads the current value of Debug Register 4 (DR4).
6638
  Reads the current value of Debug Register 4 (DR4).
6590
6639
Lines 6601-6607 AsmReadDr4 ( Link Here
6601
  VOID
6650
  VOID
6602
  );
6651
  );
6603
6652
6604
6605
/**
6653
/**
6606
  Reads the current value of Debug Register 5 (DR5).
6654
  Reads the current value of Debug Register 5 (DR5).
6607
6655
Lines 6618-6624 AsmReadDr5 ( Link Here
6618
  VOID
6666
  VOID
6619
  );
6667
  );
6620
6668
6621
6622
/**
6669
/**
6623
  Reads the current value of Debug Register 6 (DR6).
6670
  Reads the current value of Debug Register 6 (DR6).
6624
6671
Lines 6635-6641 AsmReadDr6 ( Link Here
6635
  VOID
6682
  VOID
6636
  );
6683
  );
6637
6684
6638
6639
/**
6685
/**
6640
  Reads the current value of Debug Register 7 (DR7).
6686
  Reads the current value of Debug Register 7 (DR7).
6641
6687
Lines 6652-6658 AsmReadDr7 ( Link Here
6652
  VOID
6698
  VOID
6653
  );
6699
  );
6654
6700
6655
6656
/**
6701
/**
6657
  Writes a value to Debug Register 0 (DR0).
6702
  Writes a value to Debug Register 0 (DR0).
6658
6703
Lines 6670-6676 AsmWriteDr0 ( Link Here
6670
  UINTN  Dr0
6715
  UINTN  Dr0
6671
  );
6716
  );
6672
6717
6673
6674
/**
6718
/**
6675
  Writes a value to Debug Register 1 (DR1).
6719
  Writes a value to Debug Register 1 (DR1).
6676
6720
Lines 6688-6694 AsmWriteDr1 ( Link Here
6688
  UINTN  Dr1
6732
  UINTN  Dr1
6689
  );
6733
  );
6690
6734
6691
6692
/**
6735
/**
6693
  Writes a value to Debug Register 2 (DR2).
6736
  Writes a value to Debug Register 2 (DR2).
6694
6737
Lines 6706-6712 AsmWriteDr2 ( Link Here
6706
  UINTN  Dr2
6749
  UINTN  Dr2
6707
  );
6750
  );
6708
6751
6709
6710
/**
6752
/**
6711
  Writes a value to Debug Register 3 (DR3).
6753
  Writes a value to Debug Register 3 (DR3).
6712
6754
Lines 6724-6730 AsmWriteDr3 ( Link Here
6724
  UINTN  Dr3
6766
  UINTN  Dr3
6725
  );
6767
  );
6726
6768
6727
6728
/**
6769
/**
6729
  Writes a value to Debug Register 4 (DR4).
6770
  Writes a value to Debug Register 4 (DR4).
6730
6771
Lines 6742-6748 AsmWriteDr4 ( Link Here
6742
  UINTN  Dr4
6783
  UINTN  Dr4
6743
  );
6784
  );
6744
6785
6745
6746
/**
6786
/**
6747
  Writes a value to Debug Register 5 (DR5).
6787
  Writes a value to Debug Register 5 (DR5).
6748
6788
Lines 6760-6766 AsmWriteDr5 ( Link Here
6760
  UINTN  Dr5
6800
  UINTN  Dr5
6761
  );
6801
  );
6762
6802
6763
6764
/**
6803
/**
6765
  Writes a value to Debug Register 6 (DR6).
6804
  Writes a value to Debug Register 6 (DR6).
6766
6805
Lines 6778-6784 AsmWriteDr6 ( Link Here
6778
  UINTN  Dr6
6817
  UINTN  Dr6
6779
  );
6818
  );
6780
6819
6781
6782
/**
6820
/**
6783
  Writes a value to Debug Register 7 (DR7).
6821
  Writes a value to Debug Register 7 (DR7).
6784
6822
Lines 6796-6802 AsmWriteDr7 ( Link Here
6796
  UINTN  Dr7
6834
  UINTN  Dr7
6797
  );
6835
  );
6798
6836
6799
6800
/**
6837
/**
6801
  Reads the current value of Code Segment Register (CS).
6838
  Reads the current value of Code Segment Register (CS).
6802
6839
Lines 6812-6818 AsmReadCs ( Link Here
6812
  VOID
6849
  VOID
6813
  );
6850
  );
6814
6851
6815
6816
/**
6852
/**
6817
  Reads the current value of Data Segment Register (DS).
6853
  Reads the current value of Data Segment Register (DS).
6818
6854
Lines 6828-6834 AsmReadDs ( Link Here
6828
  VOID
6864
  VOID
6829
  );
6865
  );
6830
6866
6831
6832
/**
6867
/**
6833
  Reads the current value of Extra Segment Register (ES).
6868
  Reads the current value of Extra Segment Register (ES).
6834
6869
Lines 6844-6850 AsmReadEs ( Link Here
6844
  VOID
6879
  VOID
6845
  );
6880
  );
6846
6881
6847
6848
/**
6882
/**
6849
  Reads the current value of FS Data Segment Register (FS).
6883
  Reads the current value of FS Data Segment Register (FS).
6850
6884
Lines 6860-6866 AsmReadFs ( Link Here
6860
  VOID
6894
  VOID
6861
  );
6895
  );
6862
6896
6863
6864
/**
6897
/**
6865
  Reads the current value of GS Data Segment Register (GS).
6898
  Reads the current value of GS Data Segment Register (GS).
6866
6899
Lines 6876-6882 AsmReadGs ( Link Here
6876
  VOID
6909
  VOID
6877
  );
6910
  );
6878
6911
6879
6880
/**
6912
/**
6881
  Reads the current value of Stack Segment Register (SS).
6913
  Reads the current value of Stack Segment Register (SS).
6882
6914
Lines 6892-6898 AsmReadSs ( Link Here
6892
  VOID
6924
  VOID
6893
  );
6925
  );
6894
6926
6895
6896
/**
6927
/**
6897
  Reads the current value of Task Register (TR).
6928
  Reads the current value of Task Register (TR).
6898
6929
Lines 6908-6914 AsmReadTr ( Link Here
6908
  VOID
6939
  VOID
6909
  );
6940
  );
6910
6941
6911
6912
/**
6942
/**
6913
  Reads the current Global Descriptor Table Register(GDTR) descriptor.
6943
  Reads the current Global Descriptor Table Register(GDTR) descriptor.
6914
6944
Lines 6923-6932 AsmReadTr ( Link Here
6923
VOID
6953
VOID
6924
EFIAPI
6954
EFIAPI
6925
AsmReadGdtr (
6955
AsmReadGdtr (
6926
  OUT     IA32_DESCRIPTOR           *Gdtr
6956
  OUT     IA32_DESCRIPTOR  *Gdtr
6927
  );
6957
  );
6928
6958
6929
6930
/**
6959
/**
6931
  Writes the current Global Descriptor Table Register (GDTR) descriptor.
6960
  Writes the current Global Descriptor Table Register (GDTR) descriptor.
6932
6961
Lines 6941-6950 AsmReadGdtr ( Link Here
6941
VOID
6970
VOID
6942
EFIAPI
6971
EFIAPI
6943
AsmWriteGdtr (
6972
AsmWriteGdtr (
6944
  IN      CONST IA32_DESCRIPTOR     *Gdtr
6973
  IN      CONST IA32_DESCRIPTOR  *Gdtr
6945
  );
6974
  );
6946
6975
6947
6948
/**
6976
/**
6949
  Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
6977
  Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.
6950
6978
Lines 6959-6968 AsmWriteGdtr ( Link Here
6959
VOID
6987
VOID
6960
EFIAPI
6988
EFIAPI
6961
AsmReadIdtr (
6989
AsmReadIdtr (
6962
  OUT     IA32_DESCRIPTOR           *Idtr
6990
  OUT     IA32_DESCRIPTOR  *Idtr
6963
  );
6991
  );
6964
6992
6965
6966
/**
6993
/**
6967
  Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
6994
  Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.
6968
6995
Lines 6977-6986 AsmReadIdtr ( Link Here
6977
VOID
7004
VOID
6978
EFIAPI
7005
EFIAPI
6979
AsmWriteIdtr (
7006
AsmWriteIdtr (
6980
  IN      CONST IA32_DESCRIPTOR     *Idtr
7007
  IN      CONST IA32_DESCRIPTOR  *Idtr
6981
  );
7008
  );
6982
7009
6983
6984
/**
7010
/**
6985
  Reads the current Local Descriptor Table Register(LDTR) selector.
7011
  Reads the current Local Descriptor Table Register(LDTR) selector.
6986
7012
Lines 6996-7002 AsmReadLdtr ( Link Here
6996
  VOID
7022
  VOID
6997
  );
7023
  );
6998
7024
6999
7000
/**
7025
/**
7001
  Writes the current Local Descriptor Table Register (LDTR) selector.
7026
  Writes the current Local Descriptor Table Register (LDTR) selector.
7002
7027
Lines 7009-7018 AsmReadLdtr ( Link Here
7009
VOID
7034
VOID
7010
EFIAPI
7035
EFIAPI
7011
AsmWriteLdtr (
7036
AsmWriteLdtr (
7012
  IN      UINT16                    Ldtr
7037
  IN      UINT16  Ldtr
7013
  );
7038
  );
7014
7039
7015
7016
/**
7040
/**
7017
  Save the current floating point/SSE/SSE2 context to a buffer.
7041
  Save the current floating point/SSE/SSE2 context to a buffer.
7018
7042
Lines 7029-7038 AsmWriteLdtr ( Link Here
7029
VOID
7053
VOID
7030
EFIAPI
7054
EFIAPI
7031
AsmFxSave (
7055
AsmFxSave (
7032
  OUT     IA32_FX_BUFFER            *Buffer
7056
  OUT     IA32_FX_BUFFER  *Buffer
7033
  );
7057
  );
7034
7058
7035
7036
/**
7059
/**
7037
  Restores the current floating point/SSE/SSE2 context from a buffer.
7060
  Restores the current floating point/SSE/SSE2 context from a buffer.
7038
7061
Lines 7050-7059 AsmFxSave ( Link Here
7050
VOID
7073
VOID
7051
EFIAPI
7074
EFIAPI
7052
AsmFxRestore (
7075
AsmFxRestore (
7053
  IN      CONST IA32_FX_BUFFER      *Buffer
7076
  IN      CONST IA32_FX_BUFFER  *Buffer
7054
  );
7077
  );
7055
7078
7056
7057
/**
7079
/**
7058
  Reads the current value of 64-bit MMX Register #0 (MM0).
7080
  Reads the current value of 64-bit MMX Register #0 (MM0).
7059
7081
Lines 7069-7075 AsmReadMm0 ( Link Here
7069
  VOID
7091
  VOID
7070
  );
7092
  );
7071
7093
7072
7073
/**
7094
/**
7074
  Reads the current value of 64-bit MMX Register #1 (MM1).
7095
  Reads the current value of 64-bit MMX Register #1 (MM1).
7075
7096
Lines 7085-7091 AsmReadMm1 ( Link Here
7085
  VOID
7106
  VOID
7086
  );
7107
  );
7087
7108
7088
7089
/**
7109
/**
7090
  Reads the current value of 64-bit MMX Register #2 (MM2).
7110
  Reads the current value of 64-bit MMX Register #2 (MM2).
7091
7111
Lines 7101-7107 AsmReadMm2 ( Link Here
7101
  VOID
7121
  VOID
7102
  );
7122
  );
7103
7123
7104
7105
/**
7124
/**
7106
  Reads the current value of 64-bit MMX Register #3 (MM3).
7125
  Reads the current value of 64-bit MMX Register #3 (MM3).
7107
7126
Lines 7117-7123 AsmReadMm3 ( Link Here
7117
  VOID
7136
  VOID
7118
  );
7137
  );
7119
7138
7120
7121
/**
7139
/**
7122
  Reads the current value of 64-bit MMX Register #4 (MM4).
7140
  Reads the current value of 64-bit MMX Register #4 (MM4).
7123
7141
Lines 7133-7139 AsmReadMm4 ( Link Here
7133
  VOID
7151
  VOID
7134
  );
7152
  );
7135
7153
7136
7137
/**
7154
/**
7138
  Reads the current value of 64-bit MMX Register #5 (MM5).
7155
  Reads the current value of 64-bit MMX Register #5 (MM5).
7139
7156
Lines 7149-7155 AsmReadMm5 ( Link Here
7149
  VOID
7166
  VOID
7150
  );
7167
  );
7151
7168
7152
7153
/**
7169
/**
7154
  Reads the current value of 64-bit MMX Register #6 (MM6).
7170
  Reads the current value of 64-bit MMX Register #6 (MM6).
7155
7171
Lines 7165-7171 AsmReadMm6 ( Link Here
7165
  VOID
7181
  VOID
7166
  );
7182
  );
7167
7183
7168
7169
/**
7184
/**
7170
  Reads the current value of 64-bit MMX Register #7 (MM7).
7185
  Reads the current value of 64-bit MMX Register #7 (MM7).
7171
7186
Lines 7181-7187 AsmReadMm7 ( Link Here
7181
  VOID
7196
  VOID
7182
  );
7197
  );
7183
7198
7184
7185
/**
7199
/**
7186
  Writes the current value of 64-bit MMX Register #0 (MM0).
7200
  Writes the current value of 64-bit MMX Register #0 (MM0).
7187
7201
Lines 7194-7203 AsmReadMm7 ( Link Here
7194
VOID
7208
VOID
7195
EFIAPI
7209
EFIAPI
7196
AsmWriteMm0 (
7210
AsmWriteMm0 (
7197
  IN      UINT64                    Value
7211
  IN      UINT64  Value
7198
  );
7212
  );
7199
7213
7200
7201
/**
7214
/**
7202
  Writes the current value of 64-bit MMX Register #1 (MM1).
7215
  Writes the current value of 64-bit MMX Register #1 (MM1).
7203
7216
Lines 7210-7219 AsmWriteMm0 ( Link Here
7210
VOID
7223
VOID
7211
EFIAPI
7224
EFIAPI
7212
AsmWriteMm1 (
7225
AsmWriteMm1 (
7213
  IN      UINT64                    Value
7226
  IN      UINT64  Value
7214
  );
7227
  );
7215
7228
7216
7217
/**
7229
/**
7218
  Writes the current value of 64-bit MMX Register #2 (MM2).
7230
  Writes the current value of 64-bit MMX Register #2 (MM2).
7219
7231
Lines 7226-7235 AsmWriteMm1 ( Link Here
7226
VOID
7238
VOID
7227
EFIAPI
7239
EFIAPI
7228
AsmWriteMm2 (
7240
AsmWriteMm2 (
7229
  IN      UINT64                    Value
7241
  IN      UINT64  Value
7230
  );
7242
  );
7231
7243
7232
7233
/**
7244
/**
7234
  Writes the current value of 64-bit MMX Register #3 (MM3).
7245
  Writes the current value of 64-bit MMX Register #3 (MM3).
7235
7246
Lines 7242-7251 AsmWriteMm2 ( Link Here
7242
VOID
7253
VOID
7243
EFIAPI
7254
EFIAPI
7244
AsmWriteMm3 (
7255
AsmWriteMm3 (
7245
  IN      UINT64                    Value
7256
  IN      UINT64  Value
7246
  );
7257
  );
7247
7258
7248
7249
/**
7259
/**
7250
  Writes the current value of 64-bit MMX Register #4 (MM4).
7260
  Writes the current value of 64-bit MMX Register #4 (MM4).
7251
7261
Lines 7258-7267 AsmWriteMm3 ( Link Here
7258
VOID
7268
VOID
7259
EFIAPI
7269
EFIAPI
7260
AsmWriteMm4 (
7270
AsmWriteMm4 (
7261
  IN      UINT64                    Value
7271
  IN      UINT64  Value
7262
  );
7272
  );
7263
7273
7264
7265
/**
7274
/**
7266
  Writes the current value of 64-bit MMX Register #5 (MM5).
7275
  Writes the current value of 64-bit MMX Register #5 (MM5).
7267
7276
Lines 7274-7283 AsmWriteMm4 ( Link Here
7274
VOID
7283
VOID
7275
EFIAPI
7284
EFIAPI
7276
AsmWriteMm5 (
7285
AsmWriteMm5 (
7277
  IN      UINT64                    Value
7286
  IN      UINT64  Value
7278
  );
7287
  );
7279
7288
7280
7281
/**
7289
/**
7282
  Writes the current value of 64-bit MMX Register #6 (MM6).
7290
  Writes the current value of 64-bit MMX Register #6 (MM6).
7283
7291
Lines 7290-7299 AsmWriteMm5 ( Link Here
7290
VOID
7298
VOID
7291
EFIAPI
7299
EFIAPI
7292
AsmWriteMm6 (
7300
AsmWriteMm6 (
7293
  IN      UINT64                    Value
7301
  IN      UINT64  Value
7294
  );
7302
  );
7295
7303
7296
7297
/**
7304
/**
7298
  Writes the current value of 64-bit MMX Register #7 (MM7).
7305
  Writes the current value of 64-bit MMX Register #7 (MM7).
7299
7306
Lines 7306-7315 AsmWriteMm6 ( Link Here
7306
VOID
7313
VOID
7307
EFIAPI
7314
EFIAPI
7308
AsmWriteMm7 (
7315
AsmWriteMm7 (
7309
  IN      UINT64                    Value
7316
  IN      UINT64  Value
7310
  );
7317
  );
7311
7318
7312
7313
/**
7319
/**
7314
  Reads the current value of Time Stamp Counter (TSC).
7320
  Reads the current value of Time Stamp Counter (TSC).
7315
7321
Lines 7325-7331 AsmReadTsc ( Link Here
7325
  VOID
7331
  VOID
7326
  );
7332
  );
7327
7333
7328
7329
/**
7334
/**
7330
  Reads the current value of a Performance Counter (PMC).
7335
  Reads the current value of a Performance Counter (PMC).
7331
7336
Lines 7340-7349 AsmReadTsc ( Link Here
7340
UINT64
7345
UINT64
7341
EFIAPI
7346
EFIAPI
7342
AsmReadPmc (
7347
AsmReadPmc (
7343
  IN      UINT32                    Index
7348
  IN      UINT32  Index
7344
  );
7349
  );
7345
7350
7346
7347
/**
7351
/**
7348
  Sets up a monitor buffer that is used by AsmMwait().
7352
  Sets up a monitor buffer that is used by AsmMwait().
7349
7353
Lines 7363-7374 AsmReadPmc ( Link Here
7363
UINTN
7367
UINTN
7364
EFIAPI
7368
EFIAPI
7365
AsmMonitor (
7369
AsmMonitor (
7366
  IN      UINTN                     Eax,
7370
  IN      UINTN  Eax,
7367
  IN      UINTN                     Ecx,
7371
  IN      UINTN  Ecx,
7368
  IN      UINTN                     Edx
7372
  IN      UINTN  Edx
7369
  );
7373
  );
7370
7374
7371
7372
/**
7375
/**
7373
  Executes an MWAIT instruction.
7376
  Executes an MWAIT instruction.
7374
7377
Lines 7386-7396 AsmMonitor ( Link Here
7386
UINTN
7389
UINTN
7387
EFIAPI
7390
EFIAPI
7388
AsmMwait (
7391
AsmMwait (
7389
  IN      UINTN                     Eax,
7392
  IN      UINTN  Eax,
7390
  IN      UINTN                     Ecx
7393
  IN      UINTN  Ecx
7391
  );
7394
  );
7392
7395
7393
7394
/**
7396
/**
7395
  Executes a WBINVD instruction.
7397
  Executes a WBINVD instruction.
7396
7398
Lines 7404-7410 AsmWbinvd ( Link Here
7404
  VOID
7406
  VOID
7405
  );
7407
  );
7406
7408
7407
7408
/**
7409
/**
7409
  Executes a INVD instruction.
7410
  Executes a INVD instruction.
7410
7411
Lines 7418-7424 AsmInvd ( Link Here
7418
  VOID
7419
  VOID
7419
  );
7420
  );
7420
7421
7421
7422
/**
7422
/**
7423
  Flushes a cache line from all the instruction and data caches within the
7423
  Flushes a cache line from all the instruction and data caches within the
7424
  coherency domain of the CPU.
7424
  coherency domain of the CPU.
Lines 7437-7446 AsmInvd ( Link Here
7437
VOID *
7437
VOID *
7438
EFIAPI
7438
EFIAPI
7439
AsmFlushCacheLine (
7439
AsmFlushCacheLine (
7440
  IN      VOID                      *LinearAddress
7440
  IN      VOID  *LinearAddress
7441
  );
7441
  );
7442
7442
7443
7444
/**
7443
/**
7445
  Enables the 32-bit paging mode on the CPU.
7444
  Enables the 32-bit paging mode on the CPU.
7446
7445
Lines 7482-7493 VOID Link Here
7482
EFIAPI
7481
EFIAPI
7483
AsmEnablePaging32 (
7482
AsmEnablePaging32 (
7484
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
7483
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
7485
  IN      VOID                      *Context1,  OPTIONAL
7484
  IN      VOID                      *Context1   OPTIONAL,
7486
  IN      VOID                      *Context2,  OPTIONAL
7485
  IN      VOID                      *Context2   OPTIONAL,
7487
  IN      VOID                      *NewStack
7486
  IN      VOID                      *NewStack
7488
  );
7487
  );
7489
7488
7490
7491
/**
7489
/**
7492
  Disables the 32-bit paging mode on the CPU.
7490
  Disables the 32-bit paging mode on the CPU.
7493
7491
Lines 7526-7537 VOID Link Here
7526
EFIAPI
7524
EFIAPI
7527
AsmDisablePaging32 (
7525
AsmDisablePaging32 (
7528
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
7526
  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
7529
  IN      VOID                      *Context1,  OPTIONAL
7527
  IN      VOID                      *Context1   OPTIONAL,
7530
  IN      VOID                      *Context2,  OPTIONAL
7528
  IN      VOID                      *Context2   OPTIONAL,
7531
  IN      VOID                      *NewStack
7529
  IN      VOID                      *NewStack
7532
  );
7530
  );
7533
7531
7534
7535
/**
7532
/**
7536
  Enables the 64-bit paging mode on the CPU.
7533
  Enables the 64-bit paging mode on the CPU.
7537
7534
Lines 7567-7580 AsmDisablePaging32 ( Link Here
7567
VOID
7564
VOID
7568
EFIAPI
7565
EFIAPI
7569
AsmEnablePaging64 (
7566
AsmEnablePaging64 (
7570
  IN      UINT16                    Cs,
7567
  IN      UINT16  Cs,
7571
  IN      UINT64                    EntryPoint,
7568
  IN      UINT64  EntryPoint,
7572
  IN      UINT64                    Context1,  OPTIONAL
7569
  IN      UINT64  Context1   OPTIONAL,
7573
  IN      UINT64                    Context2,  OPTIONAL
7570
  IN      UINT64  Context2   OPTIONAL,
7574
  IN      UINT64                    NewStack
7571
  IN      UINT64  NewStack
7575
  );
7572
  );
7576
7573
7577
7578
/**
7574
/**
7579
  Disables the 64-bit paging mode on the CPU.
7575
  Disables the 64-bit paging mode on the CPU.
7580
7576
Lines 7608-7621 AsmEnablePaging64 ( Link Here
7608
VOID
7604
VOID
7609
EFIAPI
7605
EFIAPI
7610
AsmDisablePaging64 (
7606
AsmDisablePaging64 (
7611
  IN      UINT16                    Cs,
7607
  IN      UINT16  Cs,
7612
  IN      UINT32                    EntryPoint,
7608
  IN      UINT32  EntryPoint,
7613
  IN      UINT32                    Context1,  OPTIONAL
7609
  IN      UINT32  Context1   OPTIONAL,
7614
  IN      UINT32                    Context2,  OPTIONAL
7610
  IN      UINT32  Context2   OPTIONAL,
7615
  IN      UINT32                    NewStack
7611
  IN      UINT32  NewStack
7616
  );
7612
  );
7617
7613
7618
7619
//
7614
//
7620
// 16-bit thunking services
7615
// 16-bit thunking services
7621
//
7616
//
Lines 7644-7654 AsmDisablePaging64 ( Link Here
7644
VOID
7639
VOID
7645
EFIAPI
7640
EFIAPI
7646
AsmGetThunk16Properties (
7641
AsmGetThunk16Properties (
7647
  OUT     UINT32                    *RealModeBufferSize,
7642
  OUT     UINT32  *RealModeBufferSize,
7648
  OUT     UINT32                    *ExtraStackSize
7643
  OUT     UINT32  *ExtraStackSize
7649
  );
7644
  );
7650
7645
7651
7652
/**
7646
/**
7653
  Prepares all structures a code required to use AsmThunk16().
7647
  Prepares all structures a code required to use AsmThunk16().
7654
7648
Lines 7666-7675 AsmGetThunk16Properties ( Link Here
7666
VOID
7660
VOID
7667
EFIAPI
7661
EFIAPI
7668
AsmPrepareThunk16 (
7662
AsmPrepareThunk16 (
7669
  IN OUT  THUNK_CONTEXT             *ThunkContext
7663
  IN OUT  THUNK_CONTEXT  *ThunkContext
7670
  );
7664
  );
7671
7665
7672
7673
/**
7666
/**
7674
  Transfers control to a 16-bit real mode entry point and returns the results.
7667
  Transfers control to a 16-bit real mode entry point and returns the results.
7675
7668
Lines 7726-7735 AsmPrepareThunk16 ( Link Here
7726
VOID
7719
VOID
7727
EFIAPI
7720
EFIAPI
7728
AsmThunk16 (
7721
AsmThunk16 (
7729
  IN OUT  THUNK_CONTEXT             *ThunkContext
7722
  IN OUT  THUNK_CONTEXT  *ThunkContext
7730
  );
7723
  );
7731
7724
7732
7733
/**
7725
/**
7734
  Prepares all structures and code for a 16-bit real mode thunk, transfers
7726
  Prepares all structures and code for a 16-bit real mode thunk, transfers
7735
  control to a 16-bit real mode entry point, and returns the results.
7727
  control to a 16-bit real mode entry point, and returns the results.
Lines 7753-7759 AsmThunk16 ( Link Here
7753
VOID
7745
VOID
7754
EFIAPI
7746
EFIAPI
7755
AsmPrepareAndThunk16 (
7747
AsmPrepareAndThunk16 (
7756
  IN OUT  THUNK_CONTEXT             *ThunkContext
7748
  IN OUT  THUNK_CONTEXT  *ThunkContext
7757
  );
7749
  );
7758
7750
7759
/**
7751
/**
Lines 7770-7776 AsmPrepareAndThunk16 ( Link Here
7770
BOOLEAN
7762
BOOLEAN
7771
EFIAPI
7763
EFIAPI
7772
AsmRdRand16 (
7764
AsmRdRand16 (
7773
  OUT     UINT16                    *Rand
7765
  OUT     UINT16  *Rand
7774
  );
7766
  );
7775
7767
7776
/**
7768
/**
Lines 7787-7793 AsmRdRand16 ( Link Here
7787
BOOLEAN
7779
BOOLEAN
7788
EFIAPI
7780
EFIAPI
7789
AsmRdRand32 (
7781
AsmRdRand32 (
7790
  OUT     UINT32                    *Rand
7782
  OUT     UINT32  *Rand
7791
  );
7783
  );
7792
7784
7793
/**
7785
/**
Lines 7804-7810 AsmRdRand32 ( Link Here
7804
BOOLEAN
7796
BOOLEAN
7805
EFIAPI
7797
EFIAPI
7806
AsmRdRand64  (
7798
AsmRdRand64  (
7807
  OUT     UINT64                    *Rand
7799
  OUT     UINT64  *Rand
7808
  );
7800
  );
7809
7801
7810
/**
7802
/**
Lines 7815-7821 AsmRdRand64 ( Link Here
7815
VOID
7807
VOID
7816
EFIAPI
7808
EFIAPI
7817
AsmWriteTr (
7809
AsmWriteTr (
7818
  IN UINT16 Selector
7810
  IN UINT16  Selector
7819
  );
7811
  );
7820
7812
7821
/**
7813
/**
Lines 7831-7836 AsmLfence ( Link Here
7831
  VOID
7823
  VOID
7832
  );
7824
  );
7833
7825
7826
/**
7827
  Executes a XGETBV instruction
7828
7829
  Executes a XGETBV instruction. This function is only available on IA-32 and
7830
  x64.
7831
7832
  @param[in] Index        Extended control register index
7833
7834
  @return                 The current value of the extended control register
7835
**/
7836
UINT64
7837
EFIAPI
7838
AsmXGetBv (
7839
  IN UINT32  Index
7840
  );
7841
7842
/**
7843
  Executes a XSETBV instruction to write a 64-bit value to a Extended Control
7844
  Register(XCR), and returns the value.
7845
7846
  Writes the 64-bit value specified by Value to the XCR specified by Index. The
7847
  64-bit value written to the XCR is returned. No parameter checking is
7848
  performed on Index or Value, and some of these may cause CPU exceptions. The
7849
  caller must either guarantee that Index and Value are valid, or the caller
7850
  must establish proper exception handlers. This function is only available on
7851
  IA-32 and x64.
7852
7853
  @param  Index The 32-bit XCR index to write.
7854
  @param  Value The 64-bit value to write to the XCR.
7855
7856
  @return Value
7857
7858
**/
7859
UINT64
7860
EFIAPI
7861
AsmXSetBv (
7862
  IN UINT32  Index,
7863
  IN UINT64  Value
7864
  );
7865
7866
/**
7867
  Executes a VMGEXIT instruction (VMMCALL with a REP prefix)
7868
7869
  Executes a VMGEXIT instruction. This function is only available on IA-32 and
7870
  x64.
7871
7872
**/
7873
VOID
7874
EFIAPI
7875
AsmVmgExit (
7876
  VOID
7877
  );
7878
7834
/**
7879
/**
7835
  Patch the immediate operand of an IA32 or X64 instruction such that the byte,
7880
  Patch the immediate operand of an IA32 or X64 instruction such that the byte,
7836
  word, dword or qword operand is encoded at the end of the instruction's
7881
  word, dword or qword operand is encoded at the end of the instruction's
Lines 7868-7876 AsmLfence ( Link Here
7868
VOID
7913
VOID
7869
EFIAPI
7914
EFIAPI
7870
PatchInstructionX86 (
7915
PatchInstructionX86 (
7871
  OUT X86_ASSEMBLY_PATCH_LABEL *InstructionEnd,
7916
  OUT X86_ASSEMBLY_PATCH_LABEL  *InstructionEnd,
7872
  IN  UINT64                   PatchValue,
7917
  IN  UINT64                    PatchValue,
7873
  IN  UINTN                    ValueSize
7918
  IN  UINTN                     ValueSize
7874
  );
7919
  );
7875
7920
7876
#endif // defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
7921
#endif // defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
(-)b/sys/contrib/edk2/Include/Library/DebugLib.h (-68 / +123 lines)
Lines 29-54 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
29
//
29
//
30
// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
30
// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
31
//
31
//
32
#define DEBUG_INIT      0x00000001  // Initialization
32
#define DEBUG_INIT      0x00000001       // Initialization
33
#define DEBUG_WARN      0x00000002  // Warnings
33
#define DEBUG_WARN      0x00000002       // Warnings
34
#define DEBUG_LOAD      0x00000004  // Load events
34
#define DEBUG_LOAD      0x00000004       // Load events
35
#define DEBUG_FS        0x00000008  // EFI File system
35
#define DEBUG_FS        0x00000008       // EFI File system
36
#define DEBUG_POOL      0x00000010  // Alloc & Free (pool)
36
#define DEBUG_POOL      0x00000010       // Alloc & Free (pool)
37
#define DEBUG_PAGE      0x00000020  // Alloc & Free (page)
37
#define DEBUG_PAGE      0x00000020       // Alloc & Free (page)
38
#define DEBUG_INFO      0x00000040  // Informational debug messages
38
#define DEBUG_INFO      0x00000040       // Informational debug messages
39
#define DEBUG_DISPATCH  0x00000080  // PEI/DXE/SMM Dispatchers
39
#define DEBUG_DISPATCH  0x00000080       // PEI/DXE/SMM Dispatchers
40
#define DEBUG_VARIABLE  0x00000100  // Variable
40
#define DEBUG_VARIABLE  0x00000100       // Variable
41
#define DEBUG_BM        0x00000400  // Boot Manager
41
#define DEBUG_BM        0x00000400       // Boot Manager
42
#define DEBUG_BLKIO     0x00001000  // BlkIo Driver
42
#define DEBUG_BLKIO     0x00001000       // BlkIo Driver
43
#define DEBUG_NET       0x00004000  // Network Io Driver
43
#define DEBUG_NET       0x00004000       // Network Io Driver
44
#define DEBUG_UNDI      0x00010000  // UNDI Driver
44
#define DEBUG_UNDI      0x00010000       // UNDI Driver
45
#define DEBUG_LOADFILE  0x00020000  // LoadFile
45
#define DEBUG_LOADFILE  0x00020000       // LoadFile
46
#define DEBUG_EVENT     0x00080000  // Event messages
46
#define DEBUG_EVENT     0x00080000       // Event messages
47
#define DEBUG_GCD       0x00100000  // Global Coherency Database changes
47
#define DEBUG_GCD       0x00100000       // Global Coherency Database changes
48
#define DEBUG_CACHE     0x00200000  // Memory range cachability changes
48
#define DEBUG_CACHE     0x00200000       // Memory range cachability changes
49
#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may
49
#define DEBUG_VERBOSE   0x00400000       // Detailed debug messages that may
50
                                    // significantly impact boot performance
50
                                         // significantly impact boot performance
51
#define DEBUG_ERROR     0x80000000  // Error
51
#define DEBUG_MANAGEABILITY  0x00800000  // Detailed debug and payload manageability messages
52
                                         // related to modules such as Redfish, IPMI, MCTP etc.
53
#define DEBUG_ERROR  0x80000000          // Error
52
54
53
//
55
//
54
// Aliases of debug message mask bits
56
// Aliases of debug message mask bits
Lines 71-76 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
71
#define EFI_D_VERBOSE   DEBUG_VERBOSE
73
#define EFI_D_VERBOSE   DEBUG_VERBOSE
72
#define EFI_D_ERROR     DEBUG_ERROR
74
#define EFI_D_ERROR     DEBUG_ERROR
73
75
76
//
77
// Source file line number.
78
// Default is use the to compiler provided __LINE__ macro value. The __LINE__
79
// mapping can be overriden by predefining DEBUG_LINE_NUMBER
80
//
81
// Defining DEBUG_LINE_NUMBER to a fixed value is useful when comparing builds
82
// across source code formatting changes that may add/remove lines in a source
83
// file.
84
//
85
#ifdef DEBUG_LINE_NUMBER
86
#else
87
#define DEBUG_LINE_NUMBER  __LINE__
88
#endif
89
90
/**
91
  Macro that converts a Boolean expression to a Null-terminated ASCII string.
92
93
  The default is to use the C pre-processor stringizing operator '#' to add
94
  quotes around the C expression. If DEBUG_EXPRESSION_STRING_VALUE is defined
95
  then the C expression is converted to the fixed string value.
96
97
  Defining DEBUG_EXPRESSION_STRING_VALUE to a fixed value is useful when
98
  comparing builds across source code formatting changes that may make
99
  changes to spaces or parenthesis in a Boolean expression.
100
101
  @param  Expression  Boolean expression.
102
103
**/
104
105
#ifdef DEBUG_EXPRESSION_STRING_VALUE
106
#define DEBUG_EXPRESSION_STRING(Expression)  DEBUG_EXPRESSION_STRING_VALUE
107
#else
108
#define DEBUG_EXPRESSION_STRING(Expression)  #Expression
109
#endif
110
74
/**
111
/**
75
  Prints a debug message to the debug output device if the specified error level is enabled.
112
  Prints a debug message to the debug output device if the specified error level is enabled.
76
113
Lines 94-100 DebugPrint ( Link Here
94
  ...
131
  ...
95
  );
132
  );
96
133
97
98
/**
134
/**
99
  Prints a debug message to the debug output device if the specified
135
  Prints a debug message to the debug output device if the specified
100
  error level is enabled.
136
  error level is enabled.
Lines 113-124 DebugPrint ( Link Here
113
VOID
149
VOID
114
EFIAPI
150
EFIAPI
115
DebugVPrint (
151
DebugVPrint (
116
  IN  UINTN         ErrorLevel,
152
  IN  UINTN        ErrorLevel,
117
  IN  CONST CHAR8   *Format,
153
  IN  CONST CHAR8  *Format,
118
  IN  VA_LIST       VaListMarker
154
  IN  VA_LIST      VaListMarker
119
  );
155
  );
120
156
121
122
/**
157
/**
123
  Prints a debug message to the debug output device if the specified
158
  Prints a debug message to the debug output device if the specified
124
  error level is enabled.
159
  error level is enabled.
Lines 139-150 DebugVPrint ( Link Here
139
VOID
174
VOID
140
EFIAPI
175
EFIAPI
141
DebugBPrint (
176
DebugBPrint (
142
  IN  UINTN         ErrorLevel,
177
  IN  UINTN        ErrorLevel,
143
  IN  CONST CHAR8   *Format,
178
  IN  CONST CHAR8  *Format,
144
  IN  BASE_LIST     BaseListMarker
179
  IN  BASE_LIST    BaseListMarker
145
  );
180
  );
146
181
147
148
/**
182
/**
149
  Prints an assert message containing a filename, line number, and description.
183
  Prints an assert message containing a filename, line number, and description.
150
  This may be followed by a breakpoint or a dead loop.
184
  This may be followed by a breakpoint or a dead loop.
Lines 174-180 DebugAssert ( Link Here
174
  IN CONST CHAR8  *Description
208
  IN CONST CHAR8  *Description
175
  );
209
  );
176
210
177
178
/**
211
/**
179
  Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
212
  Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
180
213
Lines 197-203 DebugClearMemory ( Link Here
197
  IN UINTN  Length
230
  IN UINTN  Length
198
  );
231
  );
199
232
200
201
/**
233
/**
202
  Returns TRUE if ASSERT() macros are enabled.
234
  Returns TRUE if ASSERT() macros are enabled.
203
235
Lines 214-220 DebugAssertEnabled ( Link Here
214
  VOID
246
  VOID
215
  );
247
  );
216
248
217
218
/**
249
/**
219
  Returns TRUE if DEBUG() macros are enabled.
250
  Returns TRUE if DEBUG() macros are enabled.
220
251
Lines 231-237 DebugPrintEnabled ( Link Here
231
  VOID
262
  VOID
232
  );
263
  );
233
264
234
235
/**
265
/**
236
  Returns TRUE if DEBUG_CODE() macros are enabled.
266
  Returns TRUE if DEBUG_CODE() macros are enabled.
237
267
Lines 248-254 DebugCodeEnabled ( Link Here
248
  VOID
278
  VOID
249
  );
279
  );
250
280
251
252
/**
281
/**
253
  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
282
  Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.
254
283
Lines 277-283 DebugClearMemoryEnabled ( Link Here
277
BOOLEAN
306
BOOLEAN
278
EFIAPI
307
EFIAPI
279
DebugPrintLevelEnabled (
308
DebugPrintLevelEnabled (
280
  IN  CONST UINTN        ErrorLevel
309
  IN  CONST UINTN  ErrorLevel
281
  );
310
  );
282
311
283
/**
312
/**
Lines 289-301 DebugPrintLevelEnabled ( Link Here
289
  @param  Expression  Boolean expression that evaluated to FALSE
318
  @param  Expression  Boolean expression that evaluated to FALSE
290
319
291
**/
320
**/
292
#if defined(__clang__) && defined(__FILE_NAME__)
321
#if defined (EDKII_UNIT_TEST_FRAMEWORK_ENABLED)
293
#define _ASSERT(Expression)  DebugAssert (__FILE_NAME__, __LINE__, #Expression)
322
323
/**
324
  Unit test library replacement for DebugAssert() in DebugLib.
325
326
  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
327
  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
328
329
  @param  FileName     The pointer to the name of the source file that generated the assert condition.
330
  @param  LineNumber   The line number in the source file that generated the assert condition
331
  @param  Description  The pointer to the description of the assert condition.
332
333
**/
334
VOID
335
EFIAPI
336
UnitTestDebugAssert (
337
  IN CONST CHAR8  *FileName,
338
  IN UINTN        LineNumber,
339
  IN CONST CHAR8  *Description
340
  );
341
342
  #if defined (_ASSERT)
343
    #undef _ASSERT
344
  #endif
345
  #if defined (__clang__) && defined (__FILE_NAME__)
346
#define _ASSERT(Expression)  UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
347
  #else
348
#define _ASSERT(Expression)  UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
349
  #endif
294
#else
350
#else
295
#define _ASSERT(Expression)  DebugAssert (__FILE__, __LINE__, #Expression)
351
  #if defined (__clang__) && defined (__FILE_NAME__)
352
#define _ASSERT(Expression)  DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
353
  #else
354
#define _ASSERT(Expression)  DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))
355
  #endif
296
#endif
356
#endif
297
357
298
299
/**
358
/**
300
  Internal worker macro that calls DebugPrint().
359
  Internal worker macro that calls DebugPrint().
301
360
Lines 309-324 DebugPrintLevelEnabled ( Link Here
309
368
310
**/
369
**/
311
370
312
#if !defined(MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)
371
#if !defined (MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)
313
  #define _DEBUG_PRINT(PrintLevel, ...)              \
372
#define _DEBUG_PRINT(PrintLevel, ...)              \
314
    do {                                             \
373
    do {                                             \
315
      if (DebugPrintLevelEnabled (PrintLevel)) {     \
374
      if (DebugPrintLevelEnabled (PrintLevel)) {     \
316
        DebugPrint (PrintLevel, ##__VA_ARGS__);      \
375
        DebugPrint (PrintLevel, ##__VA_ARGS__);      \
317
      }                                              \
376
      }                                              \
318
    } while (FALSE)
377
    } while (FALSE)
319
  #define _DEBUG(Expression)   _DEBUG_PRINT Expression
378
#define _DEBUGLIB_DEBUG(Expression)  _DEBUG_PRINT Expression
320
#else
379
#else
321
#define _DEBUG(Expression)   DebugPrint Expression
380
#define _DEBUGLIB_DEBUG(Expression)  DebugPrint Expression
322
#endif
381
#endif
323
382
324
/**
383
/**
Lines 333-340 DebugPrintLevelEnabled ( Link Here
333
  @param  Expression  Boolean expression.
392
  @param  Expression  Boolean expression.
334
393
335
**/
394
**/
336
#if !defined(MDEPKG_NDEBUG)
395
#if !defined (MDEPKG_NDEBUG)
337
  #define ASSERT(Expression)        \
396
#define ASSERT(Expression)        \
338
    do {                            \
397
    do {                            \
339
      if (DebugAssertEnabled ()) {  \
398
      if (DebugAssertEnabled ()) {  \
340
        if (!(Expression)) {        \
399
        if (!(Expression)) {        \
Lines 344-350 DebugPrintLevelEnabled ( Link Here
344
      }                             \
403
      }                             \
345
    } while (FALSE)
404
    } while (FALSE)
346
#else
405
#else
347
  #define ASSERT(Expression)
406
#define ASSERT(Expression)
348
#endif
407
#endif
349
408
350
/**
409
/**
Lines 359-373 DebugPrintLevelEnabled ( Link Here
359
418
360
419
361
**/
420
**/
362
#if !defined(MDEPKG_NDEBUG)
421
#if !defined (MDEPKG_NDEBUG)
363
  #define DEBUG(Expression)        \
422
#define DEBUG(Expression)        \
364
    do {                           \
423
    do {                           \
365
      if (DebugPrintEnabled ()) {  \
424
      if (DebugPrintEnabled ()) {  \
366
        _DEBUG (Expression);       \
425
        _DEBUGLIB_DEBUG (Expression);       \
367
      }                            \
426
      }                            \
368
    } while (FALSE)
427
    } while (FALSE)
369
#else
428
#else
370
  #define DEBUG(Expression)
429
#define DEBUG(Expression)
371
#endif
430
#endif
372
431
373
/**
432
/**
Lines 382-399 DebugPrintLevelEnabled ( Link Here
382
  @param  StatusParameter  EFI_STATUS value to evaluate.
441
  @param  StatusParameter  EFI_STATUS value to evaluate.
383
442
384
**/
443
**/
385
#if !defined(MDEPKG_NDEBUG)
444
#if !defined (MDEPKG_NDEBUG)
386
  #define ASSERT_EFI_ERROR(StatusParameter)                                              \
445
#define ASSERT_EFI_ERROR(StatusParameter)                                              \
387
    do {                                                                                 \
446
    do {                                                                                 \
388
      if (DebugAssertEnabled ()) {                                                       \
447
      if (DebugAssertEnabled ()) {                                                       \
389
        if (EFI_ERROR (StatusParameter)) {                                               \
448
        if (EFI_ERROR (StatusParameter)) {                                               \
390
          DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter));  \
449
          DEBUG ((DEBUG_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter));  \
391
          _ASSERT (!EFI_ERROR (StatusParameter));                                        \
450
          _ASSERT (!EFI_ERROR (StatusParameter));                                        \
392
        }                                                                                \
451
        }                                                                                \
393
      }                                                                                  \
452
      }                                                                                  \
394
    } while (FALSE)
453
    } while (FALSE)
395
#else
454
#else
396
  #define ASSERT_EFI_ERROR(StatusParameter)
455
#define ASSERT_EFI_ERROR(StatusParameter)
397
#endif
456
#endif
398
457
399
/**
458
/**
Lines 408-415 DebugPrintLevelEnabled ( Link Here
408
  @param  StatusParameter  RETURN_STATUS value to evaluate.
467
  @param  StatusParameter  RETURN_STATUS value to evaluate.
409
468
410
**/
469
**/
411
#if !defined(MDEPKG_NDEBUG)
470
#if !defined (MDEPKG_NDEBUG)
412
  #define ASSERT_RETURN_ERROR(StatusParameter)                          \
471
#define ASSERT_RETURN_ERROR(StatusParameter)                          \
413
    do {                                                                \
472
    do {                                                                \
414
      if (DebugAssertEnabled ()) {                                      \
473
      if (DebugAssertEnabled ()) {                                      \
415
        if (RETURN_ERROR (StatusParameter)) {                           \
474
        if (RETURN_ERROR (StatusParameter)) {                           \
Lines 420-426 DebugPrintLevelEnabled ( Link Here
420
      }                                                                 \
479
      }                                                                 \
421
    } while (FALSE)
480
    } while (FALSE)
422
#else
481
#else
423
  #define ASSERT_RETURN_ERROR(StatusParameter)
482
#define ASSERT_RETURN_ERROR(StatusParameter)
424
#endif
483
#endif
425
484
426
/**
485
/**
Lines 445-452 DebugPrintLevelEnabled ( Link Here
445
  @param  Guid    The pointer to a protocol GUID.
504
  @param  Guid    The pointer to a protocol GUID.
446
505
447
**/
506
**/
448
#if !defined(MDEPKG_NDEBUG)
507
#if !defined (MDEPKG_NDEBUG)
449
  #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)                               \
508
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)                               \
450
    do {                                                                                \
509
    do {                                                                                \
451
      if (DebugAssertEnabled ()) {                                                      \
510
      if (DebugAssertEnabled ()) {                                                      \
452
        VOID  *Instance;                                                                \
511
        VOID  *Instance;                                                                \
Lines 463-469 DebugPrintLevelEnabled ( Link Here
463
      }                                                                                 \
522
      }                                                                                 \
464
    } while (FALSE)
523
    } while (FALSE)
465
#else
524
#else
466
  #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
525
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
467
#endif
526
#endif
468
527
469
/**
528
/**
Lines 477-483 DebugPrintLevelEnabled ( Link Here
477
**/
536
**/
478
#define DEBUG_CODE_BEGIN()  do { if (DebugCodeEnabled ()) { UINT8  __DebugCodeLocal
537
#define DEBUG_CODE_BEGIN()  do { if (DebugCodeEnabled ()) { UINT8  __DebugCodeLocal
479
538
480
481
/**
539
/**
482
  The macro that marks the end of debug source code.
540
  The macro that marks the end of debug source code.
483
541
Lines 487-494 DebugPrintLevelEnabled ( Link Here
487
  are not included in a module.
545
  are not included in a module.
488
546
489
**/
547
**/
490
#define DEBUG_CODE_END()    __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)
548
#define DEBUG_CODE_END()  __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)
491
492
549
493
/**
550
/**
494
  The macro that declares a section of debug source code.
551
  The macro that declares a section of debug source code.
Lines 503-509 DebugPrintLevelEnabled ( Link Here
503
  Expression                    \
560
  Expression                    \
504
  DEBUG_CODE_END ()
561
  DEBUG_CODE_END ()
505
562
506
507
/**
563
/**
508
  The macro that calls DebugClearMemory() to clear a buffer to a default value.
564
  The macro that calls DebugClearMemory() to clear a buffer to a default value.
509
565
Lines 521-527 DebugPrintLevelEnabled ( Link Here
521
    }                                        \
577
    }                                        \
522
  } while (FALSE)
578
  } while (FALSE)
523
579
524
525
/**
580
/**
526
  Macro that calls DebugAssert() if the containing record does not have a
581
  Macro that calls DebugAssert() if the containing record does not have a
527
  matching signature.  If the signatures matches, then a pointer to the data
582
  matching signature.  If the signatures matches, then a pointer to the data
Lines 564-576 DebugPrintLevelEnabled ( Link Here
564
  @param  TestSignature  The 32-bit signature value to match.
619
  @param  TestSignature  The 32-bit signature value to match.
565
620
566
**/
621
**/
567
#if !defined(MDEPKG_NDEBUG)
622
#if !defined (MDEPKG_NDEBUG)
568
  #define CR(Record, TYPE, Field, TestSignature)                                              \
623
#define CR(Record, TYPE, Field, TestSignature)                                              \
569
    (DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ?  \
624
    (DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ?  \
570
    (TYPE *) (_ASSERT (CR has Bad Signature), Record) :                                       \
625
    (TYPE *) (_ASSERT (CR has Bad Signature), Record) :                                       \
571
    BASE_CR (Record, TYPE, Field)
626
    BASE_CR (Record, TYPE, Field)
572
#else
627
#else
573
  #define CR(Record, TYPE, Field, TestSignature)                                              \
628
#define CR(Record, TYPE, Field, TestSignature)                                              \
574
    BASE_CR (Record, TYPE, Field)
629
    BASE_CR (Record, TYPE, Field)
575
#endif
630
#endif
576
631
(-)b/sys/contrib/edk2/Include/Library/DevicePathLib.h (-19 / +19 lines)
Lines 12-18 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
12
#ifndef __DEVICE_PATH_LIB_H__
12
#ifndef __DEVICE_PATH_LIB_H__
13
#define __DEVICE_PATH_LIB_H__
13
#define __DEVICE_PATH_LIB_H__
14
14
15
#define END_DEVICE_PATH_LENGTH               (sizeof (EFI_DEVICE_PATH_PROTOCOL))
15
#define END_DEVICE_PATH_LENGTH  (sizeof (EFI_DEVICE_PATH_PROTOCOL))
16
16
17
/**
17
/**
18
  Determine whether a given device path is valid.
18
  Determine whether a given device path is valid.
Lines 33-40 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
33
BOOLEAN
33
BOOLEAN
34
EFIAPI
34
EFIAPI
35
IsDevicePathValid (
35
IsDevicePathValid (
36
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
36
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,
37
  IN       UINTN                    MaxSize
37
  IN       UINTN                     MaxSize
38
  );
38
  );
39
39
40
/**
40
/**
Lines 292-298 DuplicateDevicePath ( Link Here
292
EFI_DEVICE_PATH_PROTOCOL *
292
EFI_DEVICE_PATH_PROTOCOL *
293
EFIAPI
293
EFIAPI
294
AppendDevicePath (
294
AppendDevicePath (
295
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,  OPTIONAL
295
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath   OPTIONAL,
296
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath  OPTIONAL
296
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath  OPTIONAL
297
  );
297
  );
298
298
Lines 324-330 AppendDevicePath ( Link Here
324
EFI_DEVICE_PATH_PROTOCOL *
324
EFI_DEVICE_PATH_PROTOCOL *
325
EFIAPI
325
EFIAPI
326
AppendDevicePathNode (
326
AppendDevicePathNode (
327
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,     OPTIONAL
327
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath      OPTIONAL,
328
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode  OPTIONAL
328
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode  OPTIONAL
329
  );
329
  );
330
330
Lines 352-358 AppendDevicePathNode ( Link Here
352
EFI_DEVICE_PATH_PROTOCOL *
352
EFI_DEVICE_PATH_PROTOCOL *
353
EFIAPI
353
EFIAPI
354
AppendDevicePathInstance (
354
AppendDevicePathInstance (
355
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,        OPTIONAL
355
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath         OPTIONAL,
356
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance OPTIONAL
356
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance OPTIONAL
357
  );
357
  );
358
358
Lines 384-391 AppendDevicePathInstance ( Link Here
384
EFI_DEVICE_PATH_PROTOCOL *
384
EFI_DEVICE_PATH_PROTOCOL *
385
EFIAPI
385
EFIAPI
386
GetNextDevicePathInstance (
386
GetNextDevicePathInstance (
387
  IN OUT EFI_DEVICE_PATH_PROTOCOL    **DevicePath,
387
  IN OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePath,
388
  OUT UINTN                          *Size
388
  OUT UINTN                        *Size
389
  );
389
  );
390
390
391
/**
391
/**
Lines 409-417 GetNextDevicePathInstance ( Link Here
409
EFI_DEVICE_PATH_PROTOCOL *
409
EFI_DEVICE_PATH_PROTOCOL *
410
EFIAPI
410
EFIAPI
411
CreateDeviceNode (
411
CreateDeviceNode (
412
  IN UINT8                           NodeType,
412
  IN UINT8   NodeType,
413
  IN UINT8                           NodeSubType,
413
  IN UINT8   NodeSubType,
414
  IN UINT16                          NodeLength
414
  IN UINT16  NodeLength
415
  );
415
  );
416
416
417
/**
417
/**
Lines 447-453 IsDevicePathMultiInstance ( Link Here
447
EFI_DEVICE_PATH_PROTOCOL *
447
EFI_DEVICE_PATH_PROTOCOL *
448
EFIAPI
448
EFIAPI
449
DevicePathFromHandle (
449
DevicePathFromHandle (
450
  IN EFI_HANDLE                      Handle
450
  IN EFI_HANDLE  Handle
451
  );
451
  );
452
452
453
/**
453
/**
Lines 474-481 DevicePathFromHandle ( Link Here
474
EFI_DEVICE_PATH_PROTOCOL *
474
EFI_DEVICE_PATH_PROTOCOL *
475
EFIAPI
475
EFIAPI
476
FileDevicePath (
476
FileDevicePath (
477
  IN EFI_HANDLE                      Device,     OPTIONAL
477
  IN EFI_HANDLE    Device      OPTIONAL,
478
  IN CONST CHAR16                    *FileName
478
  IN CONST CHAR16  *FileName
479
  );
479
  );
480
480
481
/**
481
/**
Lines 496-504 FileDevicePath ( Link Here
496
CHAR16 *
496
CHAR16 *
497
EFIAPI
497
EFIAPI
498
ConvertDevicePathToText (
498
ConvertDevicePathToText (
499
  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,
499
  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,
500
  IN BOOLEAN                          DisplayOnly,
500
  IN BOOLEAN                         DisplayOnly,
501
  IN BOOLEAN                          AllowShortcuts
501
  IN BOOLEAN                         AllowShortcuts
502
  );
502
  );
503
503
504
/**
504
/**
Lines 538-544 ConvertDeviceNodeToText ( Link Here
538
EFI_DEVICE_PATH_PROTOCOL *
538
EFI_DEVICE_PATH_PROTOCOL *
539
EFIAPI
539
EFIAPI
540
ConvertTextToDeviceNode (
540
ConvertTextToDeviceNode (
541
  IN CONST CHAR16 *TextDeviceNode
541
  IN CONST CHAR16  *TextDeviceNode
542
  );
542
  );
543
543
544
/**
544
/**
Lines 555-561 ConvertTextToDeviceNode ( Link Here
555
EFI_DEVICE_PATH_PROTOCOL *
555
EFI_DEVICE_PATH_PROTOCOL *
556
EFIAPI
556
EFIAPI
557
ConvertTextToDevicePath (
557
ConvertTextToDevicePath (
558
  IN CONST CHAR16 *TextDevicePath
558
  IN CONST CHAR16  *TextDevicePath
559
  );
559
  );
560
560
561
#endif
561
#endif
(-)b/sys/contrib/edk2/Include/Library/MemoryAllocationLib.h (-1 / +1 lines)
Lines 481-487 ReallocateReservedPool ( Link Here
481
VOID
481
VOID
482
EFIAPI
482
EFIAPI
483
FreePool (
483
FreePool (
484
  IN VOID   *Buffer
484
  IN VOID  *Buffer
485
  );
485
  );
486
486
487
#endif
487
#endif
(-)b/sys/contrib/edk2/Include/Library/PcdLib.h (-713 / +135 lines)
Lines 22-28 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
22
#ifndef __PCD_LIB_H__
22
#ifndef __PCD_LIB_H__
23
#define __PCD_LIB_H__
23
#define __PCD_LIB_H__
24
24
25
26
/**
25
/**
27
  Retrieves a token number based on a token name.
26
  Retrieves a token number based on a token name.
28
27
Lines 34-41 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
34
  @return  The token number associated with the PCD.
33
  @return  The token number associated with the PCD.
35
34
36
**/
35
**/
37
#define PcdToken(TokenName)                 _PCD_TOKEN_##TokenName
36
#define PcdToken(TokenName)  _PCD_TOKEN_##TokenName
38
39
37
40
/**
38
/**
41
  Retrieves a Boolean PCD feature flag based on a token name.
39
  Retrieves a Boolean PCD feature flag based on a token name.
Lines 49-56 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
49
  @return  Boolean value for the PCD feature flag.
47
  @return  Boolean value for the PCD feature flag.
50
48
51
**/
49
**/
52
#define FeaturePcdGet(TokenName)            _PCD_GET_MODE_BOOL_##TokenName
50
#define FeaturePcdGet(TokenName)  _PCD_GET_MODE_BOOL_##TokenName
53
54
51
55
/**
52
/**
56
  Retrieves an 8-bit fixed PCD token value based on a token name.
53
  Retrieves an 8-bit fixed PCD token value based on a token name.
Lines 64-71 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
64
  @return  8-bit value for the token specified by TokenName.
61
  @return  8-bit value for the token specified by TokenName.
65
62
66
**/
63
**/
67
#define FixedPcdGet8(TokenName)             _PCD_VALUE_##TokenName
64
#define FixedPcdGet8(TokenName)  _PCD_VALUE_##TokenName
68
69
65
70
/**
66
/**
71
  Retrieves a 16-bit fixed PCD token value based on a token name.
67
  Retrieves a 16-bit fixed PCD token value based on a token name.
Lines 79-86 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
79
  @return  16-bit value for the token specified by TokenName.
75
  @return  16-bit value for the token specified by TokenName.
80
76
81
**/
77
**/
82
#define FixedPcdGet16(TokenName)            _PCD_VALUE_##TokenName
78
#define FixedPcdGet16(TokenName)  _PCD_VALUE_##TokenName
83
84
79
85
/**
80
/**
86
  Retrieves a 32-bit fixed PCD token value based on a token name.
81
  Retrieves a 32-bit fixed PCD token value based on a token name.
Lines 94-101 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
94
  @return  32-bit value for the token specified by TokenName.
89
  @return  32-bit value for the token specified by TokenName.
95
90
96
**/
91
**/
97
#define FixedPcdGet32(TokenName)            _PCD_VALUE_##TokenName
92
#define FixedPcdGet32(TokenName)  _PCD_VALUE_##TokenName
98
99
93
100
/**
94
/**
101
  Retrieves a 64-bit fixed PCD token value based on a token name.
95
  Retrieves a 64-bit fixed PCD token value based on a token name.
Lines 109-116 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
109
  @return  64-bit value for the token specified by TokenName.
103
  @return  64-bit value for the token specified by TokenName.
110
104
111
**/
105
**/
112
#define FixedPcdGet64(TokenName)            _PCD_VALUE_##TokenName
106
#define FixedPcdGet64(TokenName)  _PCD_VALUE_##TokenName
113
114
107
115
/**
108
/**
116
  Retrieves a Boolean fixed PCD token value based on a token name.
109
  Retrieves a Boolean fixed PCD token value based on a token name.
Lines 124-131 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
124
  @return  The Boolean value for the token.
117
  @return  The Boolean value for the token.
125
118
126
**/
119
**/
127
#define FixedPcdGetBool(TokenName)          _PCD_VALUE_##TokenName
120
#define FixedPcdGetBool(TokenName)  _PCD_VALUE_##TokenName
128
129
121
130
/**
122
/**
131
  Retrieves a pointer to a fixed PCD token buffer based on a token name.
123
  Retrieves a pointer to a fixed PCD token buffer based on a token name.
Lines 139-146 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
139
  @return  A pointer to the buffer.
131
  @return  A pointer to the buffer.
140
132
141
**/
133
**/
142
#define FixedPcdGetPtr(TokenName)           ((VOID *)_PCD_VALUE_##TokenName)
134
#define FixedPcdGetPtr(TokenName)  ((VOID *)_PCD_VALUE_##TokenName)
143
144
135
145
/**
136
/**
146
  Retrieves an 8-bit binary patchable PCD token value based on a token name.
137
  Retrieves an 8-bit binary patchable PCD token value based on a token name.
Lines 154-160 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
154
  @return  An 8-bit binary patchable PCD token value.
145
  @return  An 8-bit binary patchable PCD token value.
155
146
156
**/
147
**/
157
#define PatchPcdGet8(TokenName)             _gPcd_BinaryPatch_##TokenName
148
#define PatchPcdGet8(TokenName)  _gPcd_BinaryPatch_##TokenName
158
149
159
/**
150
/**
160
  Retrieves a 16-bit binary patchable PCD token value based on a token name.
151
  Retrieves a 16-bit binary patchable PCD token value based on a token name.
Lines 168-175 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
168
  @return  A 16-bit binary patchable PCD token value.
159
  @return  A 16-bit binary patchable PCD token value.
169
160
170
**/
161
**/
171
#define PatchPcdGet16(TokenName)            _gPcd_BinaryPatch_##TokenName
162
#define PatchPcdGet16(TokenName)  _gPcd_BinaryPatch_##TokenName
172
173
163
174
/**
164
/**
175
  Retrieves a 32-bit binary patchable PCD token value based on a token name.
165
  Retrieves a 32-bit binary patchable PCD token value based on a token name.
Lines 183-190 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
183
  @return  A 32-bit binary patchable PCD token value.
173
  @return  A 32-bit binary patchable PCD token value.
184
174
185
**/
175
**/
186
#define PatchPcdGet32(TokenName)            _gPcd_BinaryPatch_##TokenName
176
#define PatchPcdGet32(TokenName)  _gPcd_BinaryPatch_##TokenName
187
188
177
189
/**
178
/**
190
  Retrieves a 64-bit binary patchable PCD token value based on a token name.
179
  Retrieves a 64-bit binary patchable PCD token value based on a token name.
Lines 198-205 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
198
  @return  A 64-bit binary patchable PCD token value.
187
  @return  A 64-bit binary patchable PCD token value.
199
188
200
**/
189
**/
201
#define PatchPcdGet64(TokenName)            _gPcd_BinaryPatch_##TokenName
190
#define PatchPcdGet64(TokenName)  _gPcd_BinaryPatch_##TokenName
202
203
191
204
/**
192
/**
205
  Retrieves a Boolean binary patchable PCD token value based on a token name.
193
  Retrieves a Boolean binary patchable PCD token value based on a token name.
Lines 213-220 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
213
  @return  The Boolean value for the token.
201
  @return  The Boolean value for the token.
214
202
215
**/
203
**/
216
#define PatchPcdGetBool(TokenName)          _gPcd_BinaryPatch_##TokenName
204
#define PatchPcdGetBool(TokenName)  _gPcd_BinaryPatch_##TokenName
217
218
205
219
/**
206
/**
220
  Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
207
  Retrieves a pointer to a binary patchable PCD token buffer based on a token name.
Lines 228-235 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
228
  @return  A pointer to the buffer for the token.
215
  @return  A pointer to the buffer for the token.
229
216
230
**/
217
**/
231
#define PatchPcdGetPtr(TokenName)           ((VOID *)_gPcd_BinaryPatch_##TokenName)
218
#define PatchPcdGetPtr(TokenName)  ((VOID *)_gPcd_BinaryPatch_##TokenName)
232
233
219
234
/**
220
/**
235
  Sets an 8-bit binary patchable PCD token value based on a token name.
221
  Sets an 8-bit binary patchable PCD token value based on a token name.
Lines 244-251 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
244
  @return Return the Value that was set.
230
  @return Return the Value that was set.
245
231
246
**/
232
**/
247
#define PatchPcdSet8(TokenName, Value)      (_gPcd_BinaryPatch_##TokenName = (Value))
233
#define PatchPcdSet8(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = (Value))
248
249
234
250
/**
235
/**
251
  Sets a 16-bit binary patchable PCD token value based on a token name.
236
  Sets a 16-bit binary patchable PCD token value based on a token name.
Lines 260-267 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
260
  @return Return the Value that was set.
245
  @return Return the Value that was set.
261
246
262
**/
247
**/
263
#define PatchPcdSet16(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
248
#define PatchPcdSet16(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = (Value))
264
265
249
266
/**
250
/**
267
  Sets a 32-bit binary patchable PCD token value based on a token name.
251
  Sets a 32-bit binary patchable PCD token value based on a token name.
Lines 276-283 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
276
  @return Return the Value that was set.
260
  @return Return the Value that was set.
277
261
278
**/
262
**/
279
#define PatchPcdSet32(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
263
#define PatchPcdSet32(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = (Value))
280
281
264
282
/**
265
/**
283
  Sets a 64-bit binary patchable PCD token value based on a token name.
266
  Sets a 64-bit binary patchable PCD token value based on a token name.
Lines 292-299 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
292
  @return Return the Value that was set.
275
  @return Return the Value that was set.
293
276
294
**/
277
**/
295
#define PatchPcdSet64(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = (Value))
278
#define PatchPcdSet64(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = (Value))
296
297
279
298
/**
280
/**
299
  Sets a Boolean binary patchable PCD token value based on a token name.
281
  Sets a Boolean binary patchable PCD token value based on a token name.
Lines 308-315 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
308
  @return Return the Value that was set.
290
  @return Return the Value that was set.
309
291
310
**/
292
**/
311
#define PatchPcdSetBool(TokenName, Value)   (_gPcd_BinaryPatch_##TokenName = (Value))
293
#define PatchPcdSetBool(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = (Value))
312
313
294
314
/**
295
/**
315
  Sets a pointer to a binary patchable PCD token buffer based on a token name.
296
  Sets a pointer to a binary patchable PCD token buffer based on a token name.
Lines 340-345 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
340
                                              (Size),                                  \
321
                                              (Size),                                  \
341
                                              (Buffer)                                 \
322
                                              (Buffer)                                 \
342
                                              )
323
                                              )
324
343
/**
325
/**
344
  Retrieves an 8-bit PCD token value based on a token name.
326
  Retrieves an 8-bit PCD token value based on a token name.
345
327
Lines 351-358 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
351
  @return  8-bit value for the token specified by TokenName.
333
  @return  8-bit value for the token specified by TokenName.
352
334
353
**/
335
**/
354
#define PcdGet8(TokenName)                  _PCD_GET_MODE_8_##TokenName
336
#define PcdGet8(TokenName)  _PCD_GET_MODE_8_##TokenName
355
356
337
357
/**
338
/**
358
  Retrieves a 16-bit PCD token value based on a token name.
339
  Retrieves a 16-bit PCD token value based on a token name.
Lines 365-372 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
365
  @return  16-bit value for the token specified by TokenName.
346
  @return  16-bit value for the token specified by TokenName.
366
347
367
**/
348
**/
368
#define PcdGet16(TokenName)                 _PCD_GET_MODE_16_##TokenName
349
#define PcdGet16(TokenName)  _PCD_GET_MODE_16_##TokenName
369
370
350
371
/**
351
/**
372
  Retrieves a 32-bit PCD token value based on a token name.
352
  Retrieves a 32-bit PCD token value based on a token name.
Lines 379-386 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
379
  @return  32-bit value for the token specified by TokenName.
359
  @return  32-bit value for the token specified by TokenName.
380
360
381
**/
361
**/
382
#define PcdGet32(TokenName)                 _PCD_GET_MODE_32_##TokenName
362
#define PcdGet32(TokenName)  _PCD_GET_MODE_32_##TokenName
383
384
363
385
/**
364
/**
386
  Retrieves a 64-bit PCD token value based on a token name.
365
  Retrieves a 64-bit PCD token value based on a token name.
Lines 393-400 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
393
  @return  64-bit value for the token specified by TokenName.
372
  @return  64-bit value for the token specified by TokenName.
394
373
395
**/
374
**/
396
#define PcdGet64(TokenName)                 _PCD_GET_MODE_64_##TokenName
375
#define PcdGet64(TokenName)  _PCD_GET_MODE_64_##TokenName
397
398
376
399
/**
377
/**
400
  Retrieves a pointer to a PCD token buffer based on a token name.
378
  Retrieves a pointer to a PCD token buffer based on a token name.
Lines 407-414 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
407
  @return  A pointer to the buffer.
385
  @return  A pointer to the buffer.
408
386
409
**/
387
**/
410
#define PcdGetPtr(TokenName)                _PCD_GET_MODE_PTR_##TokenName
388
#define PcdGetPtr(TokenName)  _PCD_GET_MODE_PTR_##TokenName
411
412
389
413
/**
390
/**
414
  Retrieves a Boolean PCD token value based on a token name.
391
  Retrieves a Boolean PCD token value based on a token name.
Lines 421-428 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
421
  @return  A Boolean PCD token value.
398
  @return  A Boolean PCD token value.
422
399
423
**/
400
**/
424
#define PcdGetBool(TokenName)               _PCD_GET_MODE_BOOL_##TokenName
401
#define PcdGetBool(TokenName)  _PCD_GET_MODE_BOOL_##TokenName
425
426
402
427
/**
403
/**
428
  Retrieves the size of a fixed PCD token based on a token name.
404
  Retrieves the size of a fixed PCD token based on a token name.
Lines 435-442 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
435
  @return     Return the size
411
  @return     Return the size
436
412
437
**/
413
**/
438
#define FixedPcdGetSize(TokenName)    _PCD_SIZE_##TokenName
414
#define FixedPcdGetSize(TokenName)  _PCD_SIZE_##TokenName
439
440
415
441
/**
416
/**
442
  Retrieves the size of a binary patchable PCD token based on a token name.
417
  Retrieves the size of a binary patchable PCD token based on a token name.
Lines 449-456 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
449
  @return     Return the size
424
  @return     Return the size
450
425
451
**/
426
**/
452
#define PatchPcdGetSize(TokenName)    _gPcd_BinaryPatch_Size_##TokenName
427
#define PatchPcdGetSize(TokenName)  _gPcd_BinaryPatch_Size_##TokenName
453
454
428
455
/**
429
/**
456
  Retrieves the size of the PCD token based on a token name.
430
  Retrieves the size of the PCD token based on a token name.
Lines 463-470 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
463
  @return      Return the size
437
  @return      Return the size
464
438
465
**/
439
**/
466
#define PcdGetSize(TokenName)         _PCD_GET_MODE_SIZE_##TokenName
440
#define PcdGetSize(TokenName)  _PCD_GET_MODE_SIZE_##TokenName
467
468
441
469
/**
442
/**
470
  Retrieve the size of a given PCD token.
443
  Retrieve the size of a given PCD token.
Lines 479-585 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
479
  @return     Return the size.
452
  @return     Return the size.
480
453
481
**/
454
**/
482
#define PcdGetExSize(Guid, TokenName) LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))
455
#define PcdGetExSize(Guid, TokenName)  LibPcdGetExSize ((Guid), PcdTokenEx(Guid,TokenName))
483
484
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
485
/**
486
  Sets an 8-bit PCD token value based on a token name.
487
488
  Sets the 8-bit value for the token specified by TokenName. Value is returned.
489
  If TokenName is not a valid token in the token space, then the module will not build.
490
491
  @param   TokenName  The name of the PCD token to retrieve a current value for.
492
  @param   Value      The 8-bit value to set.
493
494
  @return Return the Value that was set.
495
496
**/
497
#define PcdSet8(TokenName, Value)           _PCD_SET_MODE_8_##TokenName     ((Value))
498
499
500
/**
501
  Sets a 16-bit PCD token value based on a token name.
502
503
  Sets the 16-bit value for the token specified by TokenName. Value is returned.
504
  If TokenName is not a valid token in the token space, then the module will not build.
505
506
  @param   TokenName  The name of the PCD token to retrieve a current value for.
507
  @param   Value      The 16-bit value to set.
508
509
  @return Return the Value that was set.
510
511
**/
512
#define PcdSet16(TokenName, Value)          _PCD_SET_MODE_16_##TokenName    ((Value))
513
514
515
/**
516
  Sets a 32-bit PCD token value based on a token name.
517
518
  Sets the 32-bit value for the token specified by TokenName. Value is returned.
519
  If TokenName is not a valid token in the token space, then the module will not build.
520
521
  @param   TokenName  The name of the PCD token to retrieve a current value for.
522
  @param   Value      The 32-bit value to set.
523
524
  @return Return the Value that was set.
525
526
**/
527
#define PcdSet32(TokenName, Value)          _PCD_SET_MODE_32_##TokenName    ((Value))
528
529
530
/**
531
  Sets a 64-bit PCD token value based on a token name.
532
533
  Sets the 64-bit value for the token specified by TokenName. Value is returned.
534
  If TokenName is not a valid token in the token space, then the module will not build.
535
536
  @param   TokenName  The name of the PCD token to retrieve a current value for.
537
  @param   Value      The 64-bit value to set.
538
539
  @return Return the Value that was set.
540
541
**/
542
#define PcdSet64(TokenName, Value)          _PCD_SET_MODE_64_##TokenName    ((Value))
543
544
545
/**
546
  Sets a pointer to a PCD token buffer based on a token name.
547
548
  Sets the buffer for the token specified by TokenName. Buffer is returned.
549
  If SizeOfBuffer is greater than the maximum size supported by TokenName,
550
  then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
551
  to indicate that the set operation was not actually performed.  If SizeOfBuffer
552
  is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
553
  by TokenName and NULL must be returned.
554
  If TokenName is not a valid token in the token space, then the module will not build.
555
556
  If SizeOfBuffer is NULL, then ASSERT().
557
  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
558
559
  @param   TokenName      The name of the PCD token to set the current value for.
560
  @param   SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
561
  @param   Buffer         A pointer to the buffer to set.
562
563
  @return Return the pointer to the Buffer that was set.
564
565
**/
566
#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer) \
567
                                            _PCD_SET_MODE_PTR_##TokenName   ((SizeOfBuffer), (Buffer))
568
569
/**
570
  Sets a Boolean PCD token value based on a token name.
571
572
  Sets the Boolean value for the token specified by TokenName. Value is returned.
573
  If TokenName is not a valid token in the token space, then the module will not build.
574
575
  @param   TokenName      The name of the PCD token to set the current value for.
576
  @param   Buffer         The Boolean value to set.
577
578
  @return Return the Value that was set.
579
580
**/
581
#define PcdSetBool(TokenName, Value)        _PCD_SET_MODE_BOOL_##TokenName  ((Value))
582
#endif
583
456
584
/**
457
/**
585
  Sets a 8-bit PCD token value based on a token name.
458
  Sets a 8-bit PCD token value based on a token name.
Lines 593-599 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
593
  @return The status of the set operation.
466
  @return The status of the set operation.
594
467
595
**/
468
**/
596
#define PcdSet8S(TokenName, Value)          _PCD_SET_MODE_8_S_##TokenName    ((Value))
469
#define PcdSet8S(TokenName, Value)  _PCD_SET_MODE_8_S_##TokenName    ((Value))
597
470
598
/**
471
/**
599
  Sets a 16-bit PCD token value based on a token name.
472
  Sets a 16-bit PCD token value based on a token name.
Lines 607-613 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
607
  @return The status of the set operation.
480
  @return The status of the set operation.
608
481
609
**/
482
**/
610
#define PcdSet16S(TokenName, Value)         _PCD_SET_MODE_16_S_##TokenName    ((Value))
483
#define PcdSet16S(TokenName, Value)  _PCD_SET_MODE_16_S_##TokenName    ((Value))
611
484
612
/**
485
/**
613
  Sets a 32-bit PCD token value based on a token name.
486
  Sets a 32-bit PCD token value based on a token name.
Lines 621-627 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
621
  @return The status of the set operation.
494
  @return The status of the set operation.
622
495
623
**/
496
**/
624
#define PcdSet32S(TokenName, Value)         _PCD_SET_MODE_32_S_##TokenName    ((Value))
497
#define PcdSet32S(TokenName, Value)  _PCD_SET_MODE_32_S_##TokenName    ((Value))
625
498
626
/**
499
/**
627
  Sets a 64-bit PCD token value based on a token name.
500
  Sets a 64-bit PCD token value based on a token name.
Lines 635-641 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
635
  @return The status of the set operation.
508
  @return The status of the set operation.
636
509
637
**/
510
**/
638
#define PcdSet64S(TokenName, Value)         _PCD_SET_MODE_64_S_##TokenName    ((Value))
511
#define PcdSet64S(TokenName, Value)  _PCD_SET_MODE_64_S_##TokenName    ((Value))
639
512
640
/**
513
/**
641
  Sets a pointer to a PCD token buffer based on a token name.
514
  Sets a pointer to a PCD token buffer based on a token name.
Lines 661-668 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
661
#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \
534
#define PcdSetPtrS(TokenName, SizeOfBuffer, Buffer) \
662
                                            _PCD_SET_MODE_PTR_S_##TokenName   ((SizeOfBuffer), (Buffer))
535
                                            _PCD_SET_MODE_PTR_S_##TokenName   ((SizeOfBuffer), (Buffer))
663
536
664
665
666
/**
537
/**
667
  Sets a boolean PCD token value based on a token name.
538
  Sets a boolean PCD token value based on a token name.
668
539
Lines 675-681 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
675
  @return The status of the set operation.
546
  @return The status of the set operation.
676
547
677
**/
548
**/
678
#define PcdSetBoolS(TokenName, Value)       _PCD_SET_MODE_BOOL_S_##TokenName    ((Value))
549
#define PcdSetBoolS(TokenName, Value)  _PCD_SET_MODE_BOOL_S_##TokenName    ((Value))
679
550
680
/**
551
/**
681
  Retrieves a token number based on a GUID and a token name.
552
  Retrieves a token number based on a GUID and a token name.
Lines 690-696 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
690
  @return  Return the token number.
561
  @return  Return the token number.
691
562
692
**/
563
**/
693
#define PcdTokenEx(Guid,TokenName)  _PCD_TOKEN_EX_##TokenName(Guid)
564
#define PcdTokenEx(Guid, TokenName)  _PCD_TOKEN_EX_##TokenName(Guid)
694
565
695
/**
566
/**
696
  Retrieves an 8-bit PCD token value based on a GUID and a token name.
567
  Retrieves an 8-bit PCD token value based on a GUID and a token name.
Lines 708-714 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
708
  @return  An 8-bit PCD token value.
579
  @return  An 8-bit PCD token value.
709
580
710
**/
581
**/
711
#define PcdGetEx8(Guid, TokenName)          LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
582
#define PcdGetEx8(Guid, TokenName)  LibPcdGetEx8 ((Guid), PcdTokenEx(Guid,TokenName))
712
583
713
/**
584
/**
714
  Retrieves a 16-bit PCD token value based on a GUID and a token name.
585
  Retrieves a 16-bit PCD token value based on a GUID and a token name.
Lines 726-733 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
726
  @return  A 16-bit PCD token value.
597
  @return  A 16-bit PCD token value.
727
598
728
**/
599
**/
729
#define PcdGetEx16(Guid, TokenName)         LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
600
#define PcdGetEx16(Guid, TokenName)  LibPcdGetEx16 ((Guid), PcdTokenEx(Guid,TokenName))
730
731
601
732
/**
602
/**
733
  Retrieves a 32-bit PCD token value based on a GUID and a token name.
603
  Retrieves a 32-bit PCD token value based on a GUID and a token name.
Lines 745-752 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
745
  @return  A 32-bit PCD token value.
615
  @return  A 32-bit PCD token value.
746
616
747
**/
617
**/
748
#define PcdGetEx32(Guid, TokenName)         LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
618
#define PcdGetEx32(Guid, TokenName)  LibPcdGetEx32 ((Guid), PcdTokenEx(Guid,TokenName))
749
750
619
751
/**
620
/**
752
  Retrieves a 64-bit PCD token value based on a GUID and a token name.
621
  Retrieves a 64-bit PCD token value based on a GUID and a token name.
Lines 764-771 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
764
  @return  A 64-bit PCD token value.
633
  @return  A 64-bit PCD token value.
765
634
766
**/
635
**/
767
#define PcdGetEx64(Guid, TokenName)         LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
636
#define PcdGetEx64(Guid, TokenName)  LibPcdGetEx64 ((Guid), PcdTokenEx(Guid,TokenName))
768
769
637
770
/**
638
/**
771
  Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
639
  Retrieves a pointer to a PCD token buffer based on a GUID and a token name.
Lines 783-790 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
783
  @return  A pointer to a PCD token buffer.
651
  @return  A pointer to a PCD token buffer.
784
652
785
**/
653
**/
786
#define PcdGetExPtr(Guid, TokenName)        LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
654
#define PcdGetExPtr(Guid, TokenName)  LibPcdGetExPtr ((Guid), PcdTokenEx(Guid,TokenName))
787
788
655
789
/**
656
/**
790
  Retrieves a Boolean PCD token value based on a GUID and a token name.
657
  Retrieves a Boolean PCD token value based on a GUID and a token name.
Lines 802-941 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
802
  @return  A Boolean PCD token value.
669
  @return  A Boolean PCD token value.
803
670
804
**/
671
**/
805
#define PcdGetExBool(Guid, TokenName)       LibPcdGetExBool  ((Guid), PcdTokenEx(Guid,TokenName))
672
#define PcdGetExBool(Guid, TokenName)  LibPcdGetExBool  ((Guid), PcdTokenEx(Guid,TokenName))
806
807
808
809
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
810
/**
811
  Sets an 8-bit PCD token value based on a GUID and a token name.
812
813
  Sets the 8-bit value for the token specified by Guid and TokenName. Value is returned.
814
  If TokenName is not a valid token in the token space specified by Guid,
815
  then the module will not build.
816
817
  If Guid is NULL, then ASSERT().
818
819
  @param   Guid        Pointer to a 128-bit unique value that designates
820
                       which namespace to retrieve a value from.
821
  @param   TokenName   The name of the PCD token to set the current value for.
822
  @param   Value       The 8-bit value to set.
823
824
  @return Return the Value that was set.
825
826
**/
827
#define PcdSetEx8(Guid, TokenName, Value)   LibPcdSetEx8   ((Guid), PcdTokenEx(Guid,TokenName), (Value))
828
829
830
/**
831
  Sets a 16-bit PCD token value based on a GUID and a token name.
832
833
  Sets the 16-bit value for the token specified by Guid and TokenName. Value is returned.
834
  If TokenName is not a valid token in the token space specified by Guid,
835
  then the module will not build.
836
837
  If Guid is NULL, then ASSERT().
838
839
  @param   Guid        Pointer to a 128-bit unique value that designates
840
                       which namespace to retrieve a value from.
841
  @param   TokenName   The name of the PCD token to set the current value for.
842
  @param   Value       The 16-bit value to set.
843
844
  @return Return the Value that was set.
845
846
**/
847
#define PcdSetEx16(Guid, TokenName, Value)  LibPcdSetEx16  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
848
849
850
/**
851
  Sets a 32-bit PCD token value based on a GUID and a token name.
852
853
  Sets the 32-bit value for the token specified by Guid and TokenName. Value is returned.
854
  If TokenName is not a valid token in the token space specified by Guid,
855
  then the module will not build.
856
857
  If Guid is NULL, then ASSERT().
858
859
  @param   Guid        Pointer to a 128-bit unique value that designates
860
                       which namespace to retrieve a value from.
861
  @param   TokenName   The name of the PCD token to set the current value for.
862
  @param   Value       The 32-bit value to set.
863
864
  @return Return the Value that was set.
865
866
**/
867
#define PcdSetEx32(Guid, TokenName, Value)  LibPcdSetEx32  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
868
869
870
/**
871
  Sets a 64-bit PCD token value based on a GUID and a token name.
872
873
  Sets the 64-bit value for the token specified by Guid and TokenName. Value is returned.
874
  If TokenName is not a valid token in the token space specified by Guid,
875
  then the module will not build.
876
877
  If Guid is NULL, then ASSERT().
878
879
  @param   Guid        Pointer to a 128-bit unique value that designates
880
  which namespace to retrieve a value from.
881
  @param   TokenName   The name of the PCD token to set the current value for.
882
  @param   Value       The 64-bit value to set.
883
884
  @return Return the Value that was set.
885
886
**/
887
#define PcdSetEx64(Guid, TokenName, Value)  LibPcdSetEx64  ((Guid), PcdTokenEx(Guid,TokenName), (Value))
888
889
890
/**
891
  Sets a pointer to a PCD token buffer based on a GUID and a token name.
892
893
  Sets the buffer for the token specified by Guid and TokenName. Buffer is returned.
894
  If SizeOfBuffer is greater than the maximum size supported by Guid and TokenName,
895
  then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
896
  NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
897
  is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
898
  Guid and TokenName and NULL must be returned.
899
  If TokenName is not a valid token in the token space specified by Guid,
900
  then the module will not build.
901
902
  If Guid is NULL, then ASSERT().
903
  If SizeOfBuffer is NULL, then ASSERT().
904
  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
905
906
  @param   Guid           Pointer to a 128-bit unique value that designates
907
                          which namespace to retrieve a value from.
908
  @param   TokenName      The name of the PCD token to set the current value for.
909
  @param   SizeOfBuffer   A pointer to the size, in bytes, of Buffer.
910
  @param   Buffer         Pointer to the buffer to set.
911
912
  @return Return the pointer to the Buffer that was set.
913
914
**/
915
#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer) \
916
                                            LibPcdSetExPtr ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
917
918
919
/**
920
  Sets a Boolean PCD token value based on a GUID and a token name.
921
922
  Sets the Boolean value for the token specified by Guid and TokenName. Value is returned.
923
  If TokenName is not a valid token in the token space specified by Guid,
924
  then the module will not build.
925
926
  If Guid is NULL, then ASSERT().
927
928
  @param   Guid           Pointer to a 128-bit unique value that designates
929
                          which namespace to retrieve a value from.
930
  @param   TokenName      The name of the PCD token to set the current value for.
931
  @param   Value          The Boolean value to set.
932
933
  @return Return the Value that was set.
934
935
**/
936
#define PcdSetExBool(Guid, TokenName, Value) \
937
                                            LibPcdSetExBool((Guid), PcdTokenEx(Guid,TokenName), (Value))
938
#endif
939
673
940
/**
674
/**
941
  Sets an 8-bit PCD token value based on a GUID and a token name.
675
  Sets an 8-bit PCD token value based on a GUID and a token name.
Lines 954-960 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
954
  @return The status of the set operation.
688
  @return The status of the set operation.
955
689
956
**/
690
**/
957
#define PcdSetEx8S(Guid, TokenName, Value)     LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
691
#define PcdSetEx8S(Guid, TokenName, Value)  LibPcdSetEx8S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
958
692
959
/**
693
/**
960
  Sets an 16-bit PCD token value based on a GUID and a token name.
694
  Sets an 16-bit PCD token value based on a GUID and a token name.
Lines 973-979 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
973
  @return The status of the set operation.
707
  @return The status of the set operation.
974
708
975
**/
709
**/
976
#define PcdSetEx16S(Guid, TokenName, Value)    LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
710
#define PcdSetEx16S(Guid, TokenName, Value)  LibPcdSetEx16S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
977
711
978
/**
712
/**
979
  Sets an 32-bit PCD token value based on a GUID and a token name.
713
  Sets an 32-bit PCD token value based on a GUID and a token name.
Lines 992-998 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
992
  @return The status of the set operation.
726
  @return The status of the set operation.
993
727
994
**/
728
**/
995
#define PcdSetEx32S(Guid, TokenName, Value)    LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
729
#define PcdSetEx32S(Guid, TokenName, Value)  LibPcdSetEx32S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
996
730
997
/**
731
/**
998
  Sets an 64-bit PCD token value based on a GUID and a token name.
732
  Sets an 64-bit PCD token value based on a GUID and a token name.
Lines 1011-1017 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
1011
  @return The status of the set operation.
745
  @return The status of the set operation.
1012
746
1013
**/
747
**/
1014
#define PcdSetEx64S(Guid, TokenName, Value)    LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
748
#define PcdSetEx64S(Guid, TokenName, Value)  LibPcdSetEx64S ((Guid), PcdTokenEx(Guid,TokenName), (Value))
1015
749
1016
/**
750
/**
1017
  Sets a pointer to a PCD token buffer based on a GUID and a token name.
751
  Sets a pointer to a PCD token buffer based on a GUID and a token name.
Lines 1041-1047 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
1041
#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \
775
#define PcdSetExPtrS(Guid, TokenName, SizeOfBuffer, Buffer) \
1042
                                            LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
776
                                            LibPcdSetExPtrS ((Guid), PcdTokenEx(Guid,TokenName), (SizeOfBuffer), (Buffer))
1043
777
1044
1045
/**
778
/**
1046
  Sets an boolean PCD token value based on a GUID and a token name.
779
  Sets an boolean PCD token value based on a GUID and a token name.
1047
780
Lines 1076-1085 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
1076
UINTN
809
UINTN
1077
EFIAPI
810
EFIAPI
1078
LibPcdSetSku (
811
LibPcdSetSku (
1079
  IN UINTN   SkuId
812
  IN UINTN  SkuId
1080
  );
813
  );
1081
814
1082
1083
/**
815
/**
1084
  This function provides a means by which to retrieve a value for a given PCD token.
816
  This function provides a means by which to retrieve a value for a given PCD token.
1085
817
Lines 1093-1102 LibPcdSetSku ( Link Here
1093
UINT8
825
UINT8
1094
EFIAPI
826
EFIAPI
1095
LibPcdGet8 (
827
LibPcdGet8 (
1096
  IN UINTN             TokenNumber
828
  IN UINTN  TokenNumber
1097
  );
829
  );
1098
830
1099
1100
/**
831
/**
1101
  This function provides a means by which to retrieve a value for a given PCD token.
832
  This function provides a means by which to retrieve a value for a given PCD token.
1102
833
Lines 1110-1119 LibPcdGet8 ( Link Here
1110
UINT16
841
UINT16
1111
EFIAPI
842
EFIAPI
1112
LibPcdGet16 (
843
LibPcdGet16 (
1113
  IN UINTN             TokenNumber
844
  IN UINTN  TokenNumber
1114
  );
845
  );
1115
846
1116
1117
/**
847
/**
1118
  This function provides a means by which to retrieve a value for a given PCD token.
848
  This function provides a means by which to retrieve a value for a given PCD token.
1119
849
Lines 1127-1136 LibPcdGet16 ( Link Here
1127
UINT32
857
UINT32
1128
EFIAPI
858
EFIAPI
1129
LibPcdGet32 (
859
LibPcdGet32 (
1130
  IN UINTN             TokenNumber
860
  IN UINTN  TokenNumber
1131
  );
861
  );
1132
862
1133
1134
/**
863
/**
1135
  This function provides a means by which to retrieve a value for a given PCD token.
864
  This function provides a means by which to retrieve a value for a given PCD token.
1136
865
Lines 1144-1153 LibPcdGet32 ( Link Here
1144
UINT64
873
UINT64
1145
EFIAPI
874
EFIAPI
1146
LibPcdGet64 (
875
LibPcdGet64 (
1147
  IN UINTN             TokenNumber
876
  IN UINTN  TokenNumber
1148
  );
877
  );
1149
878
1150
1151
/**
879
/**
1152
  This function provides a means by which to retrieve a value for a given PCD token.
880
  This function provides a means by which to retrieve a value for a given PCD token.
1153
881
Lines 1161-1170 LibPcdGet64 ( Link Here
1161
VOID *
889
VOID *
1162
EFIAPI
890
EFIAPI
1163
LibPcdGetPtr (
891
LibPcdGetPtr (
1164
  IN UINTN             TokenNumber
892
  IN UINTN  TokenNumber
1165
  );
893
  );
1166
894
1167
1168
/**
895
/**
1169
  This function provides a means by which to retrieve a value for a given PCD token.
896
  This function provides a means by which to retrieve a value for a given PCD token.
1170
897
Lines 1178-1187 LibPcdGetPtr ( Link Here
1178
BOOLEAN
905
BOOLEAN
1179
EFIAPI
906
EFIAPI
1180
LibPcdGetBool (
907
LibPcdGetBool (
1181
  IN UINTN             TokenNumber
908
  IN UINTN  TokenNumber
1182
  );
909
  );
1183
910
1184
1185
/**
911
/**
1186
  This function provides a means by which to retrieve the size of a given PCD token.
912
  This function provides a means by which to retrieve the size of a given PCD token.
1187
913
Lines 1193-1202 LibPcdGetBool ( Link Here
1193
UINTN
919
UINTN
1194
EFIAPI
920
EFIAPI
1195
LibPcdGetSize (
921
LibPcdGetSize (
1196
  IN UINTN             TokenNumber
922
  IN UINTN  TokenNumber
1197
  );
923
  );
1198
924
1199
1200
/**
925
/**
1201
  This function provides a means by which to retrieve a value for a given PCD token.
926
  This function provides a means by which to retrieve a value for a given PCD token.
1202
927
Lines 1214-1224 LibPcdGetSize ( Link Here
1214
UINT8
939
UINT8
1215
EFIAPI
940
EFIAPI
1216
LibPcdGetEx8 (
941
LibPcdGetEx8 (
1217
  IN CONST GUID        *Guid,
942
  IN CONST GUID  *Guid,
1218
  IN UINTN             TokenNumber
943
  IN UINTN       TokenNumber
1219
  );
944
  );
1220
945
1221
1222
/**
946
/**
1223
  This function provides a means by which to retrieve a value for a given PCD token.
947
  This function provides a means by which to retrieve a value for a given PCD token.
1224
948
Lines 1236-1246 LibPcdGetEx8 ( Link Here
1236
UINT16
960
UINT16
1237
EFIAPI
961
EFIAPI
1238
LibPcdGetEx16 (
962
LibPcdGetEx16 (
1239
  IN CONST GUID        *Guid,
963
  IN CONST GUID  *Guid,
1240
  IN UINTN             TokenNumber
964
  IN UINTN       TokenNumber
1241
  );
965
  );
1242
966
1243
1244
/**
967
/**
1245
  Returns the 32-bit value for the token specified by TokenNumber and Guid.
968
  Returns the 32-bit value for the token specified by TokenNumber and Guid.
1246
  If Guid is NULL, then ASSERT().
969
  If Guid is NULL, then ASSERT().
Lines 1255-1265 LibPcdGetEx16 ( Link Here
1255
UINT32
978
UINT32
1256
EFIAPI
979
EFIAPI
1257
LibPcdGetEx32 (
980
LibPcdGetEx32 (
1258
  IN CONST GUID        *Guid,
981
  IN CONST GUID  *Guid,
1259
  IN UINTN             TokenNumber
982
  IN UINTN       TokenNumber
1260
  );
983
  );
1261
984
1262
1263
/**
985
/**
1264
  This function provides a means by which to retrieve a value for a given PCD token.
986
  This function provides a means by which to retrieve a value for a given PCD token.
1265
987
Lines 1277-1287 LibPcdGetEx32 ( Link Here
1277
UINT64
999
UINT64
1278
EFIAPI
1000
EFIAPI
1279
LibPcdGetEx64 (
1001
LibPcdGetEx64 (
1280
  IN CONST GUID        *Guid,
1002
  IN CONST GUID  *Guid,
1281
  IN UINTN             TokenNumber
1003
  IN UINTN       TokenNumber
1282
  );
1004
  );
1283
1005
1284
1285
/**
1006
/**
1286
  This function provides a means by which to retrieve a value for a given PCD token.
1007
  This function provides a means by which to retrieve a value for a given PCD token.
1287
1008
Lines 1299-1309 LibPcdGetEx64 ( Link Here
1299
VOID *
1020
VOID *
1300
EFIAPI
1021
EFIAPI
1301
LibPcdGetExPtr (
1022
LibPcdGetExPtr (
1302
  IN CONST GUID        *Guid,
1023
  IN CONST GUID  *Guid,
1303
  IN UINTN             TokenNumber
1024
  IN UINTN       TokenNumber
1304
  );
1025
  );
1305
1026
1306
1307
/**
1027
/**
1308
  This function provides a means by which to retrieve a value for a given PCD token.
1028
  This function provides a means by which to retrieve a value for a given PCD token.
1309
1029
Lines 1321-1331 LibPcdGetExPtr ( Link Here
1321
BOOLEAN
1041
BOOLEAN
1322
EFIAPI
1042
EFIAPI
1323
LibPcdGetExBool (
1043
LibPcdGetExBool (
1324
  IN CONST GUID        *Guid,
1044
  IN CONST GUID  *Guid,
1325
  IN UINTN             TokenNumber
1045
  IN UINTN       TokenNumber
1326
  );
1046
  );
1327
1047
1328
1329
/**
1048
/**
1330
  This function provides a means by which to retrieve the size of a given PCD token.
1049
  This function provides a means by which to retrieve the size of a given PCD token.
1331
1050
Lines 1343-1642 LibPcdGetExBool ( Link Here
1343
UINTN
1062
UINTN
1344
EFIAPI
1063
EFIAPI
1345
LibPcdGetExSize (
1064
LibPcdGetExSize (
1346
  IN CONST GUID        *Guid,
1065
  IN CONST GUID  *Guid,
1347
  IN UINTN             TokenNumber
1066
  IN UINTN       TokenNumber
1348
  );
1067
  );
1349
1068
1350
1351
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
1352
/**
1353
  This function provides a means by which to set a value for a given PCD token.
1354
1355
  Sets the 8-bit value for the token specified by TokenNumber
1356
  to the value specified by Value.  Value is returned.
1357
1358
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1359
  @param[in]  Value         The 8-bit value to set.
1360
1361
  @return Return the Value that was set.
1362
1363
**/
1364
UINT8
1365
EFIAPI
1366
LibPcdSet8 (
1367
  IN UINTN             TokenNumber,
1368
  IN UINT8             Value
1369
  );
1370
1371
1372
/**
1373
  This function provides a means by which to set a value for a given PCD token.
1374
1375
  Sets the 16-bit value for the token specified by TokenNumber
1376
  to the value specified by Value.  Value is returned.
1377
1378
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1379
  @param[in]  Value         The 16-bit value to set.
1380
1381
  @return Return the Value that was set.
1382
1383
**/
1384
UINT16
1385
EFIAPI
1386
LibPcdSet16 (
1387
  IN UINTN             TokenNumber,
1388
  IN UINT16            Value
1389
  );
1390
1391
1392
/**
1393
  This function provides a means by which to set a value for a given PCD token.
1394
1395
  Sets the 32-bit value for the token specified by TokenNumber
1396
  to the value specified by Value.  Value is returned.
1397
1398
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1399
  @param[in]  Value         The 32-bit value to set.
1400
1401
  @return Return the Value that was set.
1402
1403
**/
1404
UINT32
1405
EFIAPI
1406
LibPcdSet32 (
1407
  IN UINTN             TokenNumber,
1408
  IN UINT32            Value
1409
  );
1410
1411
1412
/**
1413
  This function provides a means by which to set a value for a given PCD token.
1414
1415
  Sets the 64-bit value for the token specified by TokenNumber
1416
  to the value specified by Value.  Value is returned.
1417
1418
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1419
  @param[in]  Value         The 64-bit value to set.
1420
1421
  @return Return the Value that was set.
1422
1423
**/
1424
UINT64
1425
EFIAPI
1426
LibPcdSet64 (
1427
  IN UINTN             TokenNumber,
1428
  IN UINT64            Value
1429
  );
1430
1431
1432
/**
1433
  This function provides a means by which to set a value for a given PCD token.
1434
1435
  Sets a buffer for the token specified by TokenNumber to the value
1436
  specified by Buffer and SizeOfBuffer.  Buffer is returned.
1437
  If SizeOfBuffer is greater than the maximum size support by TokenNumber,
1438
  then set SizeOfBuffer to the maximum size supported by TokenNumber and
1439
  return NULL to indicate that the set operation was not actually performed.
1440
1441
  If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
1442
  maximum size supported by TokenName and NULL must be returned.
1443
1444
  If SizeOfBuffer is NULL, then ASSERT().
1445
  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1446
1447
  @param[in]      TokenNumber   The PCD token number to set a current value for.
1448
  @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1449
  @param[in]      Buffer        A pointer to the buffer to set.
1450
1451
  @return Return the pointer for the Buffer that was set.
1452
1453
**/
1454
VOID *
1455
EFIAPI
1456
LibPcdSetPtr (
1457
  IN        UINTN             TokenNumber,
1458
  IN OUT    UINTN             *SizeOfBuffer,
1459
  IN CONST  VOID              *Buffer
1460
  );
1461
1462
1463
/**
1464
  This function provides a means by which to set a value for a given PCD token.
1465
1466
  Sets the Boolean value for the token specified by TokenNumber
1467
  to the value specified by Value.  Value is returned.
1468
1469
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1470
  @param[in]  Value         The boolean value to set.
1471
1472
  @return Return the Value that was set.
1473
1474
**/
1475
BOOLEAN
1476
EFIAPI
1477
LibPcdSetBool (
1478
  IN UINTN             TokenNumber,
1479
  IN BOOLEAN           Value
1480
  );
1481
1482
1483
/**
1484
  This function provides a means by which to set a value for a given PCD token.
1485
1486
  Sets the 8-bit value for the token specified by TokenNumber and
1487
  Guid to the value specified by Value. Value is returned.
1488
1489
  If Guid is NULL, then ASSERT().
1490
1491
  @param[in]  Guid          Pointer to a 128-bit unique value that
1492
                            designates which namespace to set a value from.
1493
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1494
  @param[in]  Value         The 8-bit value to set.
1495
1496
  @return Return the Value that was set.
1497
1498
**/
1499
UINT8
1500
EFIAPI
1501
LibPcdSetEx8 (
1502
  IN CONST GUID        *Guid,
1503
  IN UINTN             TokenNumber,
1504
  IN UINT8             Value
1505
  );
1506
1507
1508
/**
1509
  This function provides a means by which to set a value for a given PCD token.
1510
1511
  Sets the 16-bit value for the token specified by TokenNumber and
1512
  Guid to the value specified by Value. Value is returned.
1513
1514
  If Guid is NULL, then ASSERT().
1515
1516
  @param[in]  Guid          Pointer to a 128-bit unique value that
1517
                            designates which namespace to set a value from.
1518
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1519
  @param[in]  Value         The 16-bit value to set.
1520
1521
  @return Return the Value that was set.
1522
1523
**/
1524
UINT16
1525
EFIAPI
1526
LibPcdSetEx16 (
1527
  IN CONST GUID        *Guid,
1528
  IN UINTN             TokenNumber,
1529
  IN UINT16            Value
1530
  );
1531
1532
1533
/**
1534
  This function provides a means by which to set a value for a given PCD token.
1535
1536
  Sets the 32-bit value for the token specified by TokenNumber and
1537
  Guid to the value specified by Value. Value is returned.
1538
1539
  If Guid is NULL, then ASSERT().
1540
1541
  @param[in]  Guid          Pointer to a 128-bit unique value that
1542
                            designates which namespace to set a value from.
1543
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1544
  @param[in]  Value         The 32-bit value to set.
1545
1546
  @return Return the Value that was set.
1547
1548
**/
1549
UINT32
1550
EFIAPI
1551
LibPcdSetEx32 (
1552
  IN CONST GUID        *Guid,
1553
  IN UINTN             TokenNumber,
1554
  IN UINT32            Value
1555
  );
1556
1557
1558
/**
1559
  This function provides a means by which to set a value for a given PCD token.
1560
1561
  Sets the 64-bit value for the token specified by TokenNumber and
1562
  Guid to the value specified by Value. Value is returned.
1563
1564
  If Guid is NULL, then ASSERT().
1565
1566
  @param[in]  Guid          Pointer to a 128-bit unique value that
1567
                            designates which namespace to set a value from.
1568
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1569
  @param[in]  Value         The 64-bit value to set.
1570
1571
  @return Return the Value that was set.
1572
1573
**/
1574
UINT64
1575
EFIAPI
1576
LibPcdSetEx64 (
1577
  IN CONST GUID        *Guid,
1578
  IN UINTN             TokenNumber,
1579
  IN UINT64            Value
1580
  );
1581
1582
1583
/**
1584
  This function provides a means by which to set a value for a given PCD token.
1585
1586
  Sets a buffer for the token specified by TokenNumber to the value specified by
1587
  Buffer and SizeOfBuffer.  Buffer is returned.  If SizeOfBuffer is greater than
1588
  the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
1589
  supported by TokenNumber and return NULL to indicate that the set operation
1590
  was not actually performed.
1591
1592
  If Guid is NULL, then ASSERT().
1593
  If SizeOfBuffer is NULL, then ASSERT().
1594
  If SizeOfBuffer > 0 and Buffer is NULL, then ASSERT().
1595
1596
  @param[in]  Guid              Pointer to a 128-bit unique value that
1597
                                designates which namespace to set a value from.
1598
  @param[in]  TokenNumber       The PCD token number to set a current value for.
1599
  @param[in, out] SizeOfBuffer  The size, in bytes, of Buffer.
1600
  @param[in]  Buffer            A pointer to the buffer to set.
1601
1602
  @return Return the pointer to the Buffer that was set.
1603
1604
**/
1605
VOID *
1606
EFIAPI
1607
LibPcdSetExPtr (
1608
  IN      CONST GUID        *Guid,
1609
  IN      UINTN             TokenNumber,
1610
  IN OUT  UINTN             *SizeOfBuffer,
1611
  IN      VOID              *Buffer
1612
  );
1613
1614
1615
/**
1616
  This function provides a means by which to set a value for a given PCD token.
1617
1618
  Sets the Boolean value for the token specified by TokenNumber and
1619
  Guid to the value specified by Value. Value is returned.
1620
1621
  If Guid is NULL, then ASSERT().
1622
1623
  @param[in]  Guid          Pointer to a 128-bit unique value that
1624
                            designates which namespace to set a value from.
1625
  @param[in]  TokenNumber   The PCD token number to set a current value for.
1626
  @param[in]  Value         The Boolean value to set.
1627
1628
  @return Return the Value that was set.
1629
1630
**/
1631
BOOLEAN
1632
EFIAPI
1633
LibPcdSetExBool (
1634
  IN CONST GUID        *Guid,
1635
  IN UINTN             TokenNumber,
1636
  IN BOOLEAN           Value
1637
  );
1638
#endif
1639
1640
/**
1069
/**
1641
  This function provides a means by which to set a value for a given PCD token.
1070
  This function provides a means by which to set a value for a given PCD token.
1642
1071
Lines 1652-1659 LibPcdSetExBool ( Link Here
1652
RETURN_STATUS
1081
RETURN_STATUS
1653
EFIAPI
1082
EFIAPI
1654
LibPcdSet8S (
1083
LibPcdSet8S (
1655
  IN UINTN          TokenNumber,
1084
  IN UINTN  TokenNumber,
1656
  IN UINT8          Value
1085
  IN UINT8  Value
1657
  );
1086
  );
1658
1087
1659
/**
1088
/**
Lines 1671-1678 LibPcdSet8S ( Link Here
1671
RETURN_STATUS
1100
RETURN_STATUS
1672
EFIAPI
1101
EFIAPI
1673
LibPcdSet16S (
1102
LibPcdSet16S (
1674
  IN UINTN          TokenNumber,
1103
  IN UINTN   TokenNumber,
1675
  IN UINT16         Value
1104
  IN UINT16  Value
1676
  );
1105
  );
1677
1106
1678
/**
1107
/**
Lines 1690-1697 LibPcdSet16S ( Link Here
1690
RETURN_STATUS
1119
RETURN_STATUS
1691
EFIAPI
1120
EFIAPI
1692
LibPcdSet32S (
1121
LibPcdSet32S (
1693
  IN UINTN          TokenNumber,
1122
  IN UINTN   TokenNumber,
1694
  IN UINT32         Value
1123
  IN UINT32  Value
1695
  );
1124
  );
1696
1125
1697
/**
1126
/**
Lines 1709-1716 LibPcdSet32S ( Link Here
1709
RETURN_STATUS
1138
RETURN_STATUS
1710
EFIAPI
1139
EFIAPI
1711
LibPcdSet64S (
1140
LibPcdSet64S (
1712
  IN UINTN          TokenNumber,
1141
  IN UINTN   TokenNumber,
1713
  IN UINT64         Value
1142
  IN UINT64  Value
1714
  );
1143
  );
1715
1144
1716
/**
1145
/**
Lines 1738-1746 LibPcdSet64S ( Link Here
1738
RETURN_STATUS
1167
RETURN_STATUS
1739
EFIAPI
1168
EFIAPI
1740
LibPcdSetPtrS (
1169
LibPcdSetPtrS (
1741
  IN       UINTN    TokenNumber,
1170
  IN       UINTN  TokenNumber,
1742
  IN OUT   UINTN    *SizeOfBuffer,
1171
  IN OUT   UINTN  *SizeOfBuffer,
1743
  IN CONST VOID     *Buffer
1172
  IN CONST VOID   *Buffer
1744
  );
1173
  );
1745
1174
1746
/**
1175
/**
Lines 1758-1765 LibPcdSetPtrS ( Link Here
1758
RETURN_STATUS
1187
RETURN_STATUS
1759
EFIAPI
1188
EFIAPI
1760
LibPcdSetBoolS (
1189
LibPcdSetBoolS (
1761
  IN UINTN          TokenNumber,
1190
  IN UINTN    TokenNumber,
1762
  IN BOOLEAN        Value
1191
  IN BOOLEAN  Value
1763
  );
1192
  );
1764
1193
1765
/**
1194
/**
Lines 1781-1789 LibPcdSetBoolS ( Link Here
1781
RETURN_STATUS
1210
RETURN_STATUS
1782
EFIAPI
1211
EFIAPI
1783
LibPcdSetEx8S (
1212
LibPcdSetEx8S (
1784
  IN CONST GUID     *Guid,
1213
  IN CONST GUID  *Guid,
1785
  IN UINTN          TokenNumber,
1214
  IN UINTN       TokenNumber,
1786
  IN UINT8          Value
1215
  IN UINT8       Value
1787
  );
1216
  );
1788
1217
1789
/**
1218
/**
Lines 1805-1813 LibPcdSetEx8S ( Link Here
1805
RETURN_STATUS
1234
RETURN_STATUS
1806
EFIAPI
1235
EFIAPI
1807
LibPcdSetEx16S (
1236
LibPcdSetEx16S (
1808
  IN CONST GUID     *Guid,
1237
  IN CONST GUID  *Guid,
1809
  IN UINTN          TokenNumber,
1238
  IN UINTN       TokenNumber,
1810
  IN UINT16         Value
1239
  IN UINT16      Value
1811
  );
1240
  );
1812
1241
1813
/**
1242
/**
Lines 1829-1837 LibPcdSetEx16S ( Link Here
1829
RETURN_STATUS
1258
RETURN_STATUS
1830
EFIAPI
1259
EFIAPI
1831
LibPcdSetEx32S (
1260
LibPcdSetEx32S (
1832
  IN CONST GUID     *Guid,
1261
  IN CONST GUID  *Guid,
1833
  IN UINTN          TokenNumber,
1262
  IN UINTN       TokenNumber,
1834
  IN UINT32         Value
1263
  IN UINT32      Value
1835
  );
1264
  );
1836
1265
1837
/**
1266
/**
Lines 1853-1861 LibPcdSetEx32S ( Link Here
1853
RETURN_STATUS
1282
RETURN_STATUS
1854
EFIAPI
1283
EFIAPI
1855
LibPcdSetEx64S (
1284
LibPcdSetEx64S (
1856
  IN CONST GUID     *Guid,
1285
  IN CONST GUID  *Guid,
1857
  IN UINTN          TokenNumber,
1286
  IN UINTN       TokenNumber,
1858
  IN UINT64         Value
1287
  IN UINT64      Value
1859
  );
1288
  );
1860
1289
1861
/**
1290
/**
Lines 1883-1892 LibPcdSetEx64S ( Link Here
1883
RETURN_STATUS
1312
RETURN_STATUS
1884
EFIAPI
1313
EFIAPI
1885
LibPcdSetExPtrS (
1314
LibPcdSetExPtrS (
1886
  IN CONST GUID     *Guid,
1315
  IN CONST GUID   *Guid,
1887
  IN       UINTN    TokenNumber,
1316
  IN       UINTN  TokenNumber,
1888
  IN OUT   UINTN    *SizeOfBuffer,
1317
  IN OUT   UINTN  *SizeOfBuffer,
1889
  IN       VOID     *Buffer
1318
  IN       VOID   *Buffer
1890
  );
1319
  );
1891
1320
1892
/**
1321
/**
Lines 1908-1916 LibPcdSetExPtrS ( Link Here
1908
RETURN_STATUS
1337
RETURN_STATUS
1909
EFIAPI
1338
EFIAPI
1910
LibPcdSetExBoolS (
1339
LibPcdSetExBoolS (
1911
  IN CONST GUID     *Guid,
1340
  IN CONST GUID  *Guid,
1912
  IN UINTN          TokenNumber,
1341
  IN UINTN       TokenNumber,
1913
  IN BOOLEAN        Value
1342
  IN BOOLEAN     Value
1914
  );
1343
  );
1915
1344
1916
/**
1345
/**
Lines 1932-1944 LibPcdSetExBoolS ( Link Here
1932
typedef
1361
typedef
1933
VOID
1362
VOID
1934
(EFIAPI *PCD_CALLBACK)(
1363
(EFIAPI *PCD_CALLBACK)(
1935
  IN        CONST GUID        *CallBackGuid, OPTIONAL
1364
  IN        CONST GUID        *CallBackGuid  OPTIONAL,
1936
  IN        UINTN             CallBackToken,
1365
  IN        UINTN             CallBackToken,
1937
  IN  OUT   VOID              *TokenData,
1366
  IN  OUT   VOID              *TokenData,
1938
  IN        UINTN             TokenDataSize
1367
  IN        UINTN             TokenDataSize
1939
  );
1368
  );
1940
1369
1941
1942
/**
1370
/**
1943
  Set up a notification function that is called when a specified token is set.
1371
  Set up a notification function that is called when a specified token is set.
1944
1372
Lines 1958-1969 VOID Link Here
1958
VOID
1386
VOID
1959
EFIAPI
1387
EFIAPI
1960
LibPcdCallbackOnSet (
1388
LibPcdCallbackOnSet (
1961
  IN CONST GUID               *Guid,       OPTIONAL
1389
  IN CONST GUID    *Guid        OPTIONAL,
1962
  IN UINTN                    TokenNumber,
1390
  IN UINTN         TokenNumber,
1963
  IN PCD_CALLBACK             NotificationFunction
1391
  IN PCD_CALLBACK  NotificationFunction
1964
  );
1392
  );
1965
1393
1966
1967
/**
1394
/**
1968
  Disable a notification function that was established with LibPcdCallbackonSet().
1395
  Disable a notification function that was established with LibPcdCallbackonSet().
1969
1396
Lines 1980-1991 LibPcdCallbackOnSet ( Link Here
1980
VOID
1407
VOID
1981
EFIAPI
1408
EFIAPI
1982
LibPcdCancelCallback (
1409
LibPcdCancelCallback (
1983
  IN CONST GUID               *Guid,       OPTIONAL
1410
  IN CONST GUID    *Guid        OPTIONAL,
1984
  IN UINTN                    TokenNumber,
1411
  IN UINTN         TokenNumber,
1985
  IN PCD_CALLBACK             NotificationFunction
1412
  IN PCD_CALLBACK  NotificationFunction
1986
  );
1413
  );
1987
1414
1988
1989
/**
1415
/**
1990
  Retrieves the next token in a token space.
1416
  Retrieves the next token in a token space.
1991
1417
Lines 2008-2019 LibPcdCancelCallback ( Link Here
2008
UINTN
1434
UINTN
2009
EFIAPI
1435
EFIAPI
2010
LibPcdGetNextToken (
1436
LibPcdGetNextToken (
2011
  IN CONST GUID               *Guid,       OPTIONAL
1437
  IN CONST GUID  *Guid        OPTIONAL,
2012
  IN UINTN                    TokenNumber
1438
  IN UINTN       TokenNumber
2013
  );
1439
  );
2014
1440
2015
2016
2017
/**
1441
/**
2018
  Used to retrieve the list of available PCD token space GUIDs.
1442
  Used to retrieve the list of available PCD token space GUIDs.
2019
1443
Lines 2033-2039 LibPcdGetNextTokenSpace ( Link Here
2033
  IN CONST GUID  *TokenSpaceGuid
1457
  IN CONST GUID  *TokenSpaceGuid
2034
  );
1458
  );
2035
1459
2036
2037
/**
1460
/**
2038
  Sets a value of a patchable PCD entry that is type pointer.
1461
  Sets a value of a patchable PCD entry that is type pointer.
2039
1462
Lines 2060-2069 LibPcdGetNextTokenSpace ( Link Here
2060
VOID *
1483
VOID *
2061
EFIAPI
1484
EFIAPI
2062
LibPatchPcdSetPtr (
1485
LibPatchPcdSetPtr (
2063
  OUT        VOID       *PatchVariable,
1486
  OUT        VOID  *PatchVariable,
2064
  IN        UINTN       MaximumDatumSize,
1487
  IN        UINTN  MaximumDatumSize,
2065
  IN OUT    UINTN       *SizeOfBuffer,
1488
  IN OUT    UINTN  *SizeOfBuffer,
2066
  IN CONST  VOID        *Buffer
1489
  IN CONST  VOID   *Buffer
2067
  );
1490
  );
2068
1491
2069
/**
1492
/**
Lines 2092-2101 LibPatchPcdSetPtr ( Link Here
2092
RETURN_STATUS
1515
RETURN_STATUS
2093
EFIAPI
1516
EFIAPI
2094
LibPatchPcdSetPtrS (
1517
LibPatchPcdSetPtrS (
2095
  OUT      VOID     *PatchVariable,
1518
  OUT      VOID   *PatchVariable,
2096
  IN       UINTN    MaximumDatumSize,
1519
  IN       UINTN  MaximumDatumSize,
2097
  IN OUT   UINTN    *SizeOfBuffer,
1520
  IN OUT   UINTN  *SizeOfBuffer,
2098
  IN CONST VOID     *Buffer
1521
  IN CONST VOID   *Buffer
2099
  );
1522
  );
2100
1523
2101
/**
1524
/**
Lines 2126-2136 LibPatchPcdSetPtrS ( Link Here
2126
VOID *
1549
VOID *
2127
EFIAPI
1550
EFIAPI
2128
LibPatchPcdSetPtrAndSize (
1551
LibPatchPcdSetPtrAndSize (
2129
  OUT       VOID        *PatchVariable,
1552
  OUT       VOID   *PatchVariable,
2130
  OUT       UINTN       *SizeOfPatchVariable,
1553
  OUT       UINTN  *SizeOfPatchVariable,
2131
  IN        UINTN       MaximumDatumSize,
1554
  IN        UINTN  MaximumDatumSize,
2132
  IN OUT    UINTN       *SizeOfBuffer,
1555
  IN OUT    UINTN  *SizeOfBuffer,
2133
  IN CONST  VOID        *Buffer
1556
  IN CONST  VOID   *Buffer
2134
  );
1557
  );
2135
1558
2136
/**
1559
/**
Lines 2161-2171 LibPatchPcdSetPtrAndSize ( Link Here
2161
RETURN_STATUS
1584
RETURN_STATUS
2162
EFIAPI
1585
EFIAPI
2163
LibPatchPcdSetPtrAndSizeS (
1586
LibPatchPcdSetPtrAndSizeS (
2164
  OUT      VOID     *PatchVariable,
1587
  OUT      VOID   *PatchVariable,
2165
  OUT      UINTN    *SizeOfPatchVariable,
1588
  OUT      UINTN  *SizeOfPatchVariable,
2166
  IN       UINTN    MaximumDatumSize,
1589
  IN       UINTN  MaximumDatumSize,
2167
  IN OUT   UINTN    *SizeOfBuffer,
1590
  IN OUT   UINTN  *SizeOfBuffer,
2168
  IN CONST VOID     *Buffer
1591
  IN CONST VOID   *Buffer
2169
  );
1592
  );
2170
1593
2171
typedef enum {
1594
typedef enum {
Lines 2182-2203 typedef struct { Link Here
2182
  /// The returned information associated with the requested TokenNumber. If
1605
  /// The returned information associated with the requested TokenNumber. If
2183
  /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
1606
  /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
2184
  ///
1607
  ///
2185
  PCD_TYPE          PcdType;
1608
  PCD_TYPE    PcdType;
2186
  ///
1609
  ///
2187
  /// The size of the data in bytes associated with the TokenNumber specified. If
1610
  /// The size of the data in bytes associated with the TokenNumber specified. If
2188
  /// TokenNumber is 0, then PcdSize is set 0.
1611
  /// TokenNumber is 0, then PcdSize is set 0.
2189
  ///
1612
  ///
2190
  UINTN             PcdSize;
1613
  UINTN       PcdSize;
2191
  ///
1614
  ///
2192
  /// The null-terminated ASCII string associated with a given token. If the
1615
  /// The null-terminated ASCII string associated with a given token. If the
2193
  /// TokenNumber specified was 0, then this field corresponds to the null-terminated
1616
  /// TokenNumber specified was 0, then this field corresponds to the null-terminated
2194
  /// ASCII string associated with the token's namespace Guid. If NULL, there is no
1617
  /// ASCII string associated with the token's namespace Guid. If NULL, there is no
2195
  /// name associated with this request.
1618
  /// name associated with this request.
2196
  ///
1619
  ///
2197
  CHAR8             *PcdName;
1620
  CHAR8       *PcdName;
2198
} PCD_INFO;
1621
} PCD_INFO;
2199
1622
2200
2201
/**
1623
/**
2202
  Retrieve additional information associated with a PCD token.
1624
  Retrieve additional information associated with a PCD token.
2203
1625
Lines 2213-2220 typedef struct { Link Here
2213
VOID
1635
VOID
2214
EFIAPI
1636
EFIAPI
2215
LibPcdGetInfo (
1637
LibPcdGetInfo (
2216
  IN        UINTN           TokenNumber,
1638
  IN        UINTN     TokenNumber,
2217
  OUT       PCD_INFO        *PcdInfo
1639
  OUT       PCD_INFO  *PcdInfo
2218
  );
1640
  );
2219
1641
2220
/**
1642
/**
Lines 2233-2241 LibPcdGetInfo ( Link Here
2233
VOID
1655
VOID
2234
EFIAPI
1656
EFIAPI
2235
LibPcdGetInfoEx (
1657
LibPcdGetInfoEx (
2236
  IN CONST  GUID            *Guid,
1658
  IN CONST  GUID      *Guid,
2237
  IN        UINTN           TokenNumber,
1659
  IN        UINTN     TokenNumber,
2238
  OUT       PCD_INFO        *PcdInfo
1660
  OUT       PCD_INFO  *PcdInfo
2239
  );
1661
  );
2240
1662
2241
/**
1663
/**
(-)b/sys/contrib/edk2/Include/Library/PrintLib.h (-131 / +20 lines)
Lines 192-201 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
192
/// Flags bitmask values use in UnicodeValueToString() and
192
/// Flags bitmask values use in UnicodeValueToString() and
193
/// AsciiValueToString()
193
/// AsciiValueToString()
194
///
194
///
195
#define LEFT_JUSTIFY      0x01
195
#define LEFT_JUSTIFY  0x01
196
#define COMMA_TYPE        0x08
196
#define COMMA_TYPE    0x08
197
#define PREFIX_ZERO       0x20
197
#define PREFIX_ZERO   0x20
198
#define RADIX_HEX         0x80
198
#define RADIX_HEX     0x80
199
199
200
/**
200
/**
201
  Produces a Null-terminated Unicode string in an output buffer based on
201
  Produces a Null-terminated Unicode string in an output buffer based on
Lines 485-546 UnicodeSPrintAsciiFormat ( Link Here
485
  ...
485
  ...
486
  );
486
  );
487
487
488
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
489
490
/**
491
  [ATTENTION] This function is deprecated for security reason.
492
493
  Converts a decimal value to a Null-terminated Unicode string.
494
495
  Converts the decimal number specified by Value to a Null-terminated Unicode
496
  string specified by Buffer containing at most Width characters. No padding of spaces
497
  is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
498
  The number of Unicode characters in Buffer is returned, not including the Null-terminator.
499
  If the conversion contains more than Width characters, then only the first
500
  Width characters are returned, and the total number of characters
501
  required to perform the conversion is returned.
502
  Additional conversion parameters are specified in Flags.
503
504
  The Flags bit LEFT_JUSTIFY is always ignored.
505
  All conversions are left justified in Buffer.
506
  If Width is 0, PREFIX_ZERO is ignored in Flags.
507
  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
508
  are inserted every 3rd digit starting from the right.
509
  If RADIX_HEX is set in Flags, then the output buffer will be
510
  formatted in hexadecimal format.
511
  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
512
  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
513
  then Buffer is padded with '0' characters so the combination of the optional '-'
514
  sign character, '0' characters, digit characters for Value, and the Null-terminator
515
  add up to Width characters.
516
  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
517
  If Buffer is NULL, then ASSERT().
518
  If Buffer is not aligned on a 16-bit boundary, then ASSERT().
519
  If unsupported bits are set in Flags, then ASSERT().
520
  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
521
  If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
522
523
  @param  Buffer  The pointer to the output buffer for the produced Null-terminated
524
                  Unicode string.
525
  @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.
526
  @param  Value   The 64-bit signed value to convert to a string.
527
  @param  Width   The maximum number of Unicode characters to place in Buffer, not including
528
                  the Null-terminator.
529
530
  @return The number of Unicode characters in Buffer, not including the Null-terminator.
531
532
**/
533
UINTN
534
EFIAPI
535
UnicodeValueToString (
536
  IN OUT CHAR16  *Buffer,
537
  IN UINTN       Flags,
538
  IN INT64       Value,
539
  IN UINTN       Width
540
  );
541
542
#endif
543
544
/**
488
/**
545
  Converts a decimal value to a Null-terminated Unicode string.
489
  Converts a decimal value to a Null-terminated Unicode string.
546
490
Lines 642-651 UnicodeValueToStringS ( Link Here
642
UINTN
586
UINTN
643
EFIAPI
587
EFIAPI
644
AsciiVSPrint (
588
AsciiVSPrint (
645
  OUT CHAR8         *StartOfBuffer,
589
  OUT CHAR8        *StartOfBuffer,
646
  IN  UINTN         BufferSize,
590
  IN  UINTN        BufferSize,
647
  IN  CONST CHAR8   *FormatString,
591
  IN  CONST CHAR8  *FormatString,
648
  IN  VA_LIST       Marker
592
  IN  VA_LIST      Marker
649
  );
593
  );
650
594
651
/**
595
/**
Lines 686-695 AsciiVSPrint ( Link Here
686
UINTN
630
UINTN
687
EFIAPI
631
EFIAPI
688
AsciiBSPrint (
632
AsciiBSPrint (
689
  OUT CHAR8         *StartOfBuffer,
633
  OUT CHAR8        *StartOfBuffer,
690
  IN  UINTN         BufferSize,
634
  IN  UINTN        BufferSize,
691
  IN  CONST CHAR8   *FormatString,
635
  IN  CONST CHAR8  *FormatString,
692
  IN  BASE_LIST     Marker
636
  IN  BASE_LIST    Marker
693
  );
637
  );
694
638
695
/**
639
/**
Lines 882-942 AsciiSPrintUnicodeFormat ( Link Here
882
  ...
826
  ...
883
  );
827
  );
884
828
885
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
886
887
/**
888
  [ATTENTION] This function is deprecated for security reason.
889
890
  Converts a decimal value to a Null-terminated ASCII string.
891
892
  Converts the decimal number specified by Value to a Null-terminated ASCII string
893
  specified by Buffer containing at most Width characters. No padding of spaces
894
  is ever performed.
895
  If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.
896
  The number of ASCII characters in Buffer is returned, not including the Null-terminator.
897
  If the conversion contains more than Width characters, then only the first Width
898
  characters are returned, and the total number of characters required to perform
899
  the conversion is returned.
900
  Additional conversion parameters are specified in Flags.
901
  The Flags bit LEFT_JUSTIFY is always ignored.
902
  All conversions are left justified in Buffer.
903
  If Width is 0, PREFIX_ZERO is ignored in Flags.
904
  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
905
  are inserted every 3rd digit starting from the right.
906
  If RADIX_HEX is set in Flags, then the output buffer will be
907
  formatted in hexadecimal format.
908
  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
909
  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
910
  then Buffer is padded with '0' characters so the combination of the optional '-'
911
  sign character, '0' characters, digit characters for Value, and the Null-terminator
912
  add up to Width characters.
913
914
  If Buffer is NULL, then ASSERT().
915
  If unsupported bits are set in Flags, then ASSERT().
916
  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
917
  If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
918
919
  @param  Buffer  A pointer to the output buffer for the produced Null-terminated
920
                  ASCII string.
921
  @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.
922
  @param  Value   The 64-bit signed value to convert to a string.
923
  @param  Width   The maximum number of ASCII characters to place in Buffer, not including
924
                  the Null-terminator.
925
926
  @return The number of ASCII characters in Buffer, not including the Null-terminator.
927
928
**/
929
UINTN
930
EFIAPI
931
AsciiValueToString (
932
  OUT CHAR8      *Buffer,
933
  IN  UINTN      Flags,
934
  IN  INT64      Value,
935
  IN  UINTN      Width
936
  );
937
938
#endif
939
940
/**
829
/**
941
  Converts a decimal value to a Null-terminated Ascii string.
830
  Converts a decimal value to a Null-terminated Ascii string.
942
831
Lines 989-999 AsciiValueToString ( Link Here
989
RETURN_STATUS
878
RETURN_STATUS
990
EFIAPI
879
EFIAPI
991
AsciiValueToStringS (
880
AsciiValueToStringS (
992
  IN OUT CHAR8   *Buffer,
881
  IN OUT CHAR8  *Buffer,
993
  IN UINTN       BufferSize,
882
  IN UINTN      BufferSize,
994
  IN UINTN       Flags,
883
  IN UINTN      Flags,
995
  IN INT64       Value,
884
  IN INT64      Value,
996
  IN UINTN       Width
885
  IN UINTN      Width
997
  );
886
  );
998
887
999
/**
888
/**
Lines 1016-1022 AsciiValueToStringS ( Link Here
1016
UINTN
905
UINTN
1017
EFIAPI
906
EFIAPI
1018
SPrintLength (
907
SPrintLength (
1019
  IN  CONST CHAR16   *FormatString,
908
  IN  CONST CHAR16  *FormatString,
1020
  IN  VA_LIST       Marker
909
  IN  VA_LIST       Marker
1021
  );
910
  );
1022
911
Lines 1038-1045 SPrintLength ( Link Here
1038
UINTN
927
UINTN
1039
EFIAPI
928
EFIAPI
1040
SPrintLengthAsciiFormat (
929
SPrintLengthAsciiFormat (
1041
  IN  CONST CHAR8   *FormatString,
930
  IN  CONST CHAR8  *FormatString,
1042
  IN  VA_LIST       Marker
931
  IN  VA_LIST      Marker
1043
  );
932
  );
1044
933
1045
#endif
934
#endif
(-)b/sys/contrib/edk2/Include/Library/UefiBootServicesTableLib.h (-2 / +2 lines)
Lines 13-24 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
13
///
13
///
14
/// Cache the Image Handle
14
/// Cache the Image Handle
15
///
15
///
16
extern EFI_HANDLE         gImageHandle;
16
extern EFI_HANDLE  gImageHandle;
17
17
18
///
18
///
19
/// Cache pointer to the EFI System Table
19
/// Cache pointer to the EFI System Table
20
///
20
///
21
extern EFI_SYSTEM_TABLE   *gST;
21
extern EFI_SYSTEM_TABLE  *gST;
22
22
23
///
23
///
24
/// Cache pointer to the EFI Boot Services Table
24
/// Cache pointer to the EFI Boot Services Table
(-)b/sys/contrib/edk2/Include/Protocol/DebugPort.h (-11 / +10 lines)
Lines 12-18 Link Here
12
#ifndef __DEBUG_PORT_H__
12
#ifndef __DEBUG_PORT_H__
13
#define __DEBUG_PORT_H__
13
#define __DEBUG_PORT_H__
14
14
15
16
///
15
///
17
/// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
16
/// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
18
///
17
///
Lines 21-27 Link Here
21
    0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
20
    0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
22
  }
21
  }
23
22
24
extern EFI_GUID gEfiDebugPortProtocolGuid;
23
extern EFI_GUID  gEfiDebugPortProtocolGuid;
25
24
26
typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
25
typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
27
26
Lines 111-140 EFI_STATUS Link Here
111
/// This protocol provides the communication link between the debug agent and the remote host.
110
/// This protocol provides the communication link between the debug agent and the remote host.
112
///
111
///
113
struct _EFI_DEBUGPORT_PROTOCOL {
112
struct _EFI_DEBUGPORT_PROTOCOL {
114
  EFI_DEBUGPORT_RESET Reset;
113
  EFI_DEBUGPORT_RESET    Reset;
115
  EFI_DEBUGPORT_WRITE Write;
114
  EFI_DEBUGPORT_WRITE    Write;
116
  EFI_DEBUGPORT_READ  Read;
115
  EFI_DEBUGPORT_READ     Read;
117
  EFI_DEBUGPORT_POLL  Poll;
116
  EFI_DEBUGPORT_POLL     Poll;
118
};
117
};
119
118
120
//
119
//
121
// DEBUGPORT variable definitions...
120
// DEBUGPORT variable definitions...
122
//
121
//
123
#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
122
#define EFI_DEBUGPORT_VARIABLE_NAME  L"DEBUGPORT"
124
#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
123
#define EFI_DEBUGPORT_VARIABLE_GUID  EFI_DEBUGPORT_PROTOCOL_GUID
125
124
126
extern EFI_GUID  gEfiDebugPortVariableGuid;
125
extern EFI_GUID  gEfiDebugPortVariableGuid;
127
126
128
//
127
//
129
// DebugPort device path definitions...
128
// DebugPort device path definitions...
130
//
129
//
131
#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
130
#define DEVICE_PATH_MESSAGING_DEBUGPORT  EFI_DEBUGPORT_PROTOCOL_GUID
132
131
133
extern EFI_GUID  gEfiDebugPortDevicePathGuid;
132
extern EFI_GUID  gEfiDebugPortDevicePathGuid;
134
133
135
typedef struct {
134
typedef struct {
136
  EFI_DEVICE_PATH_PROTOCOL  Header;
135
  EFI_DEVICE_PATH_PROTOCOL    Header;
137
  EFI_GUID                  Guid;
136
  EFI_GUID                    Guid;
138
} DEBUGPORT_DEVICE_PATH;
137
} DEBUGPORT_DEVICE_PATH;
139
138
140
#endif
139
#endif
(-)b/sys/contrib/edk2/Include/Protocol/DevicePath.h (-287 / +283 lines)
Lines 41-137 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
41
  that make up the Device Path.
41
  that make up the Device Path.
42
**/
42
**/
43
typedef struct {
43
typedef struct {
44
  UINT8 Type;       ///< 0x01 Hardware Device Path.
44
  UINT8    Type;    ///< 0x01 Hardware Device Path.
45
                    ///< 0x02 ACPI Device Path.
45
                    ///< 0x02 ACPI Device Path.
46
                    ///< 0x03 Messaging Device Path.
46
                    ///< 0x03 Messaging Device Path.
47
                    ///< 0x04 Media Device Path.
47
                    ///< 0x04 Media Device Path.
48
                    ///< 0x05 BIOS Boot Specification Device Path.
48
                    ///< 0x05 BIOS Boot Specification Device Path.
49
                    ///< 0x7F End of Hardware Device Path.
49
                    ///< 0x7F End of Hardware Device Path.
50
50
51
  UINT8 SubType;    ///< Varies by Type
51
  UINT8    SubType; ///< Varies by Type
52
                    ///< 0xFF End Entire Device Path, or
52
                    ///< 0xFF End Entire Device Path, or
53
                    ///< 0x01 End This Instance of a Device Path and start a new
53
                    ///< 0x01 End This Instance of a Device Path and start a new
54
                    ///< Device Path.
54
                    ///< Device Path.
55
55
56
  UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define
56
  UINT8    Length[2]; ///< Specific Device Path data. Type and Sub-Type define
57
                    ///< type of data. Size of data is included in Length.
57
                      ///< type of data. Size of data is included in Length.
58
59
} EFI_DEVICE_PATH_PROTOCOL;
58
} EFI_DEVICE_PATH_PROTOCOL;
60
59
61
///
60
///
62
/// Device Path protocol definition for backward-compatible with EFI1.1.
61
/// Device Path protocol definition for backward-compatible with EFI1.1.
63
///
62
///
64
typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;
63
typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
65
64
66
///
65
///
67
/// Hardware Device Paths.
66
/// Hardware Device Paths.
68
///
67
///
69
#define HARDWARE_DEVICE_PATH      0x01
68
#define HARDWARE_DEVICE_PATH  0x01
70
69
71
///
70
///
72
/// PCI Device Path SubType.
71
/// PCI Device Path SubType.
73
///
72
///
74
#define HW_PCI_DP                 0x01
73
#define HW_PCI_DP  0x01
75
74
76
///
75
///
77
/// PCI Device Path.
76
/// PCI Device Path.
78
///
77
///
79
typedef struct {
78
typedef struct {
80
  EFI_DEVICE_PATH_PROTOCOL        Header;
79
  EFI_DEVICE_PATH_PROTOCOL    Header;
81
  ///
80
  ///
82
  /// PCI Function Number.
81
  /// PCI Function Number.
83
  ///
82
  ///
84
  UINT8                           Function;
83
  UINT8                       Function;
85
  ///
84
  ///
86
  /// PCI Device Number.
85
  /// PCI Device Number.
87
  ///
86
  ///
88
  UINT8                           Device;
87
  UINT8                       Device;
89
} PCI_DEVICE_PATH;
88
} PCI_DEVICE_PATH;
90
89
91
///
90
///
92
/// PCCARD Device Path SubType.
91
/// PCCARD Device Path SubType.
93
///
92
///
94
#define HW_PCCARD_DP              0x02
93
#define HW_PCCARD_DP  0x02
95
94
96
///
95
///
97
/// PCCARD Device Path.
96
/// PCCARD Device Path.
98
///
97
///
99
typedef struct {
98
typedef struct {
100
  EFI_DEVICE_PATH_PROTOCOL        Header;
99
  EFI_DEVICE_PATH_PROTOCOL    Header;
101
  ///
100
  ///
102
  /// Function Number (0 = First Function).
101
  /// Function Number (0 = First Function).
103
  ///
102
  ///
104
  UINT8                           FunctionNumber;
103
  UINT8                       FunctionNumber;
105
} PCCARD_DEVICE_PATH;
104
} PCCARD_DEVICE_PATH;
106
105
107
///
106
///
108
/// Memory Mapped Device Path SubType.
107
/// Memory Mapped Device Path SubType.
109
///
108
///
110
#define HW_MEMMAP_DP              0x03
109
#define HW_MEMMAP_DP  0x03
111
110
112
///
111
///
113
/// Memory Mapped Device Path.
112
/// Memory Mapped Device Path.
114
///
113
///
115
typedef struct {
114
typedef struct {
116
  EFI_DEVICE_PATH_PROTOCOL        Header;
115
  EFI_DEVICE_PATH_PROTOCOL    Header;
117
  ///
116
  ///
118
  /// EFI_MEMORY_TYPE
117
  /// EFI_MEMORY_TYPE
119
  ///
118
  ///
120
  UINT32                          MemoryType;
119
  UINT32                      MemoryType;
121
  ///
120
  ///
122
  /// Starting Memory Address.
121
  /// Starting Memory Address.
123
  ///
122
  ///
124
  EFI_PHYSICAL_ADDRESS            StartingAddress;
123
  EFI_PHYSICAL_ADDRESS        StartingAddress;
125
  ///
124
  ///
126
  /// Ending Memory Address.
125
  /// Ending Memory Address.
127
  ///
126
  ///
128
  EFI_PHYSICAL_ADDRESS            EndingAddress;
127
  EFI_PHYSICAL_ADDRESS        EndingAddress;
129
} MEMMAP_DEVICE_PATH;
128
} MEMMAP_DEVICE_PATH;
130
129
131
///
130
///
132
/// Hardware Vendor Device Path SubType.
131
/// Hardware Vendor Device Path SubType.
133
///
132
///
134
#define HW_VENDOR_DP              0x04
133
#define HW_VENDOR_DP  0x04
135
134
136
///
135
///
137
/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
136
/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
Lines 139-149 typedef struct { Link Here
139
/// contents on the n bytes that follow in the Vendor Device Path node.
138
/// contents on the n bytes that follow in the Vendor Device Path node.
140
///
139
///
141
typedef struct {
140
typedef struct {
142
  EFI_DEVICE_PATH_PROTOCOL        Header;
141
  EFI_DEVICE_PATH_PROTOCOL    Header;
143
  ///
142
  ///
144
  /// Vendor-assigned GUID that defines the data that follows.
143
  /// Vendor-assigned GUID that defines the data that follows.
145
  ///
144
  ///
146
  EFI_GUID                        Guid;
145
  EFI_GUID                    Guid;
147
  ///
146
  ///
148
  /// Vendor-defined variable size data.
147
  /// Vendor-defined variable size data.
149
  ///
148
  ///
Lines 152-207 typedef struct { Link Here
152
///
151
///
153
/// Controller Device Path SubType.
152
/// Controller Device Path SubType.
154
///
153
///
155
#define HW_CONTROLLER_DP          0x05
154
#define HW_CONTROLLER_DP  0x05
156
155
157
///
156
///
158
/// Controller Device Path.
157
/// Controller Device Path.
159
///
158
///
160
typedef struct {
159
typedef struct {
161
  EFI_DEVICE_PATH_PROTOCOL        Header;
160
  EFI_DEVICE_PATH_PROTOCOL    Header;
162
  ///
161
  ///
163
  /// Controller number.
162
  /// Controller number.
164
  ///
163
  ///
165
  UINT32                          ControllerNumber;
164
  UINT32                      ControllerNumber;
166
} CONTROLLER_DEVICE_PATH;
165
} CONTROLLER_DEVICE_PATH;
167
166
168
///
167
///
169
/// BMC Device Path SubType.
168
/// BMC Device Path SubType.
170
///
169
///
171
#define HW_BMC_DP                 0x06
170
#define HW_BMC_DP  0x06
172
171
173
///
172
///
174
/// BMC Device Path.
173
/// BMC Device Path.
175
///
174
///
176
typedef struct {
175
typedef struct {
177
  EFI_DEVICE_PATH_PROTOCOL        Header;
176
  EFI_DEVICE_PATH_PROTOCOL    Header;
178
  ///
177
  ///
179
  /// Interface Type.
178
  /// Interface Type.
180
  ///
179
  ///
181
  UINT8                           InterfaceType;
180
  UINT8                       InterfaceType;
182
  ///
181
  ///
183
  /// Base Address.
182
  /// Base Address.
184
  ///
183
  ///
185
  UINT8                           BaseAddress[8];
184
  UINT8                       BaseAddress[8];
186
} BMC_DEVICE_PATH;
185
} BMC_DEVICE_PATH;
187
186
188
///
187
///
189
/// ACPI Device Paths.
188
/// ACPI Device Paths.
190
///
189
///
191
#define ACPI_DEVICE_PATH          0x02
190
#define ACPI_DEVICE_PATH  0x02
192
191
193
///
192
///
194
/// ACPI Device Path SubType.
193
/// ACPI Device Path SubType.
195
///
194
///
196
#define ACPI_DP                   0x01
195
#define ACPI_DP  0x01
197
typedef struct {
196
typedef struct {
198
  EFI_DEVICE_PATH_PROTOCOL        Header;
197
  EFI_DEVICE_PATH_PROTOCOL    Header;
199
  ///
198
  ///
200
  /// Device's PnP hardware ID stored in a numeric 32-bit
199
  /// Device's PnP hardware ID stored in a numeric 32-bit
201
  /// compressed EISA-type ID. This value must match the
200
  /// compressed EISA-type ID. This value must match the
202
  /// corresponding _HID in the ACPI name space.
201
  /// corresponding _HID in the ACPI name space.
203
  ///
202
  ///
204
  UINT32                          HID;
203
  UINT32                      HID;
205
  ///
204
  ///
206
  /// Unique ID that is required by ACPI if two devices have the
205
  /// Unique ID that is required by ACPI if two devices have the
207
  /// same _HID. This value must also match the corresponding
206
  /// same _HID. This value must also match the corresponding
Lines 209-242 typedef struct { Link Here
209
  /// numeric value type of _UID is supported. Thus, strings must
208
  /// numeric value type of _UID is supported. Thus, strings must
210
  /// not be used for the _UID in the ACPI name space.
209
  /// not be used for the _UID in the ACPI name space.
211
  ///
210
  ///
212
  UINT32                          UID;
211
  UINT32                      UID;
213
} ACPI_HID_DEVICE_PATH;
212
} ACPI_HID_DEVICE_PATH;
214
213
215
///
214
///
216
/// Expanded ACPI Device Path SubType.
215
/// Expanded ACPI Device Path SubType.
217
///
216
///
218
#define ACPI_EXTENDED_DP          0x02
217
#define ACPI_EXTENDED_DP  0x02
219
typedef struct {
218
typedef struct {
220
  EFI_DEVICE_PATH_PROTOCOL        Header;
219
  EFI_DEVICE_PATH_PROTOCOL    Header;
221
  ///
220
  ///
222
  /// Device's PnP hardware ID stored in a numeric 32-bit
221
  /// Device's PnP hardware ID stored in a numeric 32-bit
223
  /// compressed EISA-type ID. This value must match the
222
  /// compressed EISA-type ID. This value must match the
224
  /// corresponding _HID in the ACPI name space.
223
  /// corresponding _HID in the ACPI name space.
225
  ///
224
  ///
226
  UINT32                          HID;
225
  UINT32                      HID;
227
  ///
226
  ///
228
  /// Unique ID that is required by ACPI if two devices have the
227
  /// Unique ID that is required by ACPI if two devices have the
229
  /// same _HID. This value must also match the corresponding
228
  /// same _HID. This value must also match the corresponding
230
  /// _UID/_HID pair in the ACPI name space.
229
  /// _UID/_HID pair in the ACPI name space.
231
  ///
230
  ///
232
  UINT32                          UID;
231
  UINT32                      UID;
233
  ///
232
  ///
234
  /// Device's compatible PnP hardware ID stored in a numeric
233
  /// Device's compatible PnP hardware ID stored in a numeric
235
  /// 32-bit compressed EISA-type ID. This value must match at
234
  /// 32-bit compressed EISA-type ID. This value must match at
236
  /// least one of the compatible device IDs returned by the
235
  /// least one of the compatible device IDs returned by the
237
  /// corresponding _CID in the ACPI name space.
236
  /// corresponding _CID in the ACPI name space.
238
  ///
237
  ///
239
  UINT32                          CID;
238
  UINT32                      CID;
240
  ///
239
  ///
241
  /// Optional variable length _HIDSTR.
240
  /// Optional variable length _HIDSTR.
242
  /// Optional variable length _UIDSTR.
241
  /// Optional variable length _UIDSTR.
Lines 251-268 typedef struct { Link Here
251
//   bits[31:16] - binary number
250
//   bits[31:16] - binary number
252
//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
251
//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
253
//
252
//
254
#define PNP_EISA_ID_CONST         0x41d0
253
#define PNP_EISA_ID_CONST  0x41d0
255
#define EISA_ID(_Name, _Num)      ((UINT32)((_Name) | (_Num) << 16))
254
#define EISA_ID(_Name, _Num)  ((UINT32)((_Name) | (_Num) << 16))
256
#define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
255
#define EISA_PNP_ID(_PNPId)   (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
257
#define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
256
#define EFI_PNP_ID(_PNPId)    (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
258
257
259
#define PNP_EISA_ID_MASK          0xffff
258
#define PNP_EISA_ID_MASK  0xffff
260
#define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)
259
#define EISA_ID_TO_NUM(_Id)  ((_Id) >> 16)
261
260
262
///
261
///
263
/// ACPI _ADR Device Path SubType.
262
/// ACPI _ADR Device Path SubType.
264
///
263
///
265
#define ACPI_ADR_DP               0x03
264
#define ACPI_ADR_DP  0x03
266
265
267
///
266
///
268
/// The _ADR device path is used to contain video output device attributes to support the Graphics
267
/// The _ADR device path is used to contain video output device attributes to support the Graphics
Lines 270-282 typedef struct { Link Here
270
/// devices are displaying the same output.
269
/// devices are displaying the same output.
271
///
270
///
272
typedef struct {
271
typedef struct {
273
  EFI_DEVICE_PATH_PROTOCOL        Header;
272
  EFI_DEVICE_PATH_PROTOCOL    Header;
274
  ///
273
  ///
275
  /// _ADR value. For video output devices the value of this
274
  /// _ADR value. For video output devices the value of this
276
  /// field comes from Table B-2 of the ACPI 3.0 specification. At
275
  /// field comes from Table B-2 of the ACPI 3.0 specification. At
277
  /// least one _ADR value is required.
276
  /// least one _ADR value is required.
278
  ///
277
  ///
279
  UINT32                          ADR;
278
  UINT32                      ADR;
280
  //
279
  //
281
  // This device path may optionally contain more than one _ADR entry.
280
  // This device path may optionally contain more than one _ADR entry.
282
  //
281
  //
Lines 285-300 typedef struct { Link Here
285
///
284
///
286
/// ACPI NVDIMM Device Path SubType.
285
/// ACPI NVDIMM Device Path SubType.
287
///
286
///
288
#define ACPI_NVDIMM_DP               0x04
287
#define ACPI_NVDIMM_DP  0x04
289
///
288
///
290
///
289
///
291
typedef struct {
290
typedef struct {
292
  EFI_DEVICE_PATH_PROTOCOL        Header;
291
  EFI_DEVICE_PATH_PROTOCOL    Header;
293
  ///
292
  ///
294
  /// NFIT Device Handle, the _ADR of the NVDIMM device.
293
  /// NFIT Device Handle, the _ADR of the NVDIMM device.
295
  /// The value of this field comes from Section 9.20.3 of the ACPI 6.2A specification.
294
  /// The value of this field comes from Section 9.20.3 of the ACPI 6.2A specification.
296
  ///
295
  ///
297
  UINT32                          NFITDeviceHandle;
296
  UINT32                      NFITDeviceHandle;
298
} ACPI_NVDIMM_DEVICE_PATH;
297
} ACPI_NVDIMM_DEVICE_PATH;
299
298
300
#define ACPI_ADR_DISPLAY_TYPE_OTHER             0
299
#define ACPI_ADR_DISPLAY_TYPE_OTHER             0
Lines 319-489 typedef struct { Link Here
319
/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
318
/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
320
/// information like networking protocol IP addresses.
319
/// information like networking protocol IP addresses.
321
///
320
///
322
#define MESSAGING_DEVICE_PATH     0x03
321
#define MESSAGING_DEVICE_PATH  0x03
323
322
324
///
323
///
325
/// ATAPI Device Path SubType
324
/// ATAPI Device Path SubType
326
///
325
///
327
#define MSG_ATAPI_DP              0x01
326
#define MSG_ATAPI_DP  0x01
328
typedef struct {
327
typedef struct {
329
  EFI_DEVICE_PATH_PROTOCOL        Header;
328
  EFI_DEVICE_PATH_PROTOCOL    Header;
330
  ///
329
  ///
331
  /// Set to zero for primary, or one for secondary.
330
  /// Set to zero for primary, or one for secondary.
332
  ///
331
  ///
333
  UINT8                           PrimarySecondary;
332
  UINT8                       PrimarySecondary;
334
  ///
333
  ///
335
  /// Set to zero for master, or one for slave mode.
334
  /// Set to zero for master, or one for slave mode.
336
  ///
335
  ///
337
  UINT8                           SlaveMaster;
336
  UINT8                       SlaveMaster;
338
  ///
337
  ///
339
  /// Logical Unit Number.
338
  /// Logical Unit Number.
340
  ///
339
  ///
341
  UINT16                          Lun;
340
  UINT16                      Lun;
342
} ATAPI_DEVICE_PATH;
341
} ATAPI_DEVICE_PATH;
343
342
344
///
343
///
345
/// SCSI Device Path SubType.
344
/// SCSI Device Path SubType.
346
///
345
///
347
#define MSG_SCSI_DP               0x02
346
#define MSG_SCSI_DP  0x02
348
typedef struct {
347
typedef struct {
349
  EFI_DEVICE_PATH_PROTOCOL        Header;
348
  EFI_DEVICE_PATH_PROTOCOL    Header;
350
  ///
349
  ///
351
  /// Target ID on the SCSI bus (PUN).
350
  /// Target ID on the SCSI bus (PUN).
352
  ///
351
  ///
353
  UINT16                          Pun;
352
  UINT16                      Pun;
354
  ///
353
  ///
355
  /// Logical Unit Number (LUN).
354
  /// Logical Unit Number (LUN).
356
  ///
355
  ///
357
  UINT16                          Lun;
356
  UINT16                      Lun;
358
} SCSI_DEVICE_PATH;
357
} SCSI_DEVICE_PATH;
359
358
360
///
359
///
361
/// Fibre Channel SubType.
360
/// Fibre Channel SubType.
362
///
361
///
363
#define MSG_FIBRECHANNEL_DP       0x03
362
#define MSG_FIBRECHANNEL_DP  0x03
364
typedef struct {
363
typedef struct {
365
  EFI_DEVICE_PATH_PROTOCOL        Header;
364
  EFI_DEVICE_PATH_PROTOCOL    Header;
366
  ///
365
  ///
367
  /// Reserved for the future.
366
  /// Reserved for the future.
368
  ///
367
  ///
369
  UINT32                          Reserved;
368
  UINT32                      Reserved;
370
  ///
369
  ///
371
  /// Fibre Channel World Wide Number.
370
  /// Fibre Channel World Wide Number.
372
  ///
371
  ///
373
  UINT64                          WWN;
372
  UINT64                      WWN;
374
  ///
373
  ///
375
  /// Fibre Channel Logical Unit Number.
374
  /// Fibre Channel Logical Unit Number.
376
  ///
375
  ///
377
  UINT64                          Lun;
376
  UINT64                      Lun;
378
} FIBRECHANNEL_DEVICE_PATH;
377
} FIBRECHANNEL_DEVICE_PATH;
379
378
380
///
379
///
381
/// Fibre Channel Ex SubType.
380
/// Fibre Channel Ex SubType.
382
///
381
///
383
#define MSG_FIBRECHANNELEX_DP     0x15
382
#define MSG_FIBRECHANNELEX_DP  0x15
384
typedef struct {
383
typedef struct {
385
  EFI_DEVICE_PATH_PROTOCOL        Header;
384
  EFI_DEVICE_PATH_PROTOCOL    Header;
386
  ///
385
  ///
387
  /// Reserved for the future.
386
  /// Reserved for the future.
388
  ///
387
  ///
389
  UINT32                          Reserved;
388
  UINT32                      Reserved;
390
  ///
389
  ///
391
  /// 8 byte array containing Fibre Channel End Device Port Name.
390
  /// 8 byte array containing Fibre Channel End Device Port Name.
392
  ///
391
  ///
393
  UINT8                           WWN[8];
392
  UINT8                       WWN[8];
394
  ///
393
  ///
395
  /// 8 byte array containing Fibre Channel Logical Unit Number.
394
  /// 8 byte array containing Fibre Channel Logical Unit Number.
396
  ///
395
  ///
397
  UINT8                           Lun[8];
396
  UINT8                       Lun[8];
398
} FIBRECHANNELEX_DEVICE_PATH;
397
} FIBRECHANNELEX_DEVICE_PATH;
399
398
400
///
399
///
401
/// 1394 Device Path SubType
400
/// 1394 Device Path SubType
402
///
401
///
403
#define MSG_1394_DP               0x04
402
#define MSG_1394_DP  0x04
404
typedef struct {
403
typedef struct {
405
  EFI_DEVICE_PATH_PROTOCOL        Header;
404
  EFI_DEVICE_PATH_PROTOCOL    Header;
406
  ///
405
  ///
407
  /// Reserved for the future.
406
  /// Reserved for the future.
408
  ///
407
  ///
409
  UINT32                          Reserved;
408
  UINT32                      Reserved;
410
  ///
409
  ///
411
  /// 1394 Global Unique ID (GUID).
410
  /// 1394 Global Unique ID (GUID).
412
  ///
411
  ///
413
  UINT64                          Guid;
412
  UINT64                      Guid;
414
} F1394_DEVICE_PATH;
413
} F1394_DEVICE_PATH;
415
414
416
///
415
///
417
/// USB Device Path SubType.
416
/// USB Device Path SubType.
418
///
417
///
419
#define MSG_USB_DP                0x05
418
#define MSG_USB_DP  0x05
420
typedef struct {
419
typedef struct {
421
  EFI_DEVICE_PATH_PROTOCOL      Header;
420
  EFI_DEVICE_PATH_PROTOCOL    Header;
422
  ///
421
  ///
423
  /// USB Parent Port Number.
422
  /// USB Parent Port Number.
424
  ///
423
  ///
425
  UINT8                         ParentPortNumber;
424
  UINT8                       ParentPortNumber;
426
  ///
425
  ///
427
  /// USB Interface Number.
426
  /// USB Interface Number.
428
  ///
427
  ///
429
  UINT8                         InterfaceNumber;
428
  UINT8                       InterfaceNumber;
430
} USB_DEVICE_PATH;
429
} USB_DEVICE_PATH;
431
430
432
///
431
///
433
/// USB Class Device Path SubType.
432
/// USB Class Device Path SubType.
434
///
433
///
435
#define MSG_USB_CLASS_DP          0x0f
434
#define MSG_USB_CLASS_DP  0x0f
436
typedef struct {
435
typedef struct {
437
  EFI_DEVICE_PATH_PROTOCOL      Header;
436
  EFI_DEVICE_PATH_PROTOCOL    Header;
438
  ///
437
  ///
439
  /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
438
  /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
440
  /// match any Vendor ID.
439
  /// match any Vendor ID.
441
  ///
440
  ///
442
  UINT16                        VendorId;
441
  UINT16                      VendorId;
443
  ///
442
  ///
444
  /// Product ID assigned by USB-IF. A value of 0xFFFF will
443
  /// Product ID assigned by USB-IF. A value of 0xFFFF will
445
  /// match any Product ID.
444
  /// match any Product ID.
446
  ///
445
  ///
447
  UINT16                        ProductId;
446
  UINT16                      ProductId;
448
  ///
447
  ///
449
  /// The class code assigned by the USB-IF. A value of 0xFF
448
  /// The class code assigned by the USB-IF. A value of 0xFF
450
  /// will match any class code.
449
  /// will match any class code.
451
  ///
450
  ///
452
  UINT8                         DeviceClass;
451
  UINT8                       DeviceClass;
453
  ///
452
  ///
454
  /// The subclass code assigned by the USB-IF. A value of
453
  /// The subclass code assigned by the USB-IF. A value of
455
  /// 0xFF will match any subclass code.
454
  /// 0xFF will match any subclass code.
456
  ///
455
  ///
457
  UINT8                         DeviceSubClass;
456
  UINT8                       DeviceSubClass;
458
  ///
457
  ///
459
  /// The protocol code assigned by the USB-IF. A value of
458
  /// The protocol code assigned by the USB-IF. A value of
460
  /// 0xFF will match any protocol code.
459
  /// 0xFF will match any protocol code.
461
  ///
460
  ///
462
  UINT8                         DeviceProtocol;
461
  UINT8                       DeviceProtocol;
463
} USB_CLASS_DEVICE_PATH;
462
} USB_CLASS_DEVICE_PATH;
464
463
465
///
464
///
466
/// USB WWID Device Path SubType.
465
/// USB WWID Device Path SubType.
467
///
466
///
468
#define MSG_USB_WWID_DP           0x10
467
#define MSG_USB_WWID_DP  0x10
469
468
470
///
469
///
471
/// This device path describes a USB device using its serial number.
470
/// This device path describes a USB device using its serial number.
472
///
471
///
473
typedef struct {
472
typedef struct {
474
  EFI_DEVICE_PATH_PROTOCOL      Header;
473
  EFI_DEVICE_PATH_PROTOCOL    Header;
475
  ///
474
  ///
476
  /// USB interface number.
475
  /// USB interface number.
477
  ///
476
  ///
478
  UINT16                        InterfaceNumber;
477
  UINT16                      InterfaceNumber;
479
  ///
478
  ///
480
  /// USB vendor id of the device.
479
  /// USB vendor id of the device.
481
  ///
480
  ///
482
  UINT16                        VendorId;
481
  UINT16                      VendorId;
483
  ///
482
  ///
484
  /// USB product id of the device.
483
  /// USB product id of the device.
485
  ///
484
  ///
486
  UINT16                        ProductId;
485
  UINT16                      ProductId;
487
  ///
486
  ///
488
  /// Last 64-or-fewer UTF-16 characters of the USB
487
  /// Last 64-or-fewer UTF-16 characters of the USB
489
  /// serial number. The length of the string is
488
  /// serial number. The length of the string is
Lines 498-633 typedef struct { Link Here
498
///
497
///
499
#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11
498
#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11
500
typedef struct {
499
typedef struct {
501
  EFI_DEVICE_PATH_PROTOCOL      Header;
500
  EFI_DEVICE_PATH_PROTOCOL    Header;
502
  ///
501
  ///
503
  /// Logical Unit Number for the interface.
502
  /// Logical Unit Number for the interface.
504
  ///
503
  ///
505
  UINT8                         Lun;
504
  UINT8                       Lun;
506
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
505
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
507
506
508
///
507
///
509
/// SATA Device Path SubType.
508
/// SATA Device Path SubType.
510
///
509
///
511
#define MSG_SATA_DP               0x12
510
#define MSG_SATA_DP  0x12
512
typedef struct {
511
typedef struct {
513
  EFI_DEVICE_PATH_PROTOCOL        Header;
512
  EFI_DEVICE_PATH_PROTOCOL    Header;
514
  ///
513
  ///
515
  /// The HBA port number that facilitates the connection to the
514
  /// The HBA port number that facilitates the connection to the
516
  /// device or a port multiplier. The value 0xFFFF is reserved.
515
  /// device or a port multiplier. The value 0xFFFF is reserved.
517
  ///
516
  ///
518
  UINT16                          HBAPortNumber;
517
  UINT16                      HBAPortNumber;
519
  ///
518
  ///
520
  /// The Port multiplier port number that facilitates the connection
519
  /// The Port multiplier port number that facilitates the connection
521
  /// to the device. Must be set to 0xFFFF if the device is directly
520
  /// to the device. Must be set to 0xFFFF if the device is directly
522
  /// connected to the HBA.
521
  /// connected to the HBA.
523
  ///
522
  ///
524
  UINT16                          PortMultiplierPortNumber;
523
  UINT16                      PortMultiplierPortNumber;
525
  ///
524
  ///
526
  /// Logical Unit Number.
525
  /// Logical Unit Number.
527
  ///
526
  ///
528
  UINT16                          Lun;
527
  UINT16                      Lun;
529
} SATA_DEVICE_PATH;
528
} SATA_DEVICE_PATH;
530
529
531
///
530
///
532
/// Flag for if the device is directly connected to the HBA.
531
/// Flag for if the device is directly connected to the HBA.
533
///
532
///
534
#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
533
#define SATA_HBA_DIRECT_CONNECT_FLAG  0x8000
535
534
536
///
535
///
537
/// I2O Device Path SubType.
536
/// I2O Device Path SubType.
538
///
537
///
539
#define MSG_I2O_DP                0x06
538
#define MSG_I2O_DP  0x06
540
typedef struct {
539
typedef struct {
541
  EFI_DEVICE_PATH_PROTOCOL        Header;
540
  EFI_DEVICE_PATH_PROTOCOL    Header;
542
  ///
541
  ///
543
  /// Target ID (TID) for a device.
542
  /// Target ID (TID) for a device.
544
  ///
543
  ///
545
  UINT32                          Tid;
544
  UINT32                      Tid;
546
} I2O_DEVICE_PATH;
545
} I2O_DEVICE_PATH;
547
546
548
///
547
///
549
/// MAC Address Device Path SubType.
548
/// MAC Address Device Path SubType.
550
///
549
///
551
#define MSG_MAC_ADDR_DP           0x0b
550
#define MSG_MAC_ADDR_DP  0x0b
552
typedef struct {
551
typedef struct {
553
  EFI_DEVICE_PATH_PROTOCOL        Header;
552
  EFI_DEVICE_PATH_PROTOCOL    Header;
554
  ///
553
  ///
555
  /// The MAC address for a network interface padded with 0s.
554
  /// The MAC address for a network interface padded with 0s.
556
  ///
555
  ///
557
  EFI_MAC_ADDRESS                 MacAddress;
556
  EFI_MAC_ADDRESS             MacAddress;
558
  ///
557
  ///
559
  /// Network interface type(i.e. 802.3, FDDI).
558
  /// Network interface type(i.e. 802.3, FDDI).
560
  ///
559
  ///
561
  UINT8                           IfType;
560
  UINT8                       IfType;
562
} MAC_ADDR_DEVICE_PATH;
561
} MAC_ADDR_DEVICE_PATH;
563
562
564
///
563
///
565
/// IPv4 Device Path SubType
564
/// IPv4 Device Path SubType
566
///
565
///
567
#define MSG_IPv4_DP               0x0c
566
#define MSG_IPv4_DP  0x0c
568
typedef struct {
567
typedef struct {
569
  EFI_DEVICE_PATH_PROTOCOL        Header;
568
  EFI_DEVICE_PATH_PROTOCOL    Header;
570
  ///
569
  ///
571
  /// The local IPv4 address.
570
  /// The local IPv4 address.
572
  ///
571
  ///
573
  EFI_IPv4_ADDRESS                LocalIpAddress;
572
  EFI_IPv4_ADDRESS            LocalIpAddress;
574
  ///
573
  ///
575
  /// The remote IPv4 address.
574
  /// The remote IPv4 address.
576
  ///
575
  ///
577
  EFI_IPv4_ADDRESS                RemoteIpAddress;
576
  EFI_IPv4_ADDRESS            RemoteIpAddress;
578
  ///
577
  ///
579
  /// The local port number.
578
  /// The local port number.
580
  ///
579
  ///
581
  UINT16                          LocalPort;
580
  UINT16                      LocalPort;
582
  ///
581
  ///
583
  /// The remote port number.
582
  /// The remote port number.
584
  ///
583
  ///
585
  UINT16                          RemotePort;
584
  UINT16                      RemotePort;
586
  ///
585
  ///
587
  /// The network protocol(i.e. UDP, TCP).
586
  /// The network protocol(i.e. UDP, TCP).
588
  ///
587
  ///
589
  UINT16                          Protocol;
588
  UINT16                      Protocol;
590
  ///
589
  ///
591
  /// 0x00 - The Source IP Address was assigned though DHCP.
590
  /// 0x00 - The Source IP Address was assigned though DHCP.
592
  /// 0x01 - The Source IP Address is statically bound.
591
  /// 0x01 - The Source IP Address is statically bound.
593
  ///
592
  ///
594
  BOOLEAN                         StaticIpAddress;
593
  BOOLEAN                     StaticIpAddress;
595
  ///
594
  ///
596
  /// The gateway IP address
595
  /// The gateway IP address
597
  ///
596
  ///
598
  EFI_IPv4_ADDRESS                GatewayIpAddress;
597
  EFI_IPv4_ADDRESS            GatewayIpAddress;
599
  ///
598
  ///
600
  /// The subnet mask
599
  /// The subnet mask
601
  ///
600
  ///
602
  EFI_IPv4_ADDRESS                SubnetMask;
601
  EFI_IPv4_ADDRESS            SubnetMask;
603
} IPv4_DEVICE_PATH;
602
} IPv4_DEVICE_PATH;
604
603
605
///
604
///
606
/// IPv6 Device Path SubType.
605
/// IPv6 Device Path SubType.
607
///
606
///
608
#define MSG_IPv6_DP               0x0d
607
#define MSG_IPv6_DP  0x0d
609
typedef struct {
608
typedef struct {
610
  EFI_DEVICE_PATH_PROTOCOL        Header;
609
  EFI_DEVICE_PATH_PROTOCOL    Header;
611
  ///
610
  ///
612
  /// The local IPv6 address.
611
  /// The local IPv6 address.
613
  ///
612
  ///
614
  EFI_IPv6_ADDRESS                LocalIpAddress;
613
  EFI_IPv6_ADDRESS            LocalIpAddress;
615
  ///
614
  ///
616
  /// The remote IPv6 address.
615
  /// The remote IPv6 address.
617
  ///
616
  ///
618
  EFI_IPv6_ADDRESS                RemoteIpAddress;
617
  EFI_IPv6_ADDRESS            RemoteIpAddress;
619
  ///
618
  ///
620
  /// The local port number.
619
  /// The local port number.
621
  ///
620
  ///
622
  UINT16                          LocalPort;
621
  UINT16                      LocalPort;
623
  ///
622
  ///
624
  /// The remote port number.
623
  /// The remote port number.
625
  ///
624
  ///
626
  UINT16                          RemotePort;
625
  UINT16                      RemotePort;
627
  ///
626
  ///
628
  /// The network protocol(i.e. UDP, TCP).
627
  /// The network protocol(i.e. UDP, TCP).
629
  ///
628
  ///
630
  UINT16                          Protocol;
629
  UINT16                      Protocol;
631
  ///
630
  ///
632
  /// 0x00 - The Local IP Address was manually configured.
631
  /// 0x00 - The Local IP Address was manually configured.
633
  /// 0x01 - The Local IP Address is assigned through IPv6
632
  /// 0x01 - The Local IP Address is assigned through IPv6
Lines 635-657 typedef struct { Link Here
635
  /// 0x02 - The Local IP Address is assigned through IPv6
634
  /// 0x02 - The Local IP Address is assigned through IPv6
636
  /// stateful configuration.
635
  /// stateful configuration.
637
  ///
636
  ///
638
  UINT8                           IpAddressOrigin;
637
  UINT8                       IpAddressOrigin;
639
  ///
638
  ///
640
  /// The prefix length
639
  /// The prefix length
641
  ///
640
  ///
642
  UINT8                           PrefixLength;
641
  UINT8                       PrefixLength;
643
  ///
642
  ///
644
  /// The gateway IP address
643
  /// The gateway IP address
645
  ///
644
  ///
646
  EFI_IPv6_ADDRESS                GatewayIpAddress;
645
  EFI_IPv6_ADDRESS            GatewayIpAddress;
647
} IPv6_DEVICE_PATH;
646
} IPv6_DEVICE_PATH;
648
647
649
///
648
///
650
/// InfiniBand Device Path SubType.
649
/// InfiniBand Device Path SubType.
651
///
650
///
652
#define MSG_INFINIBAND_DP         0x09
651
#define MSG_INFINIBAND_DP  0x09
653
typedef struct {
652
typedef struct {
654
  EFI_DEVICE_PATH_PROTOCOL        Header;
653
  EFI_DEVICE_PATH_PROTOCOL    Header;
655
  ///
654
  ///
656
  /// Flags to help identify/manage InfiniBand device path elements:
655
  /// Flags to help identify/manage InfiniBand device path elements:
657
  /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
656
  /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
Lines 661-684 typedef struct { Link Here
661
  /// Bit 4 - Network Protocol.
660
  /// Bit 4 - Network Protocol.
662
  /// All other bits are reserved.
661
  /// All other bits are reserved.
663
  ///
662
  ///
664
  UINT32                          ResourceFlags;
663
  UINT32    ResourceFlags;
665
  ///
664
  ///
666
  /// 128-bit Global Identifier for remote fabric port.
665
  /// 128-bit Global Identifier for remote fabric port.
667
  ///
666
  ///
668
  UINT8                           PortGid[16];
667
  UINT8     PortGid[16];
669
  ///
668
  ///
670
  /// 64-bit unique identifier to remote IOC or server process.
669
  /// 64-bit unique identifier to remote IOC or server process.
671
  /// Interpretation of field specified by Resource Flags (bit 0).
670
  /// Interpretation of field specified by Resource Flags (bit 0).
672
  ///
671
  ///
673
  UINT64                          ServiceId;
672
  UINT64    ServiceId;
674
  ///
673
  ///
675
  /// 64-bit persistent ID of remote IOC port.
674
  /// 64-bit persistent ID of remote IOC port.
676
  ///
675
  ///
677
  UINT64                          TargetPortId;
676
  UINT64    TargetPortId;
678
  ///
677
  ///
679
  /// 64-bit persistent ID of remote device.
678
  /// 64-bit persistent ID of remote device.
680
  ///
679
  ///
681
  UINT64                          DeviceId;
680
  UINT64    DeviceId;
682
} INFINIBAND_DEVICE_PATH;
681
} INFINIBAND_DEVICE_PATH;
683
682
684
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01
683
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01
Lines 690-712 typedef struct { Link Here
690
///
689
///
691
/// UART Device Path SubType.
690
/// UART Device Path SubType.
692
///
691
///
693
#define MSG_UART_DP               0x0e
692
#define MSG_UART_DP  0x0e
694
typedef struct {
693
typedef struct {
695
  EFI_DEVICE_PATH_PROTOCOL        Header;
694
  EFI_DEVICE_PATH_PROTOCOL    Header;
696
  ///
695
  ///
697
  /// Reserved.
696
  /// Reserved.
698
  ///
697
  ///
699
  UINT32                          Reserved;
698
  UINT32                      Reserved;
700
  ///
699
  ///
701
  /// The baud rate setting for the UART style device. A value of 0
700
  /// The baud rate setting for the UART style device. A value of 0
702
  /// means that the device's default baud rate will be used.
701
  /// means that the device's default baud rate will be used.
703
  ///
702
  ///
704
  UINT64                          BaudRate;
703
  UINT64                      BaudRate;
705
  ///
704
  ///
706
  /// The number of data bits for the UART style device. A value
705
  /// The number of data bits for the UART style device. A value
707
  /// of 0 means that the device's default number of data bits will be used.
706
  /// of 0 means that the device's default number of data bits will be used.
708
  ///
707
  ///
709
  UINT8                           DataBits;
708
  UINT8                       DataBits;
710
  ///
709
  ///
711
  /// The parity setting for the UART style device.
710
  /// The parity setting for the UART style device.
712
  /// Parity 0x00 - Default Parity.
711
  /// Parity 0x00 - Default Parity.
Lines 716-722 typedef struct { Link Here
716
  /// Parity 0x04 - Mark Parity.
715
  /// Parity 0x04 - Mark Parity.
717
  /// Parity 0x05 - Space Parity.
716
  /// Parity 0x05 - Space Parity.
718
  ///
717
  ///
719
  UINT8                           Parity;
718
  UINT8    Parity;
720
  ///
719
  ///
721
  /// The number of stop bits for the UART style device.
720
  /// The number of stop bits for the UART style device.
722
  /// Stop Bits 0x00 - Default Stop Bits.
721
  /// Stop Bits 0x00 - Default Stop Bits.
Lines 724-928 typedef struct { Link Here
724
  /// Stop Bits 0x02 - 1.5 Stop Bits.
723
  /// Stop Bits 0x02 - 1.5 Stop Bits.
725
  /// Stop Bits 0x03 - 2 Stop Bits.
724
  /// Stop Bits 0x03 - 2 Stop Bits.
726
  ///
725
  ///
727
  UINT8                           StopBits;
726
  UINT8    StopBits;
728
} UART_DEVICE_PATH;
727
} UART_DEVICE_PATH;
729
728
730
///
729
///
731
/// NVDIMM Namespace Device Path SubType.
730
/// NVDIMM Namespace Device Path SubType.
732
///
731
///
733
#define NVDIMM_NAMESPACE_DP               0x20
732
#define NVDIMM_NAMESPACE_DP  0x20
734
typedef struct {
733
typedef struct {
735
  EFI_DEVICE_PATH_PROTOCOL        Header;
734
  EFI_DEVICE_PATH_PROTOCOL    Header;
736
  ///
735
  ///
737
  /// Namespace unique label identifier UUID.
736
  /// Namespace unique label identifier UUID.
738
  ///
737
  ///
739
  EFI_GUID Uuid;
738
  EFI_GUID                    Uuid;
740
} NVDIMM_NAMESPACE_DEVICE_PATH;
739
} NVDIMM_NAMESPACE_DEVICE_PATH;
741
740
742
//
741
//
743
// Use VENDOR_DEVICE_PATH struct
742
// Use VENDOR_DEVICE_PATH struct
744
//
743
//
745
#define MSG_VENDOR_DP             0x0a
744
#define MSG_VENDOR_DP  0x0a
746
typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;
745
typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;
747
746
748
#define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID
747
#define DEVICE_PATH_MESSAGING_PC_ANSI      EFI_PC_ANSI_GUID
749
#define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID
748
#define DEVICE_PATH_MESSAGING_VT_100       EFI_VT_100_GUID
750
#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
749
#define DEVICE_PATH_MESSAGING_VT_100_PLUS  EFI_VT_100_PLUS_GUID
751
#define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID
750
#define DEVICE_PATH_MESSAGING_VT_UTF8      EFI_VT_UTF8_GUID
752
751
753
///
752
///
754
/// A new device path node is defined to declare flow control characteristics.
753
/// A new device path node is defined to declare flow control characteristics.
755
/// UART Flow Control Messaging Device Path
754
/// UART Flow Control Messaging Device Path
756
///
755
///
757
typedef struct {
756
typedef struct {
758
  EFI_DEVICE_PATH_PROTOCOL        Header;
757
  EFI_DEVICE_PATH_PROTOCOL    Header;
759
  ///
758
  ///
760
  /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
759
  /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
761
  ///
760
  ///
762
  EFI_GUID                        Guid;
761
  EFI_GUID                    Guid;
763
  ///
762
  ///
764
  /// Bitmap of supported flow control types.
763
  /// Bitmap of supported flow control types.
765
  /// Bit 0 set indicates hardware flow control.
764
  /// Bit 0 set indicates hardware flow control.
766
  /// Bit 1 set indicates Xon/Xoff flow control.
765
  /// Bit 1 set indicates Xon/Xoff flow control.
767
  /// All other bits are reserved and are clear.
766
  /// All other bits are reserved and are clear.
768
  ///
767
  ///
769
  UINT32                          FlowControlMap;
768
  UINT32                      FlowControlMap;
770
} UART_FLOW_CONTROL_DEVICE_PATH;
769
} UART_FLOW_CONTROL_DEVICE_PATH;
771
770
772
#define UART_FLOW_CONTROL_HARDWARE         0x00000001
771
#define UART_FLOW_CONTROL_HARDWARE  0x00000001
773
#define UART_FLOW_CONTROL_XON_XOFF         0x00000010
772
#define UART_FLOW_CONTROL_XON_XOFF  0x00000010
774
773
775
#define DEVICE_PATH_MESSAGING_SAS          EFI_SAS_DEVICE_PATH_GUID
774
#define DEVICE_PATH_MESSAGING_SAS  EFI_SAS_DEVICE_PATH_GUID
776
///
775
///
777
/// Serial Attached SCSI (SAS) Device Path.
776
/// Serial Attached SCSI (SAS) Device Path.
778
///
777
///
779
typedef struct {
778
typedef struct {
780
  EFI_DEVICE_PATH_PROTOCOL        Header;
779
  EFI_DEVICE_PATH_PROTOCOL    Header;
781
  ///
780
  ///
782
  /// DEVICE_PATH_MESSAGING_SAS GUID.
781
  /// DEVICE_PATH_MESSAGING_SAS GUID.
783
  ///
782
  ///
784
  EFI_GUID                        Guid;
783
  EFI_GUID                    Guid;
785
  ///
784
  ///
786
  /// Reserved for future use.
785
  /// Reserved for future use.
787
  ///
786
  ///
788
  UINT32                          Reserved;
787
  UINT32                      Reserved;
789
  ///
788
  ///
790
  /// SAS Address for Serial Attached SCSI Target.
789
  /// SAS Address for Serial Attached SCSI Target.
791
  ///
790
  ///
792
  UINT64                          SasAddress;
791
  UINT64                      SasAddress;
793
  ///
792
  ///
794
  /// SAS Logical Unit Number.
793
  /// SAS Logical Unit Number.
795
  ///
794
  ///
796
  UINT64                          Lun;
795
  UINT64                      Lun;
797
  ///
796
  ///
798
  /// More Information about the device and its interconnect.
797
  /// More Information about the device and its interconnect.
799
  ///
798
  ///
800
  UINT16                          DeviceTopology;
799
  UINT16                      DeviceTopology;
801
  ///
800
  ///
802
  /// Relative Target Port (RTP).
801
  /// Relative Target Port (RTP).
803
  ///
802
  ///
804
  UINT16                          RelativeTargetPort;
803
  UINT16                      RelativeTargetPort;
805
} SAS_DEVICE_PATH;
804
} SAS_DEVICE_PATH;
806
805
807
///
806
///
808
/// Serial Attached SCSI (SAS) Ex Device Path SubType
807
/// Serial Attached SCSI (SAS) Ex Device Path SubType
809
///
808
///
810
#define MSG_SASEX_DP              0x16
809
#define MSG_SASEX_DP  0x16
811
typedef struct {
810
typedef struct {
812
  EFI_DEVICE_PATH_PROTOCOL        Header;
811
  EFI_DEVICE_PATH_PROTOCOL    Header;
813
  ///
812
  ///
814
  /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
813
  /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
815
  ///
814
  ///
816
  UINT8                           SasAddress[8];
815
  UINT8                       SasAddress[8];
817
  ///
816
  ///
818
  /// 8-byte array of the SAS Logical Unit Number.
817
  /// 8-byte array of the SAS Logical Unit Number.
819
  ///
818
  ///
820
  UINT8                           Lun[8];
819
  UINT8                       Lun[8];
821
  ///
820
  ///
822
  /// More Information about the device and its interconnect.
821
  /// More Information about the device and its interconnect.
823
  ///
822
  ///
824
  UINT16                          DeviceTopology;
823
  UINT16                      DeviceTopology;
825
  ///
824
  ///
826
  /// Relative Target Port (RTP).
825
  /// Relative Target Port (RTP).
827
  ///
826
  ///
828
  UINT16                          RelativeTargetPort;
827
  UINT16                      RelativeTargetPort;
829
} SASEX_DEVICE_PATH;
828
} SASEX_DEVICE_PATH;
830
829
831
///
830
///
832
/// NvmExpress Namespace Device Path SubType.
831
/// NvmExpress Namespace Device Path SubType.
833
///
832
///
834
#define MSG_NVME_NAMESPACE_DP     0x17
833
#define MSG_NVME_NAMESPACE_DP  0x17
835
typedef struct {
834
typedef struct {
836
  EFI_DEVICE_PATH_PROTOCOL        Header;
835
  EFI_DEVICE_PATH_PROTOCOL    Header;
837
  UINT32                          NamespaceId;
836
  UINT32                      NamespaceId;
838
  UINT64                          NamespaceUuid;
837
  UINT64                      NamespaceUuid;
839
} NVME_NAMESPACE_DEVICE_PATH;
838
} NVME_NAMESPACE_DEVICE_PATH;
840
839
841
///
840
///
842
/// DNS Device Path SubType
841
/// DNS Device Path SubType
843
///
842
///
844
#define MSG_DNS_DP                0x1F
843
#define MSG_DNS_DP  0x1F
845
typedef struct {
844
typedef struct {
846
  EFI_DEVICE_PATH_PROTOCOL        Header;
845
  EFI_DEVICE_PATH_PROTOCOL    Header;
847
  ///
846
  ///
848
  /// Indicates the DNS server address is IPv4 or IPv6 address.
847
  /// Indicates the DNS server address is IPv4 or IPv6 address.
849
  ///
848
  ///
850
  UINT8                           IsIPv6;
849
  UINT8                       IsIPv6;
851
  ///
850
  ///
852
  /// Instance of the DNS server address.
851
  /// Instance of the DNS server address.
853
  ///
852
  ///
854
  EFI_IP_ADDRESS                  DnsServerIp[];
853
  EFI_IP_ADDRESS              DnsServerIp[];
855
} DNS_DEVICE_PATH;
854
} DNS_DEVICE_PATH;
856
855
857
///
856
///
858
/// Uniform Resource Identifiers (URI) Device Path SubType
857
/// Uniform Resource Identifiers (URI) Device Path SubType
859
///
858
///
860
#define MSG_URI_DP                0x18
859
#define MSG_URI_DP  0x18
861
typedef struct {
860
typedef struct {
862
  EFI_DEVICE_PATH_PROTOCOL        Header;
861
  EFI_DEVICE_PATH_PROTOCOL    Header;
863
  ///
862
  ///
864
  /// Instance of the URI pursuant to RFC 3986.
863
  /// Instance of the URI pursuant to RFC 3986.
865
  ///
864
  ///
866
  CHAR8                           Uri[];
865
  CHAR8                       Uri[];
867
} URI_DEVICE_PATH;
866
} URI_DEVICE_PATH;
868
867
869
///
868
///
870
/// Universal Flash Storage (UFS) Device Path SubType.
869
/// Universal Flash Storage (UFS) Device Path SubType.
871
///
870
///
872
#define MSG_UFS_DP                0x19
871
#define MSG_UFS_DP  0x19
873
typedef struct {
872
typedef struct {
874
  EFI_DEVICE_PATH_PROTOCOL        Header;
873
  EFI_DEVICE_PATH_PROTOCOL    Header;
875
  ///
874
  ///
876
  /// Target ID on the UFS bus (PUN).
875
  /// Target ID on the UFS bus (PUN).
877
  ///
876
  ///
878
  UINT8                           Pun;
877
  UINT8                       Pun;
879
  ///
878
  ///
880
  /// Logical Unit Number (LUN).
879
  /// Logical Unit Number (LUN).
881
  ///
880
  ///
882
  UINT8                           Lun;
881
  UINT8                       Lun;
883
} UFS_DEVICE_PATH;
882
} UFS_DEVICE_PATH;
884
883
885
///
884
///
886
/// SD (Secure Digital) Device Path SubType.
885
/// SD (Secure Digital) Device Path SubType.
887
///
886
///
888
#define MSG_SD_DP                 0x1A
887
#define MSG_SD_DP  0x1A
889
typedef struct {
888
typedef struct {
890
  EFI_DEVICE_PATH_PROTOCOL        Header;
889
  EFI_DEVICE_PATH_PROTOCOL    Header;
891
  UINT8                           SlotNumber;
890
  UINT8                       SlotNumber;
892
} SD_DEVICE_PATH;
891
} SD_DEVICE_PATH;
893
892
894
///
893
///
895
/// EMMC (Embedded MMC) Device Path SubType.
894
/// EMMC (Embedded MMC) Device Path SubType.
896
///
895
///
897
#define MSG_EMMC_DP                 0x1D
896
#define MSG_EMMC_DP  0x1D
898
typedef struct {
897
typedef struct {
899
  EFI_DEVICE_PATH_PROTOCOL        Header;
898
  EFI_DEVICE_PATH_PROTOCOL    Header;
900
  UINT8                           SlotNumber;
899
  UINT8                       SlotNumber;
901
} EMMC_DEVICE_PATH;
900
} EMMC_DEVICE_PATH;
902
901
903
///
902
///
904
/// iSCSI Device Path SubType
903
/// iSCSI Device Path SubType
905
///
904
///
906
#define MSG_ISCSI_DP              0x13
905
#define MSG_ISCSI_DP  0x13
907
typedef struct {
906
typedef struct {
908
  EFI_DEVICE_PATH_PROTOCOL        Header;
907
  EFI_DEVICE_PATH_PROTOCOL    Header;
909
  ///
908
  ///
910
  /// Network Protocol (0 = TCP, 1+ = reserved).
909
  /// Network Protocol (0 = TCP, 1+ = reserved).
911
  ///
910
  ///
912
  UINT16                          NetworkProtocol;
911
  UINT16                      NetworkProtocol;
913
  ///
912
  ///
914
  /// iSCSI Login Options.
913
  /// iSCSI Login Options.
915
  ///
914
  ///
916
  UINT16                          LoginOption;
915
  UINT16                      LoginOption;
917
  ///
916
  ///
918
  /// iSCSI Logical Unit Number.
917
  /// iSCSI Logical Unit Number.
919
  ///
918
  ///
920
  UINT64                          Lun;
919
  UINT64                      Lun;
921
  ///
920
  ///
922
  /// iSCSI Target Portal group tag the initiator intends
921
  /// iSCSI Target Portal group tag the initiator intends
923
  /// to establish a session with.
922
  /// to establish a session with.
924
  ///
923
  ///
925
  UINT16                          TargetPortalGroupTag;
924
  UINT16                      TargetPortalGroupTag;
926
  ///
925
  ///
927
  /// iSCSI NodeTarget Name. The length of the name
926
  /// iSCSI NodeTarget Name. The length of the name
928
  /// is determined by subtracting the offset of this field from Length.
927
  /// is determined by subtracting the offset of this field from Length.
Lines 930-1019 typedef struct { Link Here
930
  /// CHAR8                        iSCSI Target Name.
929
  /// CHAR8                        iSCSI Target Name.
931
} ISCSI_DEVICE_PATH;
930
} ISCSI_DEVICE_PATH;
932
931
933
#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000
932
#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST            0x0000
934
#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002
933
#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C  0x0002
935
#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000
934
#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST              0x0000
936
#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008
935
#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C    0x0008
937
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000
936
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP             0x0000
938
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000
937
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON              0x1000
939
#define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000
938
#define ISCSI_LOGIN_OPTION_CHAP_BI                     0x0000
940
#define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000
939
#define ISCSI_LOGIN_OPTION_CHAP_UNI                    0x2000
941
940
942
///
941
///
943
/// VLAN Device Path SubType.
942
/// VLAN Device Path SubType.
944
///
943
///
945
#define MSG_VLAN_DP               0x14
944
#define MSG_VLAN_DP  0x14
946
typedef struct {
945
typedef struct {
947
  EFI_DEVICE_PATH_PROTOCOL        Header;
946
  EFI_DEVICE_PATH_PROTOCOL    Header;
948
  ///
947
  ///
949
  /// VLAN identifier (0-4094).
948
  /// VLAN identifier (0-4094).
950
  ///
949
  ///
951
  UINT16                          VlanId;
950
  UINT16                      VlanId;
952
} VLAN_DEVICE_PATH;
951
} VLAN_DEVICE_PATH;
953
952
954
///
953
///
955
/// Bluetooth Device Path SubType.
954
/// Bluetooth Device Path SubType.
956
///
955
///
957
#define MSG_BLUETOOTH_DP     0x1b
956
#define MSG_BLUETOOTH_DP  0x1b
958
typedef struct {
957
typedef struct {
959
  EFI_DEVICE_PATH_PROTOCOL        Header;
958
  EFI_DEVICE_PATH_PROTOCOL    Header;
960
  ///
959
  ///
961
  /// 48bit Bluetooth device address.
960
  /// 48bit Bluetooth device address.
962
  ///
961
  ///
963
  BLUETOOTH_ADDRESS               BD_ADDR;
962
  BLUETOOTH_ADDRESS           BD_ADDR;
964
} BLUETOOTH_DEVICE_PATH;
963
} BLUETOOTH_DEVICE_PATH;
965
964
966
///
965
///
967
/// Wi-Fi Device Path SubType.
966
/// Wi-Fi Device Path SubType.
968
///
967
///
969
#define MSG_WIFI_DP               0x1C
968
#define MSG_WIFI_DP  0x1C
970
typedef struct {
969
typedef struct {
971
  EFI_DEVICE_PATH_PROTOCOL        Header;
970
  EFI_DEVICE_PATH_PROTOCOL    Header;
972
  ///
971
  ///
973
  /// Service set identifier. A 32-byte octets string.
972
  /// Service set identifier. A 32-byte octets string.
974
  ///
973
  ///
975
  UINT8                           SSId[32];
974
  UINT8                       SSId[32];
976
} WIFI_DEVICE_PATH;
975
} WIFI_DEVICE_PATH;
977
976
978
///
977
///
979
/// Bluetooth LE Device Path SubType.
978
/// Bluetooth LE Device Path SubType.
980
///
979
///
981
#define MSG_BLUETOOTH_LE_DP       0x1E
980
#define MSG_BLUETOOTH_LE_DP  0x1E
982
typedef struct {
981
typedef struct {
983
  EFI_DEVICE_PATH_PROTOCOL        Header;
982
  EFI_DEVICE_PATH_PROTOCOL    Header;
984
  BLUETOOTH_LE_ADDRESS            Address;
983
  BLUETOOTH_LE_ADDRESS        Address;
985
} BLUETOOTH_LE_DEVICE_PATH;
984
} BLUETOOTH_LE_DEVICE_PATH;
986
985
987
//
986
//
988
// Media Device Path
987
// Media Device Path
989
//
988
//
990
#define MEDIA_DEVICE_PATH         0x04
989
#define MEDIA_DEVICE_PATH  0x04
991
990
992
///
991
///
993
/// Hard Drive Media Device Path SubType.
992
/// Hard Drive Media Device Path SubType.
994
///
993
///
995
#define MEDIA_HARDDRIVE_DP        0x01
994
#define MEDIA_HARDDRIVE_DP  0x01
996
995
997
///
996
///
998
/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
997
/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
999
///
998
///
1000
typedef struct {
999
typedef struct {
1001
  EFI_DEVICE_PATH_PROTOCOL        Header;
1000
  EFI_DEVICE_PATH_PROTOCOL    Header;
1002
  ///
1001
  ///
1003
  /// Describes the entry in a partition table, starting with entry 1.
1002
  /// Describes the entry in a partition table, starting with entry 1.
1004
  /// Partition number zero represents the entire device. Valid
1003
  /// Partition number zero represents the entire device. Valid
1005
  /// partition numbers for a MBR partition are [1, 4]. Valid
1004
  /// partition numbers for a MBR partition are [1, 4]. Valid
1006
  /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
1005
  /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
1007
  ///
1006
  ///
1008
  UINT32                          PartitionNumber;
1007
  UINT32                      PartitionNumber;
1009
  ///
1008
  ///
1010
  /// Starting LBA of the partition on the hard drive.
1009
  /// Starting LBA of the partition on the hard drive.
1011
  ///
1010
  ///
1012
  UINT64                          PartitionStart;
1011
  UINT64                      PartitionStart;
1013
  ///
1012
  ///
1014
  /// Size of the partition in units of Logical Blocks.
1013
  /// Size of the partition in units of Logical Blocks.
1015
  ///
1014
  ///
1016
  UINT64                          PartitionSize;
1015
  UINT64                      PartitionSize;
1017
  ///
1016
  ///
1018
  /// Signature unique to this partition:
1017
  /// Signature unique to this partition:
1019
  /// If SignatureType is 0, this field has to be initialized with 16 zeros.
1018
  /// If SignatureType is 0, this field has to be initialized with 16 zeros.
Lines 1021-1088 typedef struct { Link Here
1021
  /// The other 12 bytes are initialized with zeros.
1020
  /// The other 12 bytes are initialized with zeros.
1022
  /// If SignatureType is 2, this field contains a 16 byte signature.
1021
  /// If SignatureType is 2, this field contains a 16 byte signature.
1023
  ///
1022
  ///
1024
  UINT8                           Signature[16];
1023
  UINT8                       Signature[16];
1025
  ///
1024
  ///
1026
  /// Partition Format: (Unused values reserved).
1025
  /// Partition Format: (Unused values reserved).
1027
  /// 0x01 - PC-AT compatible legacy MBR.
1026
  /// 0x01 - PC-AT compatible legacy MBR.
1028
  /// 0x02 - GUID Partition Table.
1027
  /// 0x02 - GUID Partition Table.
1029
  ///
1028
  ///
1030
  UINT8                           MBRType;
1029
  UINT8                       MBRType;
1031
  ///
1030
  ///
1032
  /// Type of Disk Signature: (Unused values reserved).
1031
  /// Type of Disk Signature: (Unused values reserved).
1033
  /// 0x00 - No Disk Signature.
1032
  /// 0x00 - No Disk Signature.
1034
  /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
1033
  /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
1035
  /// 0x02 - GUID signature.
1034
  /// 0x02 - GUID signature.
1036
  ///
1035
  ///
1037
  UINT8                           SignatureType;
1036
  UINT8                       SignatureType;
1038
} HARDDRIVE_DEVICE_PATH;
1037
} HARDDRIVE_DEVICE_PATH;
1039
1038
1040
#define MBR_TYPE_PCAT             0x01
1039
#define MBR_TYPE_PCAT                        0x01
1041
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
1040
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER  0x02
1042
1041
1043
#define NO_DISK_SIGNATURE         0x00
1042
#define NO_DISK_SIGNATURE    0x00
1044
#define SIGNATURE_TYPE_MBR        0x01
1043
#define SIGNATURE_TYPE_MBR   0x01
1045
#define SIGNATURE_TYPE_GUID       0x02
1044
#define SIGNATURE_TYPE_GUID  0x02
1046
1045
1047
///
1046
///
1048
/// CD-ROM Media Device Path SubType.
1047
/// CD-ROM Media Device Path SubType.
1049
///
1048
///
1050
#define MEDIA_CDROM_DP            0x02
1049
#define MEDIA_CDROM_DP  0x02
1051
1050
1052
///
1051
///
1053
/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
1052
/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
1054
///
1053
///
1055
typedef struct {
1054
typedef struct {
1056
  EFI_DEVICE_PATH_PROTOCOL        Header;
1055
  EFI_DEVICE_PATH_PROTOCOL    Header;
1057
  ///
1056
  ///
1058
  /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
1057
  /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
1059
  ///
1058
  ///
1060
  UINT32                          BootEntry;
1059
  UINT32                      BootEntry;
1061
  ///
1060
  ///
1062
  /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
1061
  /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
1063
  ///
1062
  ///
1064
  UINT64                          PartitionStart;
1063
  UINT64                      PartitionStart;
1065
  ///
1064
  ///
1066
  /// Size of the partition in units of Blocks, also called Sectors.
1065
  /// Size of the partition in units of Blocks, also called Sectors.
1067
  ///
1066
  ///
1068
  UINT64                          PartitionSize;
1067
  UINT64                      PartitionSize;
1069
} CDROM_DEVICE_PATH;
1068
} CDROM_DEVICE_PATH;
1070
1069
1071
//
1070
//
1072
// Use VENDOR_DEVICE_PATH struct
1071
// Use VENDOR_DEVICE_PATH struct
1073
//
1072
//
1074
#define MEDIA_VENDOR_DP           0x03  ///< Media vendor device path subtype.
1073
#define MEDIA_VENDOR_DP  0x03           ///< Media vendor device path subtype.
1075
1074
1076
///
1075
///
1077
/// File Path Media Device Path SubType
1076
/// File Path Media Device Path SubType
1078
///
1077
///
1079
#define MEDIA_FILEPATH_DP         0x04
1078
#define MEDIA_FILEPATH_DP  0x04
1080
typedef struct {
1079
typedef struct {
1081
  EFI_DEVICE_PATH_PROTOCOL        Header;
1080
  EFI_DEVICE_PATH_PROTOCOL    Header;
1082
  ///
1081
  ///
1083
  /// A NULL-terminated Path string including directory and file names.
1082
  /// A NULL-terminated Path string including directory and file names.
1084
  ///
1083
  ///
1085
  CHAR16                          PathName[1];
1084
  CHAR16                      PathName[1];
1086
} FILEPATH_DEVICE_PATH;
1085
} FILEPATH_DEVICE_PATH;
1087
1086
1088
#define SIZE_OF_FILEPATH_DEVICE_PATH  OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
1087
#define SIZE_OF_FILEPATH_DEVICE_PATH  OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
Lines 1090-1096 typedef struct { Link Here
1090
///
1089
///
1091
/// Media Protocol Device Path SubType.
1090
/// Media Protocol Device Path SubType.
1092
///
1091
///
1093
#define MEDIA_PROTOCOL_DP         0x05
1092
#define MEDIA_PROTOCOL_DP  0x05
1094
1093
1095
///
1094
///
1096
/// The Media Protocol Device Path is used to denote the protocol that is being
1095
/// The Media Protocol Device Path is used to denote the protocol that is being
Lines 1098-1254 typedef struct { Link Here
1098
/// Many protocols are inherent to the style of device path.
1097
/// Many protocols are inherent to the style of device path.
1099
///
1098
///
1100
typedef struct {
1099
typedef struct {
1101
  EFI_DEVICE_PATH_PROTOCOL        Header;
1100
  EFI_DEVICE_PATH_PROTOCOL    Header;
1102
  ///
1101
  ///
1103
  /// The ID of the protocol.
1102
  /// The ID of the protocol.
1104
  ///
1103
  ///
1105
  EFI_GUID                        Protocol;
1104
  EFI_GUID                    Protocol;
1106
} MEDIA_PROTOCOL_DEVICE_PATH;
1105
} MEDIA_PROTOCOL_DEVICE_PATH;
1107
1106
1108
///
1107
///
1109
/// PIWG Firmware File SubType.
1108
/// PIWG Firmware File SubType.
1110
///
1109
///
1111
#define MEDIA_PIWG_FW_FILE_DP     0x06
1110
#define MEDIA_PIWG_FW_FILE_DP  0x06
1112
1111
1113
///
1112
///
1114
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
1113
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
1115
///
1114
///
1116
typedef struct {
1115
typedef struct {
1117
  EFI_DEVICE_PATH_PROTOCOL        Header;
1116
  EFI_DEVICE_PATH_PROTOCOL    Header;
1118
  ///
1117
  ///
1119
  /// Firmware file name
1118
  /// Firmware file name
1120
  ///
1119
  ///
1121
  EFI_GUID                        FvFileName;
1120
  EFI_GUID                    FvFileName;
1122
} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
1121
} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
1123
1122
1124
///
1123
///
1125
/// PIWG Firmware Volume Device Path SubType.
1124
/// PIWG Firmware Volume Device Path SubType.
1126
///
1125
///
1127
#define MEDIA_PIWG_FW_VOL_DP      0x07
1126
#define MEDIA_PIWG_FW_VOL_DP  0x07
1128
1127
1129
///
1128
///
1130
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
1129
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
1131
///
1130
///
1132
typedef struct {
1131
typedef struct {
1133
  EFI_DEVICE_PATH_PROTOCOL        Header;
1132
  EFI_DEVICE_PATH_PROTOCOL    Header;
1134
  ///
1133
  ///
1135
  /// Firmware volume name.
1134
  /// Firmware volume name.
1136
  ///
1135
  ///
1137
  EFI_GUID                        FvName;
1136
  EFI_GUID                    FvName;
1138
} MEDIA_FW_VOL_DEVICE_PATH;
1137
} MEDIA_FW_VOL_DEVICE_PATH;
1139
1138
1140
///
1139
///
1141
/// Media relative offset range device path.
1140
/// Media relative offset range device path.
1142
///
1141
///
1143
#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
1142
#define MEDIA_RELATIVE_OFFSET_RANGE_DP  0x08
1144
1143
1145
///
1144
///
1146
/// Used to describe the offset range of media relative.
1145
/// Used to describe the offset range of media relative.
1147
///
1146
///
1148
typedef struct {
1147
typedef struct {
1149
  EFI_DEVICE_PATH_PROTOCOL  Header;
1148
  EFI_DEVICE_PATH_PROTOCOL    Header;
1150
  UINT32                    Reserved;
1149
  UINT32                      Reserved;
1151
  UINT64                    StartingOffset;
1150
  UINT64                      StartingOffset;
1152
  UINT64                    EndingOffset;
1151
  UINT64                      EndingOffset;
1153
} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
1152
} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
1154
1153
1155
///
1154
///
1156
/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
1155
/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
1157
///
1156
///
1158
#define EFI_VIRTUAL_DISK_GUID               EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE
1157
#define EFI_VIRTUAL_DISK_GUID  EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE
1159
1158
1160
extern  EFI_GUID                            gEfiVirtualDiskGuid;
1159
extern  EFI_GUID  gEfiVirtualDiskGuid;
1161
1160
1162
///
1161
///
1163
/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
1162
/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
1164
///
1163
///
1165
#define EFI_VIRTUAL_CD_GUID                 EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE
1164
#define EFI_VIRTUAL_CD_GUID  EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE
1166
1165
1167
extern  EFI_GUID                            gEfiVirtualCdGuid;
1166
extern  EFI_GUID  gEfiVirtualCdGuid;
1168
1167
1169
///
1168
///
1170
/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
1169
/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
1171
///
1170
///
1172
#define EFI_PERSISTENT_VIRTUAL_DISK_GUID    EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT
1171
#define EFI_PERSISTENT_VIRTUAL_DISK_GUID  EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT
1173
1172
1174
extern  EFI_GUID                            gEfiPersistentVirtualDiskGuid;
1173
extern  EFI_GUID  gEfiPersistentVirtualDiskGuid;
1175
1174
1176
///
1175
///
1177
/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
1176
/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
1178
///
1177
///
1179
#define EFI_PERSISTENT_VIRTUAL_CD_GUID      EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT
1178
#define EFI_PERSISTENT_VIRTUAL_CD_GUID  EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT
1180
1179
1181
extern  EFI_GUID                            gEfiPersistentVirtualCdGuid;
1180
extern  EFI_GUID  gEfiPersistentVirtualCdGuid;
1182
1181
1183
///
1182
///
1184
/// Media ram disk device path.
1183
/// Media ram disk device path.
1185
///
1184
///
1186
#define MEDIA_RAM_DISK_DP         0x09
1185
#define MEDIA_RAM_DISK_DP  0x09
1187
1186
1188
///
1187
///
1189
/// Used to describe the ram disk device path.
1188
/// Used to describe the ram disk device path.
1190
///
1189
///
1191
typedef struct {
1190
typedef struct {
1192
  EFI_DEVICE_PATH_PROTOCOL        Header;
1191
  EFI_DEVICE_PATH_PROTOCOL    Header;
1193
  ///
1192
  ///
1194
  /// Starting Memory Address.
1193
  /// Starting Memory Address.
1195
  ///
1194
  ///
1196
  UINT32                          StartingAddr[2];
1195
  UINT32                      StartingAddr[2];
1197
  ///
1196
  ///
1198
  /// Ending Memory Address.
1197
  /// Ending Memory Address.
1199
  ///
1198
  ///
1200
  UINT32                          EndingAddr[2];
1199
  UINT32                      EndingAddr[2];
1201
  ///
1200
  ///
1202
  /// GUID that defines the type of the RAM Disk.
1201
  /// GUID that defines the type of the RAM Disk.
1203
  ///
1202
  ///
1204
  EFI_GUID                        TypeGuid;
1203
  EFI_GUID                    TypeGuid;
1205
  ///
1204
  ///
1206
  /// RAM Diskinstance number, if supported. The default value is zero.
1205
  /// RAM Diskinstance number, if supported. The default value is zero.
1207
  ///
1206
  ///
1208
  UINT16                          Instance;
1207
  UINT16                      Instance;
1209
} MEDIA_RAM_DISK_DEVICE_PATH;
1208
} MEDIA_RAM_DISK_DEVICE_PATH;
1210
1209
1211
///
1210
///
1212
/// BIOS Boot Specification Device Path.
1211
/// BIOS Boot Specification Device Path.
1213
///
1212
///
1214
#define BBS_DEVICE_PATH           0x05
1213
#define BBS_DEVICE_PATH  0x05
1215
1214
1216
///
1215
///
1217
/// BIOS Boot Specification Device Path SubType.
1216
/// BIOS Boot Specification Device Path SubType.
1218
///
1217
///
1219
#define BBS_BBS_DP                0x01
1218
#define BBS_BBS_DP  0x01
1220
1219
1221
///
1220
///
1222
/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
1221
/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
1223
///
1222
///
1224
typedef struct {
1223
typedef struct {
1225
  EFI_DEVICE_PATH_PROTOCOL        Header;
1224
  EFI_DEVICE_PATH_PROTOCOL    Header;
1226
  ///
1225
  ///
1227
  /// Device Type as defined by the BIOS Boot Specification.
1226
  /// Device Type as defined by the BIOS Boot Specification.
1228
  ///
1227
  ///
1229
  UINT16                          DeviceType;
1228
  UINT16                      DeviceType;
1230
  ///
1229
  ///
1231
  /// Status Flags as defined by the BIOS Boot Specification.
1230
  /// Status Flags as defined by the BIOS Boot Specification.
1232
  ///
1231
  ///
1233
  UINT16                          StatusFlag;
1232
  UINT16                      StatusFlag;
1234
  ///
1233
  ///
1235
  /// Null-terminated ASCII string that describes the boot device to a user.
1234
  /// Null-terminated ASCII string that describes the boot device to a user.
1236
  ///
1235
  ///
1237
  CHAR8                           String[1];
1236
  CHAR8                       String[1];
1238
} BBS_BBS_DEVICE_PATH;
1237
} BBS_BBS_DEVICE_PATH;
1239
1238
1240
//
1239
//
1241
// DeviceType definitions - from BBS specification
1240
// DeviceType definitions - from BBS specification
1242
//
1241
//
1243
#define BBS_TYPE_FLOPPY           0x01
1242
#define BBS_TYPE_FLOPPY            0x01
1244
#define BBS_TYPE_HARDDRIVE        0x02
1243
#define BBS_TYPE_HARDDRIVE         0x02
1245
#define BBS_TYPE_CDROM            0x03
1244
#define BBS_TYPE_CDROM             0x03
1246
#define BBS_TYPE_PCMCIA           0x04
1245
#define BBS_TYPE_PCMCIA            0x04
1247
#define BBS_TYPE_USB              0x05
1246
#define BBS_TYPE_USB               0x05
1248
#define BBS_TYPE_EMBEDDED_NETWORK 0x06
1247
#define BBS_TYPE_EMBEDDED_NETWORK  0x06
1249
#define BBS_TYPE_BEV              0x80
1248
#define BBS_TYPE_BEV               0x80
1250
#define BBS_TYPE_UNKNOWN          0xFF
1249
#define BBS_TYPE_UNKNOWN           0xFF
1251
1252
1250
1253
///
1251
///
1254
/// Union of all possible Device Paths and pointers to Device Paths.
1252
/// Union of all possible Device Paths and pointers to Device Paths.
Lines 1309-1316 typedef union { Link Here
1309
  BBS_BBS_DEVICE_PATH                        Bbs;
1307
  BBS_BBS_DEVICE_PATH                        Bbs;
1310
} EFI_DEV_PATH;
1308
} EFI_DEV_PATH;
1311
1309
1312
1313
1314
typedef union {
1310
typedef union {
1315
  EFI_DEVICE_PATH_PROTOCOL                   *DevPath;
1311
  EFI_DEVICE_PATH_PROTOCOL                   *DevPath;
1316
  PCI_DEVICE_PATH                            *Pci;
1312
  PCI_DEVICE_PATH                            *Pci;
Lines 1370-1379 typedef union { Link Here
1370
1366
1371
#pragma pack()
1367
#pragma pack()
1372
1368
1373
#define END_DEVICE_PATH_TYPE                 0x7f
1369
#define END_DEVICE_PATH_TYPE              0x7f
1374
#define END_ENTIRE_DEVICE_PATH_SUBTYPE       0xFF
1370
#define END_ENTIRE_DEVICE_PATH_SUBTYPE    0xFF
1375
#define END_INSTANCE_DEVICE_PATH_SUBTYPE     0x01
1371
#define END_INSTANCE_DEVICE_PATH_SUBTYPE  0x01
1376
1372
1377
extern EFI_GUID gEfiDevicePathProtocolGuid;
1373
extern EFI_GUID  gEfiDevicePathProtocolGuid;
1378
1374
1379
#endif
1375
#endif
(-)b/sys/contrib/edk2/Include/Protocol/DevicePathFromText.h (-6 / +5 lines)
Lines 30-41 Link Here
30
30
31
**/
31
**/
32
typedef
32
typedef
33
EFI_DEVICE_PATH_PROTOCOL*
33
EFI_DEVICE_PATH_PROTOCOL *
34
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE)(
34
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE)(
35
  IN CONST CHAR16                 *TextDeviceNode
35
  IN CONST CHAR16                 *TextDeviceNode
36
  );
36
  );
37
37
38
39
/**
38
/**
40
  Convert text to the binary representation of a device node.
39
  Convert text to the binary representation of a device node.
41
40
Lines 48-54 EFI_DEVICE_PATH_PROTOCOL* Link Here
48
47
49
**/
48
**/
50
typedef
49
typedef
51
EFI_DEVICE_PATH_PROTOCOL*
50
EFI_DEVICE_PATH_PROTOCOL *
52
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
51
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
53
  IN CONST CHAR16                 *TextDevicePath
52
  IN CONST CHAR16                 *TextDevicePath
54
  );
53
  );
Lines 57-66 EFI_DEVICE_PATH_PROTOCOL* Link Here
57
/// This protocol converts text to device paths and device nodes.
56
/// This protocol converts text to device paths and device nodes.
58
///
57
///
59
typedef struct {
58
typedef struct {
60
  EFI_DEVICE_PATH_FROM_TEXT_NODE  ConvertTextToDeviceNode;
59
  EFI_DEVICE_PATH_FROM_TEXT_NODE    ConvertTextToDeviceNode;
61
  EFI_DEVICE_PATH_FROM_TEXT_PATH  ConvertTextToDevicePath;
60
  EFI_DEVICE_PATH_FROM_TEXT_PATH    ConvertTextToDevicePath;
62
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
61
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
63
62
64
extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
63
extern EFI_GUID  gEfiDevicePathFromTextProtocolGuid;
65
64
66
#endif
65
#endif
(-)b/sys/contrib/edk2/Include/Protocol/DevicePathToText.h (-7 / +5 lines)
Lines 34-40 Link Here
34
34
35
**/
35
**/
36
typedef
36
typedef
37
CHAR16*
37
CHAR16 *
38
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)(
38
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)(
39
  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,
39
  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,
40
  IN BOOLEAN                          DisplayOnly,
40
  IN BOOLEAN                          DisplayOnly,
Lines 57-63 CHAR16* Link Here
57
57
58
**/
58
**/
59
typedef
59
typedef
60
CHAR16*
60
CHAR16 *
61
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)(
61
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)(
62
  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,
62
  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,
63
  IN BOOLEAN                          DisplayOnly,
63
  IN BOOLEAN                          DisplayOnly,
Lines 68-79 CHAR16* Link Here
68
/// This protocol converts device paths and device nodes to text.
68
/// This protocol converts device paths and device nodes to text.
69
///
69
///
70
typedef struct {
70
typedef struct {
71
  EFI_DEVICE_PATH_TO_TEXT_NODE        ConvertDeviceNodeToText;
71
  EFI_DEVICE_PATH_TO_TEXT_NODE    ConvertDeviceNodeToText;
72
  EFI_DEVICE_PATH_TO_TEXT_PATH        ConvertDevicePathToText;
72
  EFI_DEVICE_PATH_TO_TEXT_PATH    ConvertDevicePathToText;
73
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
73
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
74
74
75
extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
75
extern EFI_GUID  gEfiDevicePathToTextProtocolGuid;
76
76
77
#endif
77
#endif
78
79
(-)b/sys/contrib/edk2/Include/Protocol/DevicePathUtilities.h (-17 / +16 lines)
Lines 33-39 UINTN Link Here
33
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
33
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
34
  );
34
  );
35
35
36
37
/**
36
/**
38
  Create a duplicate of the specified path.
37
  Create a duplicate of the specified path.
39
38
Lines 44-50 UINTN Link Here
44
43
45
**/
44
**/
46
typedef
45
typedef
47
EFI_DEVICE_PATH_PROTOCOL*
46
EFI_DEVICE_PATH_PROTOCOL *
48
(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(
47
(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(
49
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
48
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
50
  );
49
  );
Lines 63-69 EFI_DEVICE_PATH_PROTOCOL* Link Here
63
62
64
**/
63
**/
65
typedef
64
typedef
66
EFI_DEVICE_PATH_PROTOCOL*
65
EFI_DEVICE_PATH_PROTOCOL *
67
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(
66
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(
68
  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
67
  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
69
  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
68
  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
Lines 83-89 EFI_DEVICE_PATH_PROTOCOL* Link Here
83
82
84
**/
83
**/
85
typedef
84
typedef
86
EFI_DEVICE_PATH_PROTOCOL*
85
EFI_DEVICE_PATH_PROTOCOL *
87
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(
86
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(
88
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
87
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
89
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
88
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
Lines 100-106 EFI_DEVICE_PATH_PROTOCOL* Link Here
100
99
101
**/
100
**/
102
typedef
101
typedef
103
EFI_DEVICE_PATH_PROTOCOL*
102
EFI_DEVICE_PATH_PROTOCOL *
104
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(
103
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(
105
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
104
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
106
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
105
  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
Lines 123-129 EFI_DEVICE_PATH_PROTOCOL* Link Here
123
122
124
**/
123
**/
125
typedef
124
typedef
126
EFI_DEVICE_PATH_PROTOCOL*
125
EFI_DEVICE_PATH_PROTOCOL *
127
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(
126
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(
128
  IN  OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePathInstance,
127
  IN  OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePathInstance,
129
  OUT UINTN                         *DevicePathInstanceSize
128
  OUT UINTN                         *DevicePathInstanceSize
Lines 145-156 EFI_DEVICE_PATH_PROTOCOL* Link Here
145
144
146
**/
145
**/
147
typedef
146
typedef
148
EFI_DEVICE_PATH_PROTOCOL*
147
EFI_DEVICE_PATH_PROTOCOL *
149
(EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE)(
148
(EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE)(
150
  IN UINT8                          NodeType,
149
  IN UINT8                          NodeType,
151
  IN UINT8                          NodeSubType,
150
  IN UINT8                          NodeSubType,
152
  IN UINT16                         NodeLength
151
  IN UINT16                         NodeLength
153
);
152
  );
154
153
155
/**
154
/**
156
  Returns whether a device path is multi-instance.
155
  Returns whether a device path is multi-instance.
Lines 171-186 BOOLEAN Link Here
171
/// This protocol is used to creates and manipulates device paths and device nodes.
170
/// This protocol is used to creates and manipulates device paths and device nodes.
172
///
171
///
173
typedef struct {
172
typedef struct {
174
  EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
173
  EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE    GetDevicePathSize;
175
  EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH      DuplicateDevicePath;
174
  EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH         DuplicateDevicePath;
176
  EFI_DEVICE_PATH_UTILS_APPEND_PATH          AppendDevicePath;
175
  EFI_DEVICE_PATH_UTILS_APPEND_PATH             AppendDevicePath;
177
  EFI_DEVICE_PATH_UTILS_APPEND_NODE          AppendDeviceNode;
176
  EFI_DEVICE_PATH_UTILS_APPEND_NODE             AppendDeviceNode;
178
  EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE      AppendDevicePathInstance;
177
  EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE         AppendDevicePathInstance;
179
  EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE    GetNextDevicePathInstance;
178
  EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE       GetNextDevicePathInstance;
180
  EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE    IsDevicePathMultiInstance;
179
  EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE       IsDevicePathMultiInstance;
181
  EFI_DEVICE_PATH_UTILS_CREATE_NODE          CreateDeviceNode;
180
  EFI_DEVICE_PATH_UTILS_CREATE_NODE             CreateDeviceNode;
182
} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
181
} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
183
182
184
extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
183
extern EFI_GUID  gEfiDevicePathUtilitiesProtocolGuid;
185
184
186
#endif
185
#endif
(-)b/sys/contrib/edk2/Include/Protocol/SimpleTextIn.h (-9 / +10 lines)
Lines 17-40 Link Here
17
    0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
17
    0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
18
  }
18
  }
19
19
20
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
20
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
21
21
22
///
22
///
23
/// Protocol GUID name defined in EFI1.1.
23
/// Protocol GUID name defined in EFI1.1.
24
///
24
///
25
#define SIMPLE_INPUT_PROTOCOL   EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
25
#define SIMPLE_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
26
26
27
///
27
///
28
/// Protocol name in EFI1.1 for backward-compatible.
28
/// Protocol name in EFI1.1 for backward-compatible.
29
///
29
///
30
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  SIMPLE_INPUT_INTERFACE;
30
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
31
31
32
///
32
///
33
/// The keystroke information for the key that was pressed.
33
/// The keystroke information for the key that was pressed.
34
///
34
///
35
typedef struct {
35
typedef struct {
36
  UINT16  ScanCode;
36
  UINT16    ScanCode;
37
  CHAR16  UnicodeChar;
37
  CHAR16    UnicodeChar;
38
} EFI_INPUT_KEY;
38
} EFI_INPUT_KEY;
39
39
40
//
40
//
Lines 100-105 EFI_STATUS Link Here
100
  @retval EFI_NOT_READY    There was no keystroke data available.
100
  @retval EFI_NOT_READY    There was no keystroke data available.
101
  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
101
  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
102
                           hardware errors.
102
                           hardware errors.
103
  @retval EFI_UNSUPPORTED  The device does not support the ability to read keystroke data.
103
104
104
**/
105
**/
105
typedef
106
typedef
Lines 114-127 EFI_STATUS Link Here
114
/// It is the minimum required protocol for ConsoleIn.
115
/// It is the minimum required protocol for ConsoleIn.
115
///
116
///
116
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
117
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
117
  EFI_INPUT_RESET     Reset;
118
  EFI_INPUT_RESET       Reset;
118
  EFI_INPUT_READ_KEY  ReadKeyStroke;
119
  EFI_INPUT_READ_KEY    ReadKeyStroke;
119
  ///
120
  ///
120
  /// Event to use with WaitForEvent() to wait for a key to be available
121
  /// Event to use with WaitForEvent() to wait for a key to be available
121
  ///
122
  ///
122
  EFI_EVENT           WaitForKey;
123
  EFI_EVENT             WaitForKey;
123
};
124
};
124
125
125
extern EFI_GUID gEfiSimpleTextInProtocolGuid;
126
extern EFI_GUID  gEfiSimpleTextInProtocolGuid;
126
127
127
#endif
128
#endif
(-)b/sys/contrib/edk2/Include/Protocol/SimpleTextInEx.h (-64 / +60 lines)
Lines 18-24 Link Here
18
#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
18
#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
19
  {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } }
19
  {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } }
20
20
21
22
typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
21
typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
23
22
24
/**
23
/**
Lines 51-58 EFI_STATUS Link Here
51
(EFIAPI *EFI_INPUT_RESET_EX)(
50
(EFIAPI *EFI_INPUT_RESET_EX)(
52
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
51
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
53
  IN BOOLEAN                           ExtendedVerification
52
  IN BOOLEAN                           ExtendedVerification
54
);
53
  );
55
56
54
57
///
55
///
58
/// EFI_KEY_TOGGLE_STATE. The toggle states are defined.
56
/// EFI_KEY_TOGGLE_STATE. The toggle states are defined.
Lines 68-92 typedef struct _EFI_KEY_STATE { Link Here
68
  /// returned value is valid only if the high
66
  /// returned value is valid only if the high
69
  /// order bit has been set.
67
  /// order bit has been set.
70
  ///
68
  ///
71
  UINT32                KeyShiftState;
69
  UINT32                  KeyShiftState;
72
  ///
70
  ///
73
  /// Reflects the current internal state of
71
  /// Reflects the current internal state of
74
  /// various toggled attributes. The returned
72
  /// various toggled attributes. The returned
75
  /// value is valid only if the high order
73
  /// value is valid only if the high order
76
  /// bit has been set.
74
  /// bit has been set.
77
  ///
75
  ///
78
  EFI_KEY_TOGGLE_STATE  KeyToggleState;
76
  EFI_KEY_TOGGLE_STATE    KeyToggleState;
79
} EFI_KEY_STATE;
77
} EFI_KEY_STATE;
80
78
81
typedef struct {
79
typedef struct {
82
  ///
80
  ///
83
  /// The EFI scan code and Unicode value returned from the input device.
81
  /// The EFI scan code and Unicode value returned from the input device.
84
  ///
82
  ///
85
  EFI_INPUT_KEY   Key;
83
  EFI_INPUT_KEY    Key;
86
  ///
84
  ///
87
  /// The current state of various toggled attributes as well as input modifier values.
85
  /// The current state of various toggled attributes as well as input modifier values.
88
  ///
86
  ///
89
  EFI_KEY_STATE   KeyState;
87
  EFI_KEY_STATE    KeyState;
90
} EFI_KEY_DATA;
88
} EFI_KEY_DATA;
91
89
92
//
90
//
Lines 95-149 typedef struct { Link Here
95
//
93
//
96
// Shift state
94
// Shift state
97
//
95
//
98
#define EFI_SHIFT_STATE_VALID     0x80000000
96
#define EFI_SHIFT_STATE_VALID      0x80000000
99
#define EFI_RIGHT_SHIFT_PRESSED   0x00000001
97
#define EFI_RIGHT_SHIFT_PRESSED    0x00000001
100
#define EFI_LEFT_SHIFT_PRESSED    0x00000002
98
#define EFI_LEFT_SHIFT_PRESSED     0x00000002
101
#define EFI_RIGHT_CONTROL_PRESSED 0x00000004
99
#define EFI_RIGHT_CONTROL_PRESSED  0x00000004
102
#define EFI_LEFT_CONTROL_PRESSED  0x00000008
100
#define EFI_LEFT_CONTROL_PRESSED   0x00000008
103
#define EFI_RIGHT_ALT_PRESSED     0x00000010
101
#define EFI_RIGHT_ALT_PRESSED      0x00000010
104
#define EFI_LEFT_ALT_PRESSED      0x00000020
102
#define EFI_LEFT_ALT_PRESSED       0x00000020
105
#define EFI_RIGHT_LOGO_PRESSED    0x00000040
103
#define EFI_RIGHT_LOGO_PRESSED     0x00000040
106
#define EFI_LEFT_LOGO_PRESSED     0x00000080
104
#define EFI_LEFT_LOGO_PRESSED      0x00000080
107
#define EFI_MENU_KEY_PRESSED      0x00000100
105
#define EFI_MENU_KEY_PRESSED       0x00000100
108
#define EFI_SYS_REQ_PRESSED       0x00000200
106
#define EFI_SYS_REQ_PRESSED        0x00000200
109
107
110
//
108
//
111
// Toggle state
109
// Toggle state
112
//
110
//
113
#define EFI_TOGGLE_STATE_VALID    0x80
111
#define EFI_TOGGLE_STATE_VALID  0x80
114
#define EFI_KEY_STATE_EXPOSED     0x40
112
#define EFI_KEY_STATE_EXPOSED   0x40
115
#define EFI_SCROLL_LOCK_ACTIVE    0x01
113
#define EFI_SCROLL_LOCK_ACTIVE  0x01
116
#define EFI_NUM_LOCK_ACTIVE       0x02
114
#define EFI_NUM_LOCK_ACTIVE     0x02
117
#define EFI_CAPS_LOCK_ACTIVE      0x04
115
#define EFI_CAPS_LOCK_ACTIVE    0x04
118
116
119
//
117
//
120
// EFI Scan codes
118
// EFI Scan codes
121
//
119
//
122
#define SCAN_F11                  0x0015
120
#define SCAN_F11              0x0015
123
#define SCAN_F12                  0x0016
121
#define SCAN_F12              0x0016
124
#define SCAN_PAUSE                0x0048
122
#define SCAN_PAUSE            0x0048
125
#define SCAN_F13                  0x0068
123
#define SCAN_F13              0x0068
126
#define SCAN_F14                  0x0069
124
#define SCAN_F14              0x0069
127
#define SCAN_F15                  0x006A
125
#define SCAN_F15              0x006A
128
#define SCAN_F16                  0x006B
126
#define SCAN_F16              0x006B
129
#define SCAN_F17                  0x006C
127
#define SCAN_F17              0x006C
130
#define SCAN_F18                  0x006D
128
#define SCAN_F18              0x006D
131
#define SCAN_F19                  0x006E
129
#define SCAN_F19              0x006E
132
#define SCAN_F20                  0x006F
130
#define SCAN_F20              0x006F
133
#define SCAN_F21                  0x0070
131
#define SCAN_F21              0x0070
134
#define SCAN_F22                  0x0071
132
#define SCAN_F22              0x0071
135
#define SCAN_F23                  0x0072
133
#define SCAN_F23              0x0072
136
#define SCAN_F24                  0x0073
134
#define SCAN_F24              0x0073
137
#define SCAN_MUTE                 0x007F
135
#define SCAN_MUTE             0x007F
138
#define SCAN_VOLUME_UP            0x0080
136
#define SCAN_VOLUME_UP        0x0080
139
#define SCAN_VOLUME_DOWN          0x0081
137
#define SCAN_VOLUME_DOWN      0x0081
140
#define SCAN_BRIGHTNESS_UP        0x0100
138
#define SCAN_BRIGHTNESS_UP    0x0100
141
#define SCAN_BRIGHTNESS_DOWN      0x0101
139
#define SCAN_BRIGHTNESS_DOWN  0x0101
142
#define SCAN_SUSPEND              0x0102
140
#define SCAN_SUSPEND          0x0102
143
#define SCAN_HIBERNATE            0x0103
141
#define SCAN_HIBERNATE        0x0103
144
#define SCAN_TOGGLE_DISPLAY       0x0104
142
#define SCAN_TOGGLE_DISPLAY   0x0104
145
#define SCAN_RECOVERY             0x0105
143
#define SCAN_RECOVERY         0x0105
146
#define SCAN_EJECT                0x0106
144
#define SCAN_EJECT            0x0106
147
145
148
/**
146
/**
149
  The function reads the next keystroke from the input device. If
147
  The function reads the next keystroke from the input device. If
Lines 188-193 typedef struct { Link Here
188
  @retval EFI_NOT_READY    There was no keystroke data available.
186
  @retval EFI_NOT_READY    There was no keystroke data available.
189
  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
187
  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
190
                           hardware errors.
188
                           hardware errors.
189
  @retval EFI_UNSUPPORTED  The device does not support the ability to read keystroke data.
191
190
192
191
193
**/
192
**/
Lines 196-202 EFI_STATUS Link Here
196
(EFIAPI *EFI_INPUT_READ_KEY_EX)(
195
(EFIAPI *EFI_INPUT_READ_KEY_EX)(
197
  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
196
  IN  EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
198
  OUT EFI_KEY_DATA                      *KeyData
197
  OUT EFI_KEY_DATA                      *KeyData
199
);
198
  );
200
199
201
/**
200
/**
202
  The SetState() function allows the input device hardware to
201
  The SetState() function allows the input device hardware to
Lines 223-229 EFI_STATUS Link Here
223
(EFIAPI *EFI_SET_STATE)(
222
(EFIAPI *EFI_SET_STATE)(
224
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
223
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
225
  IN EFI_KEY_TOGGLE_STATE              *KeyToggleState
224
  IN EFI_KEY_TOGGLE_STATE              *KeyToggleState
226
);
225
  );
227
226
228
///
227
///
229
/// The function will be called when the key sequence is typed specified by KeyData.
228
/// The function will be called when the key sequence is typed specified by KeyData.
Lines 232-238 typedef Link Here
232
EFI_STATUS
231
EFI_STATUS
233
(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(
232
(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)(
234
  IN EFI_KEY_DATA *KeyData
233
  IN EFI_KEY_DATA *KeyData
235
);
234
  );
236
235
237
/**
236
/**
238
  The RegisterKeystrokeNotify() function registers a function
237
  The RegisterKeystrokeNotify() function registers a function
Lines 267-273 EFI_STATUS Link Here
267
  IN  EFI_KEY_DATA                      *KeyData,
266
  IN  EFI_KEY_DATA                      *KeyData,
268
  IN  EFI_KEY_NOTIFY_FUNCTION           KeyNotificationFunction,
267
  IN  EFI_KEY_NOTIFY_FUNCTION           KeyNotificationFunction,
269
  OUT VOID                              **NotifyHandle
268
  OUT VOID                              **NotifyHandle
270
);
269
  );
271
270
272
/**
271
/**
273
  The UnregisterKeystrokeNotify() function removes the
272
  The UnregisterKeystrokeNotify() function removes the
Lines 289-296 EFI_STATUS Link Here
289
(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
288
(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)(
290
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
289
  IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,
291
  IN VOID                               *NotificationHandle
290
  IN VOID                               *NotificationHandle
292
);
291
  );
293
294
292
295
///
293
///
296
/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn
294
/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn
Lines 298-317 EFI_STATUS Link Here
298
/// which allows a variety of extended shift state information to be
296
/// which allows a variety of extended shift state information to be
299
/// returned.
297
/// returned.
300
///
298
///
301
struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{
299
struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
302
  EFI_INPUT_RESET_EX              Reset;
300
  EFI_INPUT_RESET_EX                 Reset;
303
  EFI_INPUT_READ_KEY_EX           ReadKeyStrokeEx;
301
  EFI_INPUT_READ_KEY_EX              ReadKeyStrokeEx;
304
  ///
302
  ///
305
  /// Event to use with WaitForEvent() to wait for a key to be available.
303
  /// Event to use with WaitForEvent() to wait for a key to be available.
306
  ///
304
  ///
307
  EFI_EVENT                       WaitForKeyEx;
305
  EFI_EVENT                          WaitForKeyEx;
308
  EFI_SET_STATE                   SetState;
306
  EFI_SET_STATE                      SetState;
309
  EFI_REGISTER_KEYSTROKE_NOTIFY   RegisterKeyNotify;
307
  EFI_REGISTER_KEYSTROKE_NOTIFY      RegisterKeyNotify;
310
  EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
308
  EFI_UNREGISTER_KEYSTROKE_NOTIFY    UnregisterKeyNotify;
311
};
309
};
312
310
313
311
extern EFI_GUID  gEfiSimpleTextInputExProtocolGuid;
314
extern EFI_GUID gEfiSimpleTextInputExProtocolGuid;
315
312
316
#endif
313
#endif
317
(-)b/sys/contrib/edk2/Include/Protocol/SimpleTextOut.h (-48 / +48 lines)
Lines 22-38 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
22
///
22
///
23
/// Protocol GUID defined in EFI1.1.
23
/// Protocol GUID defined in EFI1.1.
24
///
24
///
25
#define SIMPLE_TEXT_OUTPUT_PROTOCOL   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
25
#define SIMPLE_TEXT_OUTPUT_PROTOCOL  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
26
26
27
typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
27
typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
28
28
29
///
29
///
30
/// Backward-compatible with EFI1.1.
30
/// Backward-compatible with EFI1.1.
31
///
31
///
32
typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
32
typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE;
33
33
34
//
34
//
35
// Define's for required EFI Unicode Box Draw characters
35
// Defines for required EFI Unicode Box Draw characters
36
//
36
//
37
#define BOXDRAW_HORIZONTAL                  0x2500
37
#define BOXDRAW_HORIZONTAL                  0x2500
38
#define BOXDRAW_VERTICAL                    0x2502
38
#define BOXDRAW_VERTICAL                    0x2502
Lines 84-122 typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE; Link Here
84
//
84
//
85
// EFI Required Geometric Shapes Code Chart
85
// EFI Required Geometric Shapes Code Chart
86
//
86
//
87
#define GEOMETRICSHAPE_UP_TRIANGLE    0x25b2
87
#define GEOMETRICSHAPE_UP_TRIANGLE     0x25b2
88
#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
88
#define GEOMETRICSHAPE_RIGHT_TRIANGLE  0x25ba
89
#define GEOMETRICSHAPE_DOWN_TRIANGLE  0x25bc
89
#define GEOMETRICSHAPE_DOWN_TRIANGLE   0x25bc
90
#define GEOMETRICSHAPE_LEFT_TRIANGLE  0x25c4
90
#define GEOMETRICSHAPE_LEFT_TRIANGLE   0x25c4
91
91
92
//
92
//
93
// EFI Required Arrow shapes
93
// EFI Required Arrow shapes
94
//
94
//
95
#define ARROW_LEFT  0x2190
95
#define ARROW_LEFT   0x2190
96
#define ARROW_UP    0x2191
96
#define ARROW_UP     0x2191
97
#define ARROW_RIGHT 0x2192
97
#define ARROW_RIGHT  0x2192
98
#define ARROW_DOWN  0x2193
98
#define ARROW_DOWN   0x2193
99
99
100
//
100
//
101
// EFI Console Colours
101
// EFI Console Colours
102
//
102
//
103
#define EFI_BLACK                 0x00
103
#define EFI_BLACK         0x00
104
#define EFI_BLUE                  0x01
104
#define EFI_BLUE          0x01
105
#define EFI_GREEN                 0x02
105
#define EFI_GREEN         0x02
106
#define EFI_CYAN                  (EFI_BLUE | EFI_GREEN)
106
#define EFI_CYAN          (EFI_BLUE | EFI_GREEN)
107
#define EFI_RED                   0x04
107
#define EFI_RED           0x04
108
#define EFI_MAGENTA               (EFI_BLUE | EFI_RED)
108
#define EFI_MAGENTA       (EFI_BLUE | EFI_RED)
109
#define EFI_BROWN                 (EFI_GREEN | EFI_RED)
109
#define EFI_BROWN         (EFI_GREEN | EFI_RED)
110
#define EFI_LIGHTGRAY             (EFI_BLUE | EFI_GREEN | EFI_RED)
110
#define EFI_LIGHTGRAY     (EFI_BLUE | EFI_GREEN | EFI_RED)
111
#define EFI_BRIGHT                0x08
111
#define EFI_BRIGHT        0x08
112
#define EFI_DARKGRAY              (EFI_BLACK | EFI_BRIGHT)
112
#define EFI_DARKGRAY      (EFI_BLACK | EFI_BRIGHT)
113
#define EFI_LIGHTBLUE             (EFI_BLUE | EFI_BRIGHT)
113
#define EFI_LIGHTBLUE     (EFI_BLUE | EFI_BRIGHT)
114
#define EFI_LIGHTGREEN            (EFI_GREEN | EFI_BRIGHT)
114
#define EFI_LIGHTGREEN    (EFI_GREEN | EFI_BRIGHT)
115
#define EFI_LIGHTCYAN             (EFI_CYAN | EFI_BRIGHT)
115
#define EFI_LIGHTCYAN     (EFI_CYAN | EFI_BRIGHT)
116
#define EFI_LIGHTRED              (EFI_RED | EFI_BRIGHT)
116
#define EFI_LIGHTRED      (EFI_RED | EFI_BRIGHT)
117
#define EFI_LIGHTMAGENTA          (EFI_MAGENTA | EFI_BRIGHT)
117
#define EFI_LIGHTMAGENTA  (EFI_MAGENTA | EFI_BRIGHT)
118
#define EFI_YELLOW                (EFI_BROWN | EFI_BRIGHT)
118
#define EFI_YELLOW        (EFI_BROWN | EFI_BRIGHT)
119
#define EFI_WHITE                 (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
119
#define EFI_WHITE         (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
120
120
121
//
121
//
122
// Macro to accept color values in their raw form to create
122
// Macro to accept color values in their raw form to create
Lines 129-135 typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE; Link Here
129
//
129
//
130
// Do not use EFI_BACKGROUND_xxx values with this macro.
130
// Do not use EFI_BACKGROUND_xxx values with this macro.
131
//
131
//
132
#define EFI_TEXT_ATTR(Foreground,Background) ((Foreground) | ((Background) << 4))
132
#define EFI_TEXT_ATTR(Foreground, Background)  ((Foreground) | ((Background) << 4))
133
133
134
#define EFI_BACKGROUND_BLACK      0x00
134
#define EFI_BACKGROUND_BLACK      0x00
135
#define EFI_BACKGROUND_BLUE       0x10
135
#define EFI_BACKGROUND_BLUE       0x10
Lines 151-157 typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE; Link Here
151
#define EFI_WIDE_ATTRIBUTE  0x80
151
#define EFI_WIDE_ATTRIBUTE  0x80
152
152
153
/**
153
/**
154
  Reset the text output device hardware and optionaly run diagnostics
154
  Reset the text output device hardware and optionally run diagnostics
155
155
156
  @param  This                 The protocol instance pointer.
156
  @param  This                 The protocol instance pointer.
157
  @param  ExtendedVerification Driver may perform more exhaustive verification
157
  @param  ExtendedVerification Driver may perform more exhaustive verification
Lines 350-356 typedef struct { Link Here
350
  ///
350
  ///
351
  /// The number of modes supported by QueryMode () and SetMode ().
351
  /// The number of modes supported by QueryMode () and SetMode ().
352
  ///
352
  ///
353
  INT32   MaxMode;
353
  INT32    MaxMode;
354
354
355
  //
355
  //
356
  // current settings
356
  // current settings
Lines 359-381 typedef struct { Link Here
359
  ///
359
  ///
360
  /// The text mode of the output device(s).
360
  /// The text mode of the output device(s).
361
  ///
361
  ///
362
  INT32   Mode;
362
  INT32      Mode;
363
  ///
363
  ///
364
  /// The current character output attribute.
364
  /// The current character output attribute.
365
  ///
365
  ///
366
  INT32   Attribute;
366
  INT32      Attribute;
367
  ///
367
  ///
368
  /// The cursor's column.
368
  /// The cursor's column.
369
  ///
369
  ///
370
  INT32   CursorColumn;
370
  INT32      CursorColumn;
371
  ///
371
  ///
372
  /// The cursor's row.
372
  /// The cursor's row.
373
  ///
373
  ///
374
  INT32   CursorRow;
374
  INT32      CursorRow;
375
  ///
375
  ///
376
  /// The cursor is currently visbile or not.
376
  /// The cursor is currently visible or not.
377
  ///
377
  ///
378
  BOOLEAN CursorVisible;
378
  BOOLEAN    CursorVisible;
379
} EFI_SIMPLE_TEXT_OUTPUT_MODE;
379
} EFI_SIMPLE_TEXT_OUTPUT_MODE;
380
380
381
///
381
///
Lines 385-409 typedef struct { Link Here
385
/// devices is at least 80 x 25 characters.
385
/// devices is at least 80 x 25 characters.
386
///
386
///
387
struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
387
struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
388
  EFI_TEXT_RESET                Reset;
388
  EFI_TEXT_RESET                  Reset;
389
389
390
  EFI_TEXT_STRING               OutputString;
390
  EFI_TEXT_STRING                 OutputString;
391
  EFI_TEXT_TEST_STRING          TestString;
391
  EFI_TEXT_TEST_STRING            TestString;
392
392
393
  EFI_TEXT_QUERY_MODE           QueryMode;
393
  EFI_TEXT_QUERY_MODE             QueryMode;
394
  EFI_TEXT_SET_MODE             SetMode;
394
  EFI_TEXT_SET_MODE               SetMode;
395
  EFI_TEXT_SET_ATTRIBUTE        SetAttribute;
395
  EFI_TEXT_SET_ATTRIBUTE          SetAttribute;
396
396
397
  EFI_TEXT_CLEAR_SCREEN         ClearScreen;
397
  EFI_TEXT_CLEAR_SCREEN           ClearScreen;
398
  EFI_TEXT_SET_CURSOR_POSITION  SetCursorPosition;
398
  EFI_TEXT_SET_CURSOR_POSITION    SetCursorPosition;
399
  EFI_TEXT_ENABLE_CURSOR        EnableCursor;
399
  EFI_TEXT_ENABLE_CURSOR          EnableCursor;
400
400
401
  ///
401
  ///
402
  /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
402
  /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
403
  ///
403
  ///
404
  EFI_SIMPLE_TEXT_OUTPUT_MODE   *Mode;
404
  EFI_SIMPLE_TEXT_OUTPUT_MODE     *Mode;
405
};
405
};
406
406
407
extern EFI_GUID gEfiSimpleTextOutProtocolGuid;
407
extern EFI_GUID  gEfiSimpleTextOutProtocolGuid;
408
408
409
#endif
409
#endif
(-)b/sys/contrib/edk2/Include/Uefi.h (-1 lines)
Lines 18-21 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
18
#include <Uefi/UefiSpec.h>
18
#include <Uefi/UefiSpec.h>
19
19
20
#endif
20
#endif
21
(-)b/sys/contrib/edk2/Include/Uefi/UefiBaseType.h (-59 / +86 lines)
Lines 1-9 Link Here
1
/** @file
1
/** @file
2
  Defines data types and constants introduced in UEFI.
2
  Defines data types and constants introduced in UEFI.
3
3
4
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
4
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
5
Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
5
Portions copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
6
Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
6
Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
7
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
7
8
8
SPDX-License-Identifier: BSD-2-Clause-Patent
9
SPDX-License-Identifier: BSD-2-Clause-Patent
9
10
Lines 21-57 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
21
///
22
///
22
/// 128-bit buffer containing a unique identifier value.
23
/// 128-bit buffer containing a unique identifier value.
23
///
24
///
24
typedef GUID                      EFI_GUID;
25
typedef GUID EFI_GUID;
25
///
26
///
26
/// Function return status for EFI API.
27
/// Function return status for EFI API.
27
///
28
///
28
typedef RETURN_STATUS             EFI_STATUS;
29
typedef RETURN_STATUS EFI_STATUS;
29
///
30
///
30
/// A collection of related interfaces.
31
/// A collection of related interfaces.
31
///
32
///
32
typedef VOID                      *EFI_HANDLE;
33
typedef VOID *EFI_HANDLE;
33
///
34
///
34
/// Handle to an event structure.
35
/// Handle to an event structure.
35
///
36
///
36
typedef VOID                      *EFI_EVENT;
37
typedef VOID *EFI_EVENT;
37
///
38
///
38
/// Task priority level.
39
/// Task priority level.
39
///
40
///
40
typedef UINTN                     EFI_TPL;
41
typedef UINTN EFI_TPL;
41
///
42
///
42
/// Logical block address.
43
/// Logical block address.
43
///
44
///
44
typedef UINT64                    EFI_LBA;
45
typedef UINT64 EFI_LBA;
45
46
46
///
47
///
47
/// 64-bit physical memory address.
48
/// 64-bit physical memory address.
48
///
49
///
49
typedef UINT64                    EFI_PHYSICAL_ADDRESS;
50
typedef UINT64 EFI_PHYSICAL_ADDRESS;
50
51
51
///
52
///
52
/// 64-bit virtual memory address.
53
/// 64-bit virtual memory address.
53
///
54
///
54
typedef UINT64                    EFI_VIRTUAL_ADDRESS;
55
typedef UINT64 EFI_VIRTUAL_ADDRESS;
55
56
56
///
57
///
57
/// EFI Time Abstraction:
58
/// EFI Time Abstraction:
Lines 65-84 typedef UINT64 EFI_VIRTUAL_ADDRESS; Link Here
65
///  TimeZone:   -1440 to 1440 or 2047
66
///  TimeZone:   -1440 to 1440 or 2047
66
///
67
///
67
typedef struct {
68
typedef struct {
68
  UINT16  Year;
69
  UINT16    Year;
69
  UINT8   Month;
70
  UINT8     Month;
70
  UINT8   Day;
71
  UINT8     Day;
71
  UINT8   Hour;
72
  UINT8     Hour;
72
  UINT8   Minute;
73
  UINT8     Minute;
73
  UINT8   Second;
74
  UINT8     Second;
74
  UINT8   Pad1;
75
  UINT8     Pad1;
75
  UINT32  Nanosecond;
76
  UINT32    Nanosecond;
76
  INT16   TimeZone;
77
  INT16     TimeZone;
77
  UINT8   Daylight;
78
  UINT8     Daylight;
78
  UINT8   Pad2;
79
  UINT8     Pad2;
79
} EFI_TIME;
80
} EFI_TIME;
80
81
81
82
///
82
///
83
/// 4-byte buffer. An IPv4 internet protocol address.
83
/// 4-byte buffer. An IPv4 internet protocol address.
84
///
84
///
Lines 93-99 typedef IPv6_ADDRESS EFI_IPv6_ADDRESS; Link Here
93
/// 32-byte buffer containing a network Media Access Control address.
93
/// 32-byte buffer containing a network Media Access Control address.
94
///
94
///
95
typedef struct {
95
typedef struct {
96
  UINT8 Addr[32];
96
  UINT8    Addr[32];
97
} EFI_MAC_ADDRESS;
97
} EFI_MAC_ADDRESS;
98
98
99
///
99
///
Lines 101-112 typedef struct { Link Here
101
/// An IPv4 or IPv6 internet protocol address.
101
/// An IPv4 or IPv6 internet protocol address.
102
///
102
///
103
typedef union {
103
typedef union {
104
  UINT32            Addr[4];
104
  UINT32              Addr[4];
105
  EFI_IPv4_ADDRESS  v4;
105
  EFI_IPv4_ADDRESS    v4;
106
  EFI_IPv6_ADDRESS  v6;
106
  EFI_IPv6_ADDRESS    v6;
107
} EFI_IP_ADDRESS;
107
} EFI_IP_ADDRESS;
108
108
109
110
///
109
///
111
/// Enumeration of EFI_STATUS.
110
/// Enumeration of EFI_STATUS.
112
///@{
111
///@{
Lines 142-163 typedef union { Link Here
142
#define EFI_END_OF_FILE           RETURN_END_OF_FILE
141
#define EFI_END_OF_FILE           RETURN_END_OF_FILE
143
#define EFI_INVALID_LANGUAGE      RETURN_INVALID_LANGUAGE
142
#define EFI_INVALID_LANGUAGE      RETURN_INVALID_LANGUAGE
144
#define EFI_COMPROMISED_DATA      RETURN_COMPROMISED_DATA
143
#define EFI_COMPROMISED_DATA      RETURN_COMPROMISED_DATA
144
#define EFI_IP_ADDRESS_CONFLICT   RETURN_IP_ADDRESS_CONFLICT
145
#define EFI_HTTP_ERROR            RETURN_HTTP_ERROR
145
#define EFI_HTTP_ERROR            RETURN_HTTP_ERROR
146
146
147
#define EFI_WARN_UNKNOWN_GLYPH    RETURN_WARN_UNKNOWN_GLYPH
147
#define EFI_WARN_UNKNOWN_GLYPH     RETURN_WARN_UNKNOWN_GLYPH
148
#define EFI_WARN_DELETE_FAILURE   RETURN_WARN_DELETE_FAILURE
148
#define EFI_WARN_DELETE_FAILURE    RETURN_WARN_DELETE_FAILURE
149
#define EFI_WARN_WRITE_FAILURE    RETURN_WARN_WRITE_FAILURE
149
#define EFI_WARN_WRITE_FAILURE     RETURN_WARN_WRITE_FAILURE
150
#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
150
#define EFI_WARN_BUFFER_TOO_SMALL  RETURN_WARN_BUFFER_TOO_SMALL
151
#define EFI_WARN_STALE_DATA       RETURN_WARN_STALE_DATA
151
#define EFI_WARN_STALE_DATA        RETURN_WARN_STALE_DATA
152
#define EFI_WARN_FILE_SYSTEM      RETURN_WARN_FILE_SYSTEM
152
#define EFI_WARN_FILE_SYSTEM       RETURN_WARN_FILE_SYSTEM
153
#define EFI_WARN_RESET_REQUIRED    RETURN_WARN_RESET_REQUIRED
153
///@}
154
///@}
154
155
155
///
156
///
156
/// Define macro to encode the status code.
157
/// Define macro to encode the status code.
157
///
158
///
158
#define EFIERR(_a)                ENCODE_ERROR(_a)
159
#define EFIERR(_a)  ENCODE_ERROR(_a)
159
160
160
#define EFI_ERROR(A)              RETURN_ERROR(A)
161
#define EFI_ERROR(A)  RETURN_ERROR(A)
161
162
162
///
163
///
163
/// ICMP error definitions
164
/// ICMP error definitions
Lines 171-179 typedef union { Link Here
171
///
172
///
172
/// Tcp connection status definitions
173
/// Tcp connection status definitions
173
///@{
174
///@{
174
#define EFI_CONNECTION_FIN        EFIERR(104)
175
#define EFI_CONNECTION_FIN      EFIERR(104)
175
#define EFI_CONNECTION_RESET      EFIERR(105)
176
#define EFI_CONNECTION_RESET    EFIERR(105)
176
#define EFI_CONNECTION_REFUSED    EFIERR(106)
177
#define EFI_CONNECTION_REFUSED  EFIERR(106)
177
///@}
178
///@}
178
179
179
//
180
//
Lines 181-189 typedef union { Link Here
181
// 4KB. This should in no way be confused with the page size of the processor.
182
// 4KB. This should in no way be confused with the page size of the processor.
182
// An EFI_PAGE is just the quanta of memory in EFI.
183
// An EFI_PAGE is just the quanta of memory in EFI.
183
//
184
//
184
#define EFI_PAGE_SIZE             SIZE_4KB
185
#define EFI_PAGE_SIZE   SIZE_4KB
185
#define EFI_PAGE_MASK             0xFFF
186
#define EFI_PAGE_MASK   0xFFF
186
#define EFI_PAGE_SHIFT            12
187
#define EFI_PAGE_SHIFT  12
187
188
188
/**
189
/**
189
  Macro that converts a size, in bytes, to a number of EFI_PAGESs.
190
  Macro that converts a size, in bytes, to a number of EFI_PAGESs.
Lines 214-235 typedef union { Link Here
214
///
215
///
215
/// PE32+ Machine type for IA32 UEFI images.
216
/// PE32+ Machine type for IA32 UEFI images.
216
///
217
///
217
#define EFI_IMAGE_MACHINE_IA32            0x014C
218
#define EFI_IMAGE_MACHINE_IA32  0x014C
218
219
219
///
220
///
220
/// PE32+ Machine type for IA64 UEFI images.
221
/// PE32+ Machine type for IA64 UEFI images.
221
///
222
///
222
#define EFI_IMAGE_MACHINE_IA64            0x0200
223
#define EFI_IMAGE_MACHINE_IA64  0x0200
223
224
224
///
225
///
225
/// PE32+ Machine type for EBC UEFI images.
226
/// PE32+ Machine type for EBC UEFI images.
226
///
227
///
227
#define EFI_IMAGE_MACHINE_EBC             0x0EBC
228
#define EFI_IMAGE_MACHINE_EBC  0x0EBC
228
229
229
///
230
///
230
/// PE32+ Machine type for X64 UEFI images.
231
/// PE32+ Machine type for X64 UEFI images.
231
///
232
///
232
#define EFI_IMAGE_MACHINE_X64             0x8664
233
#define EFI_IMAGE_MACHINE_X64  0x8664
233
234
234
///
235
///
235
/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images.
236
/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images.
Lines 248-298 typedef union { Link Here
248
#define EFI_IMAGE_MACHINE_RISCV64   0x5064
249
#define EFI_IMAGE_MACHINE_RISCV64   0x5064
249
#define EFI_IMAGE_MACHINE_RISCV128  0x5128
250
#define EFI_IMAGE_MACHINE_RISCV128  0x5128
250
251
251
#if   defined (MDE_CPU_IA32)
252
///
253
/// PE32+ Machine type for LoongArch 32/64 images.
254
///
255
#define EFI_IMAGE_MACHINE_LOONGARCH32  0x6232
256
#define EFI_IMAGE_MACHINE_LOONGARCH64  0x6264
257
258
#if !defined (EFI_IMAGE_MACHINE_TYPE_VALUE) && !defined (EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
259
  #if   defined (MDE_CPU_IA32)
252
260
253
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
261
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
254
  ((Machine) == EFI_IMAGE_MACHINE_IA32)
262
  ((Machine) == EFI_IMAGE_MACHINE_IA32)
255
263
256
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64)
264
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_X64)
257
265
258
#elif defined (MDE_CPU_X64)
266
  #elif defined (MDE_CPU_X64)
259
267
260
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
268
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
261
  ((Machine) == EFI_IMAGE_MACHINE_X64)
269
  ((Machine) == EFI_IMAGE_MACHINE_X64)
262
270
263
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
271
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_IA32)
264
272
265
#elif defined (MDE_CPU_ARM)
273
  #elif defined (MDE_CPU_ARM)
266
274
267
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
275
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
268
276
269
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
277
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
270
278
271
#elif defined (MDE_CPU_AARCH64)
279
  #elif defined (MDE_CPU_AARCH64)
272
280
273
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
281
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
274
  ((Machine) == EFI_IMAGE_MACHINE_AARCH64)
282
  ((Machine) == EFI_IMAGE_MACHINE_AARCH64)
275
283
276
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
284
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
277
285
278
#elif defined (MDE_CPU_RISCV64)
286
  #elif defined (MDE_CPU_RISCV64)
279
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
287
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
280
  ((Machine) == EFI_IMAGE_MACHINE_RISCV64)
288
  ((Machine) == EFI_IMAGE_MACHINE_RISCV64)
281
289
282
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
290
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
291
292
  #elif defined (MDE_CPU_LOONGARCH64)
293
294
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
295
    ((Machine) == EFI_IMAGE_MACHINE_LOONGARCH64)
296
297
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
283
298
284
#elif defined (MDE_CPU_EBC)
299
  #elif defined (MDE_CPU_EBC)
285
300
286
///
301
///
287
/// This is just to make sure you can cross compile with the EBC compiler.
302
/// This is just to make sure you can cross compile with the EBC compiler.
288
/// It does not make sense to have a PE loader coded in EBC.
303
/// It does not make sense to have a PE loader coded in EBC.
289
///
304
///
290
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)
305
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_EBC)
291
306
292
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
307
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
293
308
309
  #else
310
    #error Unknown Processor Type
311
  #endif
294
#else
312
#else
295
#error Unknown Processor Type
313
  #if defined (EFI_IMAGE_MACHINE_TYPE_VALUE)
314
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_TYPE_VALUE)
315
  #else
316
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine)  (FALSE)
317
  #endif
318
  #if defined (EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
319
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  ((Machine) == EFI_IMAGE_MACHINE_CROSS_TYPE_VALUE)
320
  #else
321
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine)  (FALSE)
322
  #endif
296
#endif
323
#endif
297
324
298
#endif
325
#endif
(-)b/sys/contrib/edk2/Include/Uefi/UefiGpt.h (-19 / +17 lines)
Lines 13-27 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
13
/// The primary GUID Partition Table Header must be
13
/// The primary GUID Partition Table Header must be
14
/// located in LBA 1 (i.e., the second logical block).
14
/// located in LBA 1 (i.e., the second logical block).
15
///
15
///
16
#define PRIMARY_PART_HEADER_LBA 1
16
#define PRIMARY_PART_HEADER_LBA  1
17
///
17
///
18
/// EFI Partition Table Signature: "EFI PART".
18
/// EFI Partition Table Signature: "EFI PART".
19
///
19
///
20
#define EFI_PTAB_HEADER_ID      SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
20
#define EFI_PTAB_HEADER_ID  SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
21
///
21
///
22
/// Minimum bytes reserve for EFI entry array buffer.
22
/// Minimum bytes reserve for EFI entry array buffer.
23
///
23
///
24
#define EFI_GPT_PART_ENTRY_MIN_SIZE 16384
24
#define EFI_GPT_PART_ENTRY_MIN_SIZE  16384
25
25
26
#pragma pack(1)
26
#pragma pack(1)
27
27
Lines 33-83 typedef struct { Link Here
33
  /// The table header for the GPT partition Table.
33
  /// The table header for the GPT partition Table.
34
  /// This header contains EFI_PTAB_HEADER_ID.
34
  /// This header contains EFI_PTAB_HEADER_ID.
35
  ///
35
  ///
36
  EFI_TABLE_HEADER  Header;
36
  EFI_TABLE_HEADER    Header;
37
  ///
37
  ///
38
  /// The LBA that contains this data structure.
38
  /// The LBA that contains this data structure.
39
  ///
39
  ///
40
  EFI_LBA           MyLBA;
40
  EFI_LBA             MyLBA;
41
  ///
41
  ///
42
  /// LBA address of the alternate GUID Partition Table Header.
42
  /// LBA address of the alternate GUID Partition Table Header.
43
  ///
43
  ///
44
  EFI_LBA           AlternateLBA;
44
  EFI_LBA             AlternateLBA;
45
  ///
45
  ///
46
  /// The first usable logical block that may be used
46
  /// The first usable logical block that may be used
47
  /// by a partition described by a GUID Partition Entry.
47
  /// by a partition described by a GUID Partition Entry.
48
  ///
48
  ///
49
  EFI_LBA           FirstUsableLBA;
49
  EFI_LBA             FirstUsableLBA;
50
  ///
50
  ///
51
  /// The last usable logical block that may be used
51
  /// The last usable logical block that may be used
52
  /// by a partition described by a GUID Partition Entry.
52
  /// by a partition described by a GUID Partition Entry.
53
  ///
53
  ///
54
  EFI_LBA           LastUsableLBA;
54
  EFI_LBA             LastUsableLBA;
55
  ///
55
  ///
56
  /// GUID that can be used to uniquely identify the disk.
56
  /// GUID that can be used to uniquely identify the disk.
57
  ///
57
  ///
58
  EFI_GUID          DiskGUID;
58
  EFI_GUID            DiskGUID;
59
  ///
59
  ///
60
  /// The starting LBA of the GUID Partition Entry array.
60
  /// The starting LBA of the GUID Partition Entry array.
61
  ///
61
  ///
62
  EFI_LBA           PartitionEntryLBA;
62
  EFI_LBA             PartitionEntryLBA;
63
  ///
63
  ///
64
  /// The number of Partition Entries in the GUID Partition Entry array.
64
  /// The number of Partition Entries in the GUID Partition Entry array.
65
  ///
65
  ///
66
  UINT32            NumberOfPartitionEntries;
66
  UINT32              NumberOfPartitionEntries;
67
  ///
67
  ///
68
  /// The size, in bytes, of each the GUID Partition
68
  /// The size, in bytes, of each the GUID Partition
69
  /// Entry structures in the GUID Partition Entry
69
  /// Entry structures in the GUID Partition Entry
70
  /// array. This field shall be set to a value of 128 x 2^n where n is
70
  /// array. This field shall be set to a value of 128 x 2^n where n is
71
  /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.).
71
  /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.).
72
  ///
72
  ///
73
  UINT32            SizeOfPartitionEntry;
73
  UINT32              SizeOfPartitionEntry;
74
  ///
74
  ///
75
  /// The CRC32 of the GUID Partition Entry array.
75
  /// The CRC32 of the GUID Partition Entry array.
76
  /// Starts at PartitionEntryLBA and is
76
  /// Starts at PartitionEntryLBA and is
77
  /// computed over a byte length of
77
  /// computed over a byte length of
78
  /// NumberOfPartitionEntries * SizeOfPartitionEntry.
78
  /// NumberOfPartitionEntries * SizeOfPartitionEntry.
79
  ///
79
  ///
80
  UINT32            PartitionEntryArrayCRC32;
80
  UINT32              PartitionEntryArrayCRC32;
81
} EFI_PARTITION_TABLE_HEADER;
81
} EFI_PARTITION_TABLE_HEADER;
82
82
83
///
83
///
Lines 88-108 typedef struct { Link Here
88
  /// Unique ID that defines the purpose and type of this Partition. A value of
88
  /// Unique ID that defines the purpose and type of this Partition. A value of
89
  /// zero defines that this partition entry is not being used.
89
  /// zero defines that this partition entry is not being used.
90
  ///
90
  ///
91
  EFI_GUID  PartitionTypeGUID;
91
  EFI_GUID    PartitionTypeGUID;
92
  ///
92
  ///
93
  /// GUID that is unique for every partition entry. Every partition ever
93
  /// GUID that is unique for every partition entry. Every partition ever
94
  /// created will have a unique GUID.
94
  /// created will have a unique GUID.
95
  /// This GUID must be assigned when the GUID Partition Entry is created.
95
  /// This GUID must be assigned when the GUID Partition Entry is created.
96
  ///
96
  ///
97
  EFI_GUID  UniquePartitionGUID;
97
  EFI_GUID    UniquePartitionGUID;
98
  ///
98
  ///
99
  /// Starting LBA of the partition defined by this entry
99
  /// Starting LBA of the partition defined by this entry
100
  ///
100
  ///
101
  EFI_LBA   StartingLBA;
101
  EFI_LBA     StartingLBA;
102
  ///
102
  ///
103
  /// Ending LBA of the partition defined by this entry.
103
  /// Ending LBA of the partition defined by this entry.
104
  ///
104
  ///
105
  EFI_LBA   EndingLBA;
105
  EFI_LBA     EndingLBA;
106
  ///
106
  ///
107
  /// Attribute bits, all bits reserved by UEFI
107
  /// Attribute bits, all bits reserved by UEFI
108
  /// Bit 0:      If this bit is set, the partition is required for the platform to function. The owner/creator of the
108
  /// Bit 0:      If this bit is set, the partition is required for the platform to function. The owner/creator of the
Lines 135-139 typedef struct { Link Here
135
135
136
#pragma pack()
136
#pragma pack()
137
#endif
137
#endif
138
139
(-)b/sys/contrib/edk2/Include/Uefi/UefiInternalFormRepresentation.h (-737 / +743 lines)
Lines 20-27 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
20
///
20
///
21
/// The following types are currently defined:
21
/// The following types are currently defined:
22
///
22
///
23
typedef VOID*   EFI_HII_HANDLE;
23
typedef VOID    *EFI_HII_HANDLE;
24
typedef CHAR16* EFI_STRING;
24
typedef CHAR16  *EFI_STRING;
25
typedef UINT16  EFI_IMAGE_ID;
25
typedef UINT16  EFI_IMAGE_ID;
26
typedef UINT16  EFI_QUESTION_ID;
26
typedef UINT16  EFI_QUESTION_ID;
27
typedef UINT16  EFI_STRING_ID;
27
typedef UINT16  EFI_STRING_ID;
Lines 29-39 typedef UINT16 EFI_FORM_ID; Link Here
29
typedef UINT16  EFI_VARSTORE_ID;
29
typedef UINT16  EFI_VARSTORE_ID;
30
typedef UINT16  EFI_ANIMATION_ID;
30
typedef UINT16  EFI_ANIMATION_ID;
31
31
32
typedef UINT16  EFI_DEFAULT_ID;
32
typedef UINT16 EFI_DEFAULT_ID;
33
34
typedef UINT32  EFI_HII_FONT_STYLE;
35
36
33
34
typedef UINT32 EFI_HII_FONT_STYLE;
37
35
38
#pragma pack(1)
36
#pragma pack(1)
39
37
Lines 46-80 typedef UINT32 EFI_HII_FONT_STYLE; Link Here
46
/// The header found at the start of each package list.
44
/// The header found at the start of each package list.
47
///
45
///
48
typedef struct {
46
typedef struct {
49
  EFI_GUID               PackageListGuid;
47
  EFI_GUID    PackageListGuid;
50
  UINT32                 PackageLength;
48
  UINT32      PackageLength;
51
} EFI_HII_PACKAGE_LIST_HEADER;
49
} EFI_HII_PACKAGE_LIST_HEADER;
52
50
53
///
51
///
54
/// The header found at the start of each package.
52
/// The header found at the start of each package.
55
///
53
///
56
typedef struct {
54
typedef struct {
57
  UINT32  Length:24;
55
  UINT32    Length : 24;
58
  UINT32  Type:8;
56
  UINT32    Type   : 8;
59
  // UINT8  Data[...];
57
  // UINT8  Data[...];
60
} EFI_HII_PACKAGE_HEADER;
58
} EFI_HII_PACKAGE_HEADER;
61
59
62
//
60
//
63
// Value of HII package type
61
// Value of HII package type
64
//
62
//
65
#define EFI_HII_PACKAGE_TYPE_ALL             0x00
63
#define EFI_HII_PACKAGE_TYPE_ALL           0x00
66
#define EFI_HII_PACKAGE_TYPE_GUID            0x01
64
#define EFI_HII_PACKAGE_TYPE_GUID          0x01
67
#define EFI_HII_PACKAGE_FORMS                0x02
65
#define EFI_HII_PACKAGE_FORMS              0x02
68
#define EFI_HII_PACKAGE_STRINGS              0x04
66
#define EFI_HII_PACKAGE_STRINGS            0x04
69
#define EFI_HII_PACKAGE_FONTS                0x05
67
#define EFI_HII_PACKAGE_FONTS              0x05
70
#define EFI_HII_PACKAGE_IMAGES               0x06
68
#define EFI_HII_PACKAGE_IMAGES             0x06
71
#define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07
69
#define EFI_HII_PACKAGE_SIMPLE_FONTS       0x07
72
#define EFI_HII_PACKAGE_DEVICE_PATH          0x08
70
#define EFI_HII_PACKAGE_DEVICE_PATH        0x08
73
#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x09
71
#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT    0x09
74
#define EFI_HII_PACKAGE_ANIMATIONS           0x0A
72
#define EFI_HII_PACKAGE_ANIMATIONS         0x0A
75
#define EFI_HII_PACKAGE_END                  0xDF
73
#define EFI_HII_PACKAGE_END                0xDF
76
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0
74
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN  0xE0
77
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF
75
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END    0xFF
78
76
79
//
77
//
80
// Definitions for Simplified Font Package
78
// Definitions for Simplified Font Package
Lines 83-92 typedef struct { Link Here
83
///
81
///
84
/// Contents of EFI_NARROW_GLYPH.Attributes.
82
/// Contents of EFI_NARROW_GLYPH.Attributes.
85
///@{
83
///@{
86
#define EFI_GLYPH_NON_SPACING                0x01
84
#define EFI_GLYPH_NON_SPACING  0x01
87
#define EFI_GLYPH_WIDE                       0x02
85
#define EFI_GLYPH_WIDE         0x02
88
#define EFI_GLYPH_HEIGHT                     19
86
#define EFI_GLYPH_HEIGHT       19
89
#define EFI_GLYPH_WIDTH                      8
87
#define EFI_GLYPH_WIDTH        8
90
///@}
88
///@}
91
89
92
///
90
///
Lines 97-113 typedef struct { Link Here
97
  /// The Unicode representation of the glyph. The term weight is the
95
  /// The Unicode representation of the glyph. The term weight is the
98
  /// technical term for a character code.
96
  /// technical term for a character code.
99
  ///
97
  ///
100
  CHAR16                 UnicodeWeight;
98
  CHAR16    UnicodeWeight;
101
  ///
99
  ///
102
  /// The data element containing the glyph definitions.
100
  /// The data element containing the glyph definitions.
103
  ///
101
  ///
104
  UINT8                  Attributes;
102
  UINT8     Attributes;
105
  ///
103
  ///
106
  /// The column major glyph representation of the character. Bits
104
  /// The column major glyph representation of the character. Bits
107
  /// with values of one indicate that the corresponding pixel is to be
105
  /// with values of one indicate that the corresponding pixel is to be
108
  /// on when normally displayed; those with zero are off.
106
  /// on when normally displayed; those with zero are off.
109
  ///
107
  ///
110
  UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
108
  UINT8     GlyphCol1[EFI_GLYPH_HEIGHT];
111
} EFI_NARROW_GLYPH;
109
} EFI_NARROW_GLYPH;
112
110
113
///
111
///
Lines 119-147 typedef struct { Link Here
119
  /// The Unicode representation of the glyph. The term weight is the
117
  /// The Unicode representation of the glyph. The term weight is the
120
  /// technical term for a character code.
118
  /// technical term for a character code.
121
  ///
119
  ///
122
  CHAR16                 UnicodeWeight;
120
  CHAR16    UnicodeWeight;
123
  ///
121
  ///
124
  /// The data element containing the glyph definitions.
122
  /// The data element containing the glyph definitions.
125
  ///
123
  ///
126
  UINT8                  Attributes;
124
  UINT8     Attributes;
127
  ///
125
  ///
128
  /// The column major glyph representation of the character. Bits
126
  /// The column major glyph representation of the character. Bits
129
  /// with values of one indicate that the corresponding pixel is to be
127
  /// with values of one indicate that the corresponding pixel is to be
130
  /// on when normally displayed; those with zero are off.
128
  /// on when normally displayed; those with zero are off.
131
  ///
129
  ///
132
  UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
130
  UINT8     GlyphCol1[EFI_GLYPH_HEIGHT];
133
  ///
131
  ///
134
  /// The column major glyph representation of the character. Bits
132
  /// The column major glyph representation of the character. Bits
135
  /// with values of one indicate that the corresponding pixel is to be
133
  /// with values of one indicate that the corresponding pixel is to be
136
  /// on when normally displayed; those with zero are off.
134
  /// on when normally displayed; those with zero are off.
137
  ///
135
  ///
138
  UINT8                  GlyphCol2[EFI_GLYPH_HEIGHT];
136
  UINT8     GlyphCol2[EFI_GLYPH_HEIGHT];
139
  ///
137
  ///
140
  /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the
138
  /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the
141
  /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must
139
  /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must
142
  /// be zero.
140
  /// be zero.
143
  ///
141
  ///
144
  UINT8                  Pad[3];
142
  UINT8     Pad[3];
145
} EFI_WIDE_GLYPH;
143
} EFI_WIDE_GLYPH;
146
144
147
///
145
///
Lines 149-157 typedef struct { Link Here
149
/// followed by a series of glyph structures.
147
/// followed by a series of glyph structures.
150
///
148
///
151
typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
149
typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
152
  EFI_HII_PACKAGE_HEADER Header;
150
  EFI_HII_PACKAGE_HEADER    Header;
153
  UINT16                 NumberOfNarrowGlyphs;
151
  UINT16                    NumberOfNarrowGlyphs;
154
  UINT16                 NumberOfWideGlyphs;
152
  UINT16                    NumberOfWideGlyphs;
155
  // EFI_NARROW_GLYPH       NarrowGlyphs[];
153
  // EFI_NARROW_GLYPH       NarrowGlyphs[];
156
  // EFI_WIDE_GLYPH         WideGlyphs[];
154
  // EFI_WIDE_GLYPH         WideGlyphs[];
157
} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
155
} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
Lines 164-184 typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR { Link Here
164
//
162
//
165
// Value for font style
163
// Value for font style
166
//
164
//
167
#define EFI_HII_FONT_STYLE_NORMAL            0x00000000
165
#define EFI_HII_FONT_STYLE_NORMAL     0x00000000
168
#define EFI_HII_FONT_STYLE_BOLD              0x00000001
166
#define EFI_HII_FONT_STYLE_BOLD       0x00000001
169
#define EFI_HII_FONT_STYLE_ITALIC            0x00000002
167
#define EFI_HII_FONT_STYLE_ITALIC     0x00000002
170
#define EFI_HII_FONT_STYLE_EMBOSS            0x00010000
168
#define EFI_HII_FONT_STYLE_EMBOSS     0x00010000
171
#define EFI_HII_FONT_STYLE_OUTLINE           0x00020000
169
#define EFI_HII_FONT_STYLE_OUTLINE    0x00020000
172
#define EFI_HII_FONT_STYLE_SHADOW            0x00040000
170
#define EFI_HII_FONT_STYLE_SHADOW     0x00040000
173
#define EFI_HII_FONT_STYLE_UNDERLINE         0x00080000
171
#define EFI_HII_FONT_STYLE_UNDERLINE  0x00080000
174
#define EFI_HII_FONT_STYLE_DBL_UNDER         0x00100000
172
#define EFI_HII_FONT_STYLE_DBL_UNDER  0x00100000
175
173
176
typedef struct _EFI_HII_GLYPH_INFO {
174
typedef struct _EFI_HII_GLYPH_INFO {
177
  UINT16                 Width;
175
  UINT16    Width;
178
  UINT16                 Height;
176
  UINT16    Height;
179
  INT16                  OffsetX;
177
  INT16     OffsetX;
180
  INT16                  OffsetY;
178
  INT16     OffsetY;
181
  INT16                  AdvanceX;
179
  INT16     AdvanceX;
182
} EFI_HII_GLYPH_INFO;
180
} EFI_HII_GLYPH_INFO;
183
181
184
///
182
///
Lines 188-220 typedef struct _EFI_HII_GLYPH_INFO { Link Here
188
/// information, the glyph bitmaps and the character map.
186
/// information, the glyph bitmaps and the character map.
189
///
187
///
190
typedef struct _EFI_HII_FONT_PACKAGE_HDR {
188
typedef struct _EFI_HII_FONT_PACKAGE_HDR {
191
  EFI_HII_PACKAGE_HEADER Header;
189
  EFI_HII_PACKAGE_HEADER    Header;
192
  UINT32                 HdrSize;
190
  UINT32                    HdrSize;
193
  UINT32                 GlyphBlockOffset;
191
  UINT32                    GlyphBlockOffset;
194
  EFI_HII_GLYPH_INFO     Cell;
192
  EFI_HII_GLYPH_INFO        Cell;
195
  EFI_HII_FONT_STYLE     FontStyle;
193
  EFI_HII_FONT_STYLE        FontStyle;
196
  CHAR16                 FontFamily[1];
194
  CHAR16                    FontFamily[1];
197
} EFI_HII_FONT_PACKAGE_HDR;
195
} EFI_HII_FONT_PACKAGE_HDR;
198
196
199
//
197
//
200
// Value of different glyph info block types
198
// Value of different glyph info block types
201
//
199
//
202
#define EFI_HII_GIBT_END                  0x00
200
#define EFI_HII_GIBT_END                0x00
203
#define EFI_HII_GIBT_GLYPH                0x10
201
#define EFI_HII_GIBT_GLYPH              0x10
204
#define EFI_HII_GIBT_GLYPHS               0x11
202
#define EFI_HII_GIBT_GLYPHS             0x11
205
#define EFI_HII_GIBT_GLYPH_DEFAULT        0x12
203
#define EFI_HII_GIBT_GLYPH_DEFAULT      0x12
206
#define EFI_HII_GIBT_GLYPHS_DEFAULT       0x13
204
#define EFI_HII_GIBT_GLYPHS_DEFAULT     0x13
207
#define EFI_HII_GIBT_GLYPH_VARIABILITY    0x14
205
#define EFI_HII_GIBT_GLYPH_VARIABILITY  0x14
208
#define EFI_HII_GIBT_DUPLICATE            0x20
206
#define EFI_HII_GIBT_DUPLICATE          0x20
209
#define EFI_HII_GIBT_SKIP2                0x21
207
#define EFI_HII_GIBT_SKIP2              0x21
210
#define EFI_HII_GIBT_SKIP1                0x22
208
#define EFI_HII_GIBT_SKIP1              0x22
211
#define EFI_HII_GIBT_DEFAULTS             0x23
209
#define EFI_HII_GIBT_DEFAULTS           0x23
212
#define EFI_HII_GIBT_EXT1                 0x30
210
#define EFI_HII_GIBT_EXT1               0x30
213
#define EFI_HII_GIBT_EXT2                 0x31
211
#define EFI_HII_GIBT_EXT2               0x31
214
#define EFI_HII_GIBT_EXT4                 0x32
212
#define EFI_HII_GIBT_EXT4               0x32
215
213
216
typedef struct _EFI_HII_GLYPH_BLOCK {
214
typedef struct _EFI_HII_GLYPH_BLOCK {
217
  UINT8                  BlockType;
215
  UINT8    BlockType;
218
} EFI_HII_GLYPH_BLOCK;
216
} EFI_HII_GLYPH_BLOCK;
219
217
220
//
218
//
Lines 281-287 typedef struct _EFI_HII_GIBT_VARIABILITY_BLOCK { Link Here
281
  EFI_HII_GLYPH_BLOCK    Header;
279
  EFI_HII_GLYPH_BLOCK    Header;
282
  EFI_HII_GLYPH_INFO     Cell;
280
  EFI_HII_GLYPH_INFO     Cell;
283
  UINT8                  GlyphPackInBits;
281
  UINT8                  GlyphPackInBits;
284
  UINT8                  BitmapData [1];
282
  UINT8                  BitmapData[1];
285
} EFI_HII_GIBT_VARIABILITY_BLOCK;
283
} EFI_HII_GIBT_VARIABILITY_BLOCK;
286
284
287
typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
285
typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
Lines 304-310 typedef struct _EFI_HII_GIBT_SKIP2_BLOCK { Link Here
304
/// associated with the package list.
302
/// associated with the package list.
305
///
303
///
306
typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR {
304
typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR {
307
  EFI_HII_PACKAGE_HEADER   Header;
305
  EFI_HII_PACKAGE_HEADER    Header;
308
  // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
306
  // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
309
} EFI_HII_DEVICE_PATH_PACKAGE_HDR;
307
} EFI_HII_DEVICE_PATH_PACKAGE_HDR;
310
308
Lines 317-324 typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR { Link Here
317
/// The GUID package is used to carry data where the format is defined by a GUID.
315
/// The GUID package is used to carry data where the format is defined by a GUID.
318
///
316
///
319
typedef struct _EFI_HII_GUID_PACKAGE_HDR {
317
typedef struct _EFI_HII_GUID_PACKAGE_HDR {
320
  EFI_HII_PACKAGE_HEADER  Header;
318
  EFI_HII_PACKAGE_HEADER    Header;
321
  EFI_GUID                Guid;
319
  EFI_GUID                  Guid;
322
  // Data per GUID definition may follow
320
  // Data per GUID definition may follow
323
} EFI_HII_GUID_PACKAGE_HDR;
321
} EFI_HII_GUID_PACKAGE_HDR;
324
322
Lines 327-371 typedef struct _EFI_HII_GUID_PACKAGE_HDR { Link Here
327
// Section 27.3.6
325
// Section 27.3.6
328
//
326
//
329
327
330
#define UEFI_CONFIG_LANG   "x-UEFI"
328
#define UEFI_CONFIG_LANG    "x-UEFI"
331
#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
329
#define UEFI_CONFIG_LANG_2  "x-i-UEFI"
332
330
333
///
331
///
334
/// The fixed header consists of a standard record header and then the string identifiers
332
/// The fixed header consists of a standard record header and then the string identifiers
335
/// contained in this section and the offsets of the string and language information.
333
/// contained in this section and the offsets of the string and language information.
336
///
334
///
337
typedef struct _EFI_HII_STRING_PACKAGE_HDR {
335
typedef struct _EFI_HII_STRING_PACKAGE_HDR {
338
  EFI_HII_PACKAGE_HEADER  Header;
336
  EFI_HII_PACKAGE_HEADER    Header;
339
  UINT32                  HdrSize;
337
  UINT32                    HdrSize;
340
  UINT32                  StringInfoOffset;
338
  UINT32                    StringInfoOffset;
341
  CHAR16                  LanguageWindow[16];
339
  CHAR16                    LanguageWindow[16];
342
  EFI_STRING_ID           LanguageName;
340
  EFI_STRING_ID             LanguageName;
343
  CHAR8                   Language[1];
341
  CHAR8                     Language[1];
344
} EFI_HII_STRING_PACKAGE_HDR;
342
} EFI_HII_STRING_PACKAGE_HDR;
345
343
346
typedef struct {
344
typedef struct {
347
  UINT8                   BlockType;
345
  UINT8    BlockType;
348
} EFI_HII_STRING_BLOCK;
346
} EFI_HII_STRING_BLOCK;
349
347
350
//
348
//
351
// Value of different string information block types
349
// Value of different string information block types
352
//
350
//
353
#define EFI_HII_SIBT_END                     0x00
351
#define EFI_HII_SIBT_END                0x00
354
#define EFI_HII_SIBT_STRING_SCSU             0x10
352
#define EFI_HII_SIBT_STRING_SCSU        0x10
355
#define EFI_HII_SIBT_STRING_SCSU_FONT        0x11
353
#define EFI_HII_SIBT_STRING_SCSU_FONT   0x11
356
#define EFI_HII_SIBT_STRINGS_SCSU            0x12
354
#define EFI_HII_SIBT_STRINGS_SCSU       0x12
357
#define EFI_HII_SIBT_STRINGS_SCSU_FONT       0x13
355
#define EFI_HII_SIBT_STRINGS_SCSU_FONT  0x13
358
#define EFI_HII_SIBT_STRING_UCS2             0x14
356
#define EFI_HII_SIBT_STRING_UCS2        0x14
359
#define EFI_HII_SIBT_STRING_UCS2_FONT        0x15
357
#define EFI_HII_SIBT_STRING_UCS2_FONT   0x15
360
#define EFI_HII_SIBT_STRINGS_UCS2            0x16
358
#define EFI_HII_SIBT_STRINGS_UCS2       0x16
361
#define EFI_HII_SIBT_STRINGS_UCS2_FONT       0x17
359
#define EFI_HII_SIBT_STRINGS_UCS2_FONT  0x17
362
#define EFI_HII_SIBT_DUPLICATE               0x20
360
#define EFI_HII_SIBT_DUPLICATE          0x20
363
#define EFI_HII_SIBT_SKIP2                   0x21
361
#define EFI_HII_SIBT_SKIP2              0x21
364
#define EFI_HII_SIBT_SKIP1                   0x22
362
#define EFI_HII_SIBT_SKIP1              0x22
365
#define EFI_HII_SIBT_EXT1                    0x30
363
#define EFI_HII_SIBT_EXT1               0x30
366
#define EFI_HII_SIBT_EXT2                    0x31
364
#define EFI_HII_SIBT_EXT2               0x31
367
#define EFI_HII_SIBT_EXT4                    0x32
365
#define EFI_HII_SIBT_EXT4               0x32
368
#define EFI_HII_SIBT_FONT                    0x40
366
#define EFI_HII_SIBT_FONT               0x40
369
367
370
//
368
//
371
// Definition of different string information block types
369
// Definition of different string information block types
Lines 399-409 typedef struct _EFI_HII_SIBT_EXT4_BLOCK { Link Here
399
} EFI_HII_SIBT_EXT4_BLOCK;
397
} EFI_HII_SIBT_EXT4_BLOCK;
400
398
401
typedef struct _EFI_HII_SIBT_FONT_BLOCK {
399
typedef struct _EFI_HII_SIBT_FONT_BLOCK {
402
  EFI_HII_SIBT_EXT2_BLOCK Header;
400
  EFI_HII_SIBT_EXT2_BLOCK    Header;
403
  UINT8                   FontId;
401
  UINT8                      FontId;
404
  UINT16                  FontSize;
402
  UINT16                     FontSize;
405
  EFI_HII_FONT_STYLE      FontStyle;
403
  EFI_HII_FONT_STYLE         FontStyle;
406
  CHAR16                  FontName[1];
404
  CHAR16                     FontName[1];
407
} EFI_HII_SIBT_FONT_BLOCK;
405
} EFI_HII_SIBT_FONT_BLOCK;
408
406
409
typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
407
typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
Lines 470-632 typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK { Link Here
470
//
468
//
471
469
472
typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
470
typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
473
  EFI_HII_PACKAGE_HEADER  Header;
471
  EFI_HII_PACKAGE_HEADER    Header;
474
  UINT32                  ImageInfoOffset;
472
  UINT32                    ImageInfoOffset;
475
  UINT32                  PaletteInfoOffset;
473
  UINT32                    PaletteInfoOffset;
476
} EFI_HII_IMAGE_PACKAGE_HDR;
474
} EFI_HII_IMAGE_PACKAGE_HDR;
477
475
478
typedef struct _EFI_HII_IMAGE_BLOCK {
476
typedef struct _EFI_HII_IMAGE_BLOCK {
479
  UINT8                   BlockType;
477
  UINT8    BlockType;
480
} EFI_HII_IMAGE_BLOCK;
478
} EFI_HII_IMAGE_BLOCK;
481
479
482
//
480
//
483
// Value of different image information block types
481
// Value of different image information block types
484
//
482
//
485
#define EFI_HII_IIBT_END               0x00
483
#define EFI_HII_IIBT_END                0x00
486
#define EFI_HII_IIBT_IMAGE_1BIT        0x10
484
#define EFI_HII_IIBT_IMAGE_1BIT         0x10
487
#define EFI_HII_IIBT_IMAGE_1BIT_TRANS  0x11
485
#define EFI_HII_IIBT_IMAGE_1BIT_TRANS   0x11
488
#define EFI_HII_IIBT_IMAGE_4BIT        0x12
486
#define EFI_HII_IIBT_IMAGE_4BIT         0x12
489
#define EFI_HII_IIBT_IMAGE_4BIT_TRANS  0x13
487
#define EFI_HII_IIBT_IMAGE_4BIT_TRANS   0x13
490
#define EFI_HII_IIBT_IMAGE_8BIT        0x14
488
#define EFI_HII_IIBT_IMAGE_8BIT         0x14
491
#define EFI_HII_IIBT_IMAGE_8BIT_TRANS  0x15
489
#define EFI_HII_IIBT_IMAGE_8BIT_TRANS   0x15
492
#define EFI_HII_IIBT_IMAGE_24BIT       0x16
490
#define EFI_HII_IIBT_IMAGE_24BIT        0x16
493
#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17
491
#define EFI_HII_IIBT_IMAGE_24BIT_TRANS  0x17
494
#define EFI_HII_IIBT_IMAGE_JPEG        0x18
492
#define EFI_HII_IIBT_IMAGE_JPEG         0x18
495
#define EFI_HII_IIBT_IMAGE_PNG         0x19
493
#define EFI_HII_IIBT_IMAGE_PNG          0x19
496
#define EFI_HII_IIBT_DUPLICATE         0x20
494
#define EFI_HII_IIBT_DUPLICATE          0x20
497
#define EFI_HII_IIBT_SKIP2             0x21
495
#define EFI_HII_IIBT_SKIP2              0x21
498
#define EFI_HII_IIBT_SKIP1             0x22
496
#define EFI_HII_IIBT_SKIP1              0x22
499
#define EFI_HII_IIBT_EXT1              0x30
497
#define EFI_HII_IIBT_EXT1               0x30
500
#define EFI_HII_IIBT_EXT2              0x31
498
#define EFI_HII_IIBT_EXT2               0x31
501
#define EFI_HII_IIBT_EXT4              0x32
499
#define EFI_HII_IIBT_EXT4               0x32
502
500
503
//
501
//
504
// Definition of different image information block types
502
// Definition of different image information block types
505
//
503
//
506
504
507
typedef struct _EFI_HII_IIBT_END_BLOCK {
505
typedef struct _EFI_HII_IIBT_END_BLOCK {
508
  EFI_HII_IMAGE_BLOCK          Header;
506
  EFI_HII_IMAGE_BLOCK    Header;
509
} EFI_HII_IIBT_END_BLOCK;
507
} EFI_HII_IIBT_END_BLOCK;
510
508
511
typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
509
typedef struct _EFI_HII_IIBT_EXT1_BLOCK {
512
  EFI_HII_IMAGE_BLOCK          Header;
510
  EFI_HII_IMAGE_BLOCK    Header;
513
  UINT8                        BlockType2;
511
  UINT8                  BlockType2;
514
  UINT8                        Length;
512
  UINT8                  Length;
515
} EFI_HII_IIBT_EXT1_BLOCK;
513
} EFI_HII_IIBT_EXT1_BLOCK;
516
514
517
typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
515
typedef struct _EFI_HII_IIBT_EXT2_BLOCK {
518
  EFI_HII_IMAGE_BLOCK          Header;
516
  EFI_HII_IMAGE_BLOCK    Header;
519
  UINT8                        BlockType2;
517
  UINT8                  BlockType2;
520
  UINT16                       Length;
518
  UINT16                 Length;
521
} EFI_HII_IIBT_EXT2_BLOCK;
519
} EFI_HII_IIBT_EXT2_BLOCK;
522
520
523
typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
521
typedef struct _EFI_HII_IIBT_EXT4_BLOCK {
524
  EFI_HII_IMAGE_BLOCK          Header;
522
  EFI_HII_IMAGE_BLOCK    Header;
525
  UINT8                        BlockType2;
523
  UINT8                  BlockType2;
526
  UINT32                       Length;
524
  UINT32                 Length;
527
} EFI_HII_IIBT_EXT4_BLOCK;
525
} EFI_HII_IIBT_EXT4_BLOCK;
528
526
529
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
527
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE {
530
  UINT16                       Width;
528
  UINT16    Width;
531
  UINT16                       Height;
529
  UINT16    Height;
532
  UINT8                        Data[1];
530
  UINT8     Data[1];
533
} EFI_HII_IIBT_IMAGE_1BIT_BASE;
531
} EFI_HII_IIBT_IMAGE_1BIT_BASE;
534
532
535
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
533
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK {
536
  EFI_HII_IMAGE_BLOCK          Header;
534
  EFI_HII_IMAGE_BLOCK             Header;
537
  UINT8                        PaletteIndex;
535
  UINT8                           PaletteIndex;
538
  EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
536
  EFI_HII_IIBT_IMAGE_1BIT_BASE    Bitmap;
539
} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
537
} EFI_HII_IIBT_IMAGE_1BIT_BLOCK;
540
538
541
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
539
typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK {
542
  EFI_HII_IMAGE_BLOCK          Header;
540
  EFI_HII_IMAGE_BLOCK             Header;
543
  UINT8                        PaletteIndex;
541
  UINT8                           PaletteIndex;
544
  EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap;
542
  EFI_HII_IIBT_IMAGE_1BIT_BASE    Bitmap;
545
} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
543
} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK;
546
544
547
typedef struct _EFI_HII_RGB_PIXEL {
545
typedef struct _EFI_HII_RGB_PIXEL {
548
  UINT8                        b;
546
  UINT8    b;
549
  UINT8                        g;
547
  UINT8    g;
550
  UINT8                        r;
548
  UINT8    r;
551
} EFI_HII_RGB_PIXEL;
549
} EFI_HII_RGB_PIXEL;
552
550
553
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
551
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE {
554
  UINT16                       Width;
552
  UINT16               Width;
555
  UINT16                       Height;
553
  UINT16               Height;
556
  EFI_HII_RGB_PIXEL            Bitmap[1];
554
  EFI_HII_RGB_PIXEL    Bitmap[1];
557
} EFI_HII_IIBT_IMAGE_24BIT_BASE;
555
} EFI_HII_IIBT_IMAGE_24BIT_BASE;
558
556
559
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
557
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK {
560
  EFI_HII_IMAGE_BLOCK           Header;
558
  EFI_HII_IMAGE_BLOCK              Header;
561
  EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
559
  EFI_HII_IIBT_IMAGE_24BIT_BASE    Bitmap;
562
} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
560
} EFI_HII_IIBT_IMAGE_24BIT_BLOCK;
563
561
564
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
562
typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK {
565
  EFI_HII_IMAGE_BLOCK           Header;
563
  EFI_HII_IMAGE_BLOCK              Header;
566
  EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap;
564
  EFI_HII_IIBT_IMAGE_24BIT_BASE    Bitmap;
567
} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
565
} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK;
568
566
569
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
567
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE {
570
  UINT16                       Width;
568
  UINT16    Width;
571
  UINT16                       Height;
569
  UINT16    Height;
572
  UINT8                        Data[1];
570
  UINT8     Data[1];
573
} EFI_HII_IIBT_IMAGE_4BIT_BASE;
571
} EFI_HII_IIBT_IMAGE_4BIT_BASE;
574
572
575
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
573
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK {
576
  EFI_HII_IMAGE_BLOCK          Header;
574
  EFI_HII_IMAGE_BLOCK             Header;
577
  UINT8                        PaletteIndex;
575
  UINT8                           PaletteIndex;
578
  EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
576
  EFI_HII_IIBT_IMAGE_4BIT_BASE    Bitmap;
579
} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
577
} EFI_HII_IIBT_IMAGE_4BIT_BLOCK;
580
578
581
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
579
typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK {
582
  EFI_HII_IMAGE_BLOCK          Header;
580
  EFI_HII_IMAGE_BLOCK             Header;
583
  UINT8                        PaletteIndex;
581
  UINT8                           PaletteIndex;
584
  EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap;
582
  EFI_HII_IIBT_IMAGE_4BIT_BASE    Bitmap;
585
} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
583
} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK;
586
584
587
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
585
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE {
588
  UINT16                       Width;
586
  UINT16    Width;
589
  UINT16                       Height;
587
  UINT16    Height;
590
  UINT8                        Data[1];
588
  UINT8     Data[1];
591
} EFI_HII_IIBT_IMAGE_8BIT_BASE;
589
} EFI_HII_IIBT_IMAGE_8BIT_BASE;
592
590
593
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
591
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK {
594
  EFI_HII_IMAGE_BLOCK          Header;
592
  EFI_HII_IMAGE_BLOCK             Header;
595
  UINT8                        PaletteIndex;
593
  UINT8                           PaletteIndex;
596
  EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
594
  EFI_HII_IIBT_IMAGE_8BIT_BASE    Bitmap;
597
} EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
595
} EFI_HII_IIBT_IMAGE_8BIT_BLOCK;
598
596
599
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
597
typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK {
600
  EFI_HII_IMAGE_BLOCK          Header;
598
  EFI_HII_IMAGE_BLOCK             Header;
601
  UINT8                        PaletteIndex;
599
  UINT8                           PaletteIndex;
602
  EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap;
600
  EFI_HII_IIBT_IMAGE_8BIT_BASE    Bitmap;
603
} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
601
} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK;
604
602
605
typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
603
typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK {
606
  EFI_HII_IMAGE_BLOCK          Header;
604
  EFI_HII_IMAGE_BLOCK    Header;
607
  EFI_IMAGE_ID                 ImageId;
605
  EFI_IMAGE_ID           ImageId;
608
} EFI_HII_IIBT_DUPLICATE_BLOCK;
606
} EFI_HII_IIBT_DUPLICATE_BLOCK;
609
607
610
typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
608
typedef struct _EFI_HII_IIBT_JPEG_BLOCK {
611
  EFI_HII_IMAGE_BLOCK          Header;
609
  EFI_HII_IMAGE_BLOCK    Header;
612
  UINT32                       Size;
610
  UINT32                 Size;
613
  UINT8                        Data[1];
611
  UINT8                  Data[1];
614
} EFI_HII_IIBT_JPEG_BLOCK;
612
} EFI_HII_IIBT_JPEG_BLOCK;
615
613
616
typedef struct _EFI_HII_IIBT_PNG_BLOCK {
614
typedef struct _EFI_HII_IIBT_PNG_BLOCK {
617
  EFI_HII_IMAGE_BLOCK          Header;
615
  EFI_HII_IMAGE_BLOCK    Header;
618
  UINT32                       Size;
616
  UINT32                 Size;
619
  UINT8                        Data[1];
617
  UINT8                  Data[1];
620
} EFI_HII_IIBT_PNG_BLOCK;
618
} EFI_HII_IIBT_PNG_BLOCK;
621
619
622
typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
620
typedef struct _EFI_HII_IIBT_SKIP1_BLOCK {
623
  EFI_HII_IMAGE_BLOCK          Header;
621
  EFI_HII_IMAGE_BLOCK    Header;
624
  UINT8                        SkipCount;
622
  UINT8                  SkipCount;
625
} EFI_HII_IIBT_SKIP1_BLOCK;
623
} EFI_HII_IIBT_SKIP1_BLOCK;
626
624
627
typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
625
typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
628
  EFI_HII_IMAGE_BLOCK          Header;
626
  EFI_HII_IMAGE_BLOCK    Header;
629
  UINT16                       SkipCount;
627
  UINT16                 SkipCount;
630
} EFI_HII_IIBT_SKIP2_BLOCK;
628
} EFI_HII_IIBT_SKIP2_BLOCK;
631
629
632
//
630
//
Lines 634-645 typedef struct _EFI_HII_IIBT_SKIP2_BLOCK { Link Here
634
//
632
//
635
633
636
typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
634
typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
637
  UINT16                       PaletteCount;
635
  UINT16    PaletteCount;
638
} EFI_HII_IMAGE_PALETTE_INFO_HEADER;
636
} EFI_HII_IMAGE_PALETTE_INFO_HEADER;
639
637
640
typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
638
typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
641
  UINT16                       PaletteSize;
639
  UINT16               PaletteSize;
642
  EFI_HII_RGB_PIXEL            PaletteValue[1];
640
  EFI_HII_RGB_PIXEL    PaletteValue[1];
643
} EFI_HII_IMAGE_PALETTE_INFO;
641
} EFI_HII_IMAGE_PALETTE_INFO;
644
642
645
//
643
//
Lines 651-796 typedef struct _EFI_HII_IMAGE_PALETTE_INFO { Link Here
651
/// The Form package is used to carry form-based encoding data.
649
/// The Form package is used to carry form-based encoding data.
652
///
650
///
653
typedef struct _EFI_HII_FORM_PACKAGE_HDR {
651
typedef struct _EFI_HII_FORM_PACKAGE_HDR {
654
  EFI_HII_PACKAGE_HEADER       Header;
652
  EFI_HII_PACKAGE_HEADER    Header;
655
  // EFI_IFR_OP_HEADER         OpCodeHeader;
653
  // EFI_IFR_OP_HEADER         OpCodeHeader;
656
  // More op-codes follow
654
  // More op-codes follow
657
} EFI_HII_FORM_PACKAGE_HDR;
655
} EFI_HII_FORM_PACKAGE_HDR;
658
656
659
typedef struct {
657
typedef struct {
660
  UINT8 Hour;
658
  UINT8    Hour;
661
  UINT8 Minute;
659
  UINT8    Minute;
662
  UINT8 Second;
660
  UINT8    Second;
663
} EFI_HII_TIME;
661
} EFI_HII_TIME;
664
662
665
typedef struct {
663
typedef struct {
666
  UINT16 Year;
664
  UINT16    Year;
667
  UINT8  Month;
665
  UINT8     Month;
668
  UINT8  Day;
666
  UINT8     Day;
669
} EFI_HII_DATE;
667
} EFI_HII_DATE;
670
668
671
typedef struct {
669
typedef struct {
672
  EFI_QUESTION_ID QuestionId;
670
  EFI_QUESTION_ID    QuestionId;
673
  EFI_FORM_ID     FormId;
671
  EFI_FORM_ID        FormId;
674
  EFI_GUID        FormSetGuid;
672
  EFI_GUID           FormSetGuid;
675
  EFI_STRING_ID   DevicePath;
673
  EFI_STRING_ID      DevicePath;
676
} EFI_HII_REF;
674
} EFI_HII_REF;
677
675
678
typedef union {
676
typedef union {
679
  UINT8           u8;
677
  UINT8            u8;
680
  UINT16          u16;
678
  UINT16           u16;
681
  UINT32          u32;
679
  UINT32           u32;
682
  UINT64          u64;
680
  UINT64           u64;
683
  BOOLEAN         b;
681
  BOOLEAN          b;
684
  EFI_HII_TIME    time;
682
  EFI_HII_TIME     time;
685
  EFI_HII_DATE    date;
683
  EFI_HII_DATE     date;
686
  EFI_STRING_ID   string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION
684
  EFI_STRING_ID    string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION
687
  EFI_HII_REF     ref;    ///< EFI_IFR_TYPE_REF
685
  EFI_HII_REF      ref;    ///< EFI_IFR_TYPE_REF
688
  // UINT8 buffer[];      ///< EFI_IFR_TYPE_BUFFER
686
  // UINT8 buffer[];      ///< EFI_IFR_TYPE_BUFFER
689
} EFI_IFR_TYPE_VALUE;
687
} EFI_IFR_TYPE_VALUE;
690
688
691
//
689
//
692
// IFR Opcodes
690
// IFR Opcodes
693
//
691
//
694
#define EFI_IFR_FORM_OP                0x01
692
#define EFI_IFR_FORM_OP                 0x01
695
#define EFI_IFR_SUBTITLE_OP            0x02
693
#define EFI_IFR_SUBTITLE_OP             0x02
696
#define EFI_IFR_TEXT_OP                0x03
694
#define EFI_IFR_TEXT_OP                 0x03
697
#define EFI_IFR_IMAGE_OP               0x04
695
#define EFI_IFR_IMAGE_OP                0x04
698
#define EFI_IFR_ONE_OF_OP              0x05
696
#define EFI_IFR_ONE_OF_OP               0x05
699
#define EFI_IFR_CHECKBOX_OP            0x06
697
#define EFI_IFR_CHECKBOX_OP             0x06
700
#define EFI_IFR_NUMERIC_OP             0x07
698
#define EFI_IFR_NUMERIC_OP              0x07
701
#define EFI_IFR_PASSWORD_OP            0x08
699
#define EFI_IFR_PASSWORD_OP             0x08
702
#define EFI_IFR_ONE_OF_OPTION_OP       0x09
700
#define EFI_IFR_ONE_OF_OPTION_OP        0x09
703
#define EFI_IFR_SUPPRESS_IF_OP         0x0A
701
#define EFI_IFR_SUPPRESS_IF_OP          0x0A
704
#define EFI_IFR_LOCKED_OP              0x0B
702
#define EFI_IFR_LOCKED_OP               0x0B
705
#define EFI_IFR_ACTION_OP              0x0C
703
#define EFI_IFR_ACTION_OP               0x0C
706
#define EFI_IFR_RESET_BUTTON_OP        0x0D
704
#define EFI_IFR_RESET_BUTTON_OP         0x0D
707
#define EFI_IFR_FORM_SET_OP            0x0E
705
#define EFI_IFR_FORM_SET_OP             0x0E
708
#define EFI_IFR_REF_OP                 0x0F
706
#define EFI_IFR_REF_OP                  0x0F
709
#define EFI_IFR_NO_SUBMIT_IF_OP        0x10
707
#define EFI_IFR_NO_SUBMIT_IF_OP         0x10
710
#define EFI_IFR_INCONSISTENT_IF_OP     0x11
708
#define EFI_IFR_INCONSISTENT_IF_OP      0x11
711
#define EFI_IFR_EQ_ID_VAL_OP           0x12
709
#define EFI_IFR_EQ_ID_VAL_OP            0x12
712
#define EFI_IFR_EQ_ID_ID_OP            0x13
710
#define EFI_IFR_EQ_ID_ID_OP             0x13
713
#define EFI_IFR_EQ_ID_VAL_LIST_OP      0x14
711
#define EFI_IFR_EQ_ID_VAL_LIST_OP       0x14
714
#define EFI_IFR_AND_OP                 0x15
712
#define EFI_IFR_AND_OP                  0x15
715
#define EFI_IFR_OR_OP                  0x16
713
#define EFI_IFR_OR_OP                   0x16
716
#define EFI_IFR_NOT_OP                 0x17
714
#define EFI_IFR_NOT_OP                  0x17
717
#define EFI_IFR_RULE_OP                0x18
715
#define EFI_IFR_RULE_OP                 0x18
718
#define EFI_IFR_GRAY_OUT_IF_OP         0x19
716
#define EFI_IFR_GRAY_OUT_IF_OP          0x19
719
#define EFI_IFR_DATE_OP                0x1A
717
#define EFI_IFR_DATE_OP                 0x1A
720
#define EFI_IFR_TIME_OP                0x1B
718
#define EFI_IFR_TIME_OP                 0x1B
721
#define EFI_IFR_STRING_OP              0x1C
719
#define EFI_IFR_STRING_OP               0x1C
722
#define EFI_IFR_REFRESH_OP             0x1D
720
#define EFI_IFR_REFRESH_OP              0x1D
723
#define EFI_IFR_DISABLE_IF_OP          0x1E
721
#define EFI_IFR_DISABLE_IF_OP           0x1E
724
#define EFI_IFR_ANIMATION_OP           0x1F
722
#define EFI_IFR_ANIMATION_OP            0x1F
725
#define EFI_IFR_TO_LOWER_OP            0x20
723
#define EFI_IFR_TO_LOWER_OP             0x20
726
#define EFI_IFR_TO_UPPER_OP            0x21
724
#define EFI_IFR_TO_UPPER_OP             0x21
727
#define EFI_IFR_MAP_OP                 0x22
725
#define EFI_IFR_MAP_OP                  0x22
728
#define EFI_IFR_ORDERED_LIST_OP        0x23
726
#define EFI_IFR_ORDERED_LIST_OP         0x23
729
#define EFI_IFR_VARSTORE_OP            0x24
727
#define EFI_IFR_VARSTORE_OP             0x24
730
#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
728
#define EFI_IFR_VARSTORE_NAME_VALUE_OP  0x25
731
#define EFI_IFR_VARSTORE_EFI_OP        0x26
729
#define EFI_IFR_VARSTORE_EFI_OP         0x26
732
#define EFI_IFR_VARSTORE_DEVICE_OP     0x27
730
#define EFI_IFR_VARSTORE_DEVICE_OP      0x27
733
#define EFI_IFR_VERSION_OP             0x28
731
#define EFI_IFR_VERSION_OP              0x28
734
#define EFI_IFR_END_OP                 0x29
732
#define EFI_IFR_END_OP                  0x29
735
#define EFI_IFR_MATCH_OP               0x2A
733
#define EFI_IFR_MATCH_OP                0x2A
736
#define EFI_IFR_GET_OP                 0x2B
734
#define EFI_IFR_GET_OP                  0x2B
737
#define EFI_IFR_SET_OP                 0x2C
735
#define EFI_IFR_SET_OP                  0x2C
738
#define EFI_IFR_READ_OP                0x2D
736
#define EFI_IFR_READ_OP                 0x2D
739
#define EFI_IFR_WRITE_OP               0x2E
737
#define EFI_IFR_WRITE_OP                0x2E
740
#define EFI_IFR_EQUAL_OP               0x2F
738
#define EFI_IFR_EQUAL_OP                0x2F
741
#define EFI_IFR_NOT_EQUAL_OP           0x30
739
#define EFI_IFR_NOT_EQUAL_OP            0x30
742
#define EFI_IFR_GREATER_THAN_OP        0x31
740
#define EFI_IFR_GREATER_THAN_OP         0x31
743
#define EFI_IFR_GREATER_EQUAL_OP       0x32
741
#define EFI_IFR_GREATER_EQUAL_OP        0x32
744
#define EFI_IFR_LESS_THAN_OP           0x33
742
#define EFI_IFR_LESS_THAN_OP            0x33
745
#define EFI_IFR_LESS_EQUAL_OP          0x34
743
#define EFI_IFR_LESS_EQUAL_OP           0x34
746
#define EFI_IFR_BITWISE_AND_OP         0x35
744
#define EFI_IFR_BITWISE_AND_OP          0x35
747
#define EFI_IFR_BITWISE_OR_OP          0x36
745
#define EFI_IFR_BITWISE_OR_OP           0x36
748
#define EFI_IFR_BITWISE_NOT_OP         0x37
746
#define EFI_IFR_BITWISE_NOT_OP          0x37
749
#define EFI_IFR_SHIFT_LEFT_OP          0x38
747
#define EFI_IFR_SHIFT_LEFT_OP           0x38
750
#define EFI_IFR_SHIFT_RIGHT_OP         0x39
748
#define EFI_IFR_SHIFT_RIGHT_OP          0x39
751
#define EFI_IFR_ADD_OP                 0x3A
749
#define EFI_IFR_ADD_OP                  0x3A
752
#define EFI_IFR_SUBTRACT_OP            0x3B
750
#define EFI_IFR_SUBTRACT_OP             0x3B
753
#define EFI_IFR_MULTIPLY_OP            0x3C
751
#define EFI_IFR_MULTIPLY_OP             0x3C
754
#define EFI_IFR_DIVIDE_OP              0x3D
752
#define EFI_IFR_DIVIDE_OP               0x3D
755
#define EFI_IFR_MODULO_OP              0x3E
753
#define EFI_IFR_MODULO_OP               0x3E
756
#define EFI_IFR_RULE_REF_OP            0x3F
754
#define EFI_IFR_RULE_REF_OP             0x3F
757
#define EFI_IFR_QUESTION_REF1_OP       0x40
755
#define EFI_IFR_QUESTION_REF1_OP        0x40
758
#define EFI_IFR_QUESTION_REF2_OP       0x41
756
#define EFI_IFR_QUESTION_REF2_OP        0x41
759
#define EFI_IFR_UINT8_OP               0x42
757
#define EFI_IFR_UINT8_OP                0x42
760
#define EFI_IFR_UINT16_OP              0x43
758
#define EFI_IFR_UINT16_OP               0x43
761
#define EFI_IFR_UINT32_OP              0x44
759
#define EFI_IFR_UINT32_OP               0x44
762
#define EFI_IFR_UINT64_OP              0x45
760
#define EFI_IFR_UINT64_OP               0x45
763
#define EFI_IFR_TRUE_OP                0x46
761
#define EFI_IFR_TRUE_OP                 0x46
764
#define EFI_IFR_FALSE_OP               0x47
762
#define EFI_IFR_FALSE_OP                0x47
765
#define EFI_IFR_TO_UINT_OP             0x48
763
#define EFI_IFR_TO_UINT_OP              0x48
766
#define EFI_IFR_TO_STRING_OP           0x49
764
#define EFI_IFR_TO_STRING_OP            0x49
767
#define EFI_IFR_TO_BOOLEAN_OP          0x4A
765
#define EFI_IFR_TO_BOOLEAN_OP           0x4A
768
#define EFI_IFR_MID_OP                 0x4B
766
#define EFI_IFR_MID_OP                  0x4B
769
#define EFI_IFR_FIND_OP                0x4C
767
#define EFI_IFR_FIND_OP                 0x4C
770
#define EFI_IFR_TOKEN_OP               0x4D
768
#define EFI_IFR_TOKEN_OP                0x4D
771
#define EFI_IFR_STRING_REF1_OP         0x4E
769
#define EFI_IFR_STRING_REF1_OP          0x4E
772
#define EFI_IFR_STRING_REF2_OP         0x4F
770
#define EFI_IFR_STRING_REF2_OP          0x4F
773
#define EFI_IFR_CONDITIONAL_OP         0x50
771
#define EFI_IFR_CONDITIONAL_OP          0x50
774
#define EFI_IFR_QUESTION_REF3_OP       0x51
772
#define EFI_IFR_QUESTION_REF3_OP        0x51
775
#define EFI_IFR_ZERO_OP                0x52
773
#define EFI_IFR_ZERO_OP                 0x52
776
#define EFI_IFR_ONE_OP                 0x53
774
#define EFI_IFR_ONE_OP                  0x53
777
#define EFI_IFR_ONES_OP                0x54
775
#define EFI_IFR_ONES_OP                 0x54
778
#define EFI_IFR_UNDEFINED_OP           0x55
776
#define EFI_IFR_UNDEFINED_OP            0x55
779
#define EFI_IFR_LENGTH_OP              0x56
777
#define EFI_IFR_LENGTH_OP               0x56
780
#define EFI_IFR_DUP_OP                 0x57
778
#define EFI_IFR_DUP_OP                  0x57
781
#define EFI_IFR_THIS_OP                0x58
779
#define EFI_IFR_THIS_OP                 0x58
782
#define EFI_IFR_SPAN_OP                0x59
780
#define EFI_IFR_SPAN_OP                 0x59
783
#define EFI_IFR_VALUE_OP               0x5A
781
#define EFI_IFR_VALUE_OP                0x5A
784
#define EFI_IFR_DEFAULT_OP             0x5B
782
#define EFI_IFR_DEFAULT_OP              0x5B
785
#define EFI_IFR_DEFAULTSTORE_OP        0x5C
783
#define EFI_IFR_DEFAULTSTORE_OP         0x5C
786
#define EFI_IFR_FORM_MAP_OP            0x5D
784
#define EFI_IFR_FORM_MAP_OP             0x5D
787
#define EFI_IFR_CATENATE_OP            0x5E
785
#define EFI_IFR_CATENATE_OP             0x5E
788
#define EFI_IFR_GUID_OP                0x5F
786
#define EFI_IFR_GUID_OP                 0x5F
789
#define EFI_IFR_SECURITY_OP            0x60
787
#define EFI_IFR_SECURITY_OP             0x60
790
#define EFI_IFR_MODAL_TAG_OP           0x61
788
#define EFI_IFR_MODAL_TAG_OP            0x61
791
#define EFI_IFR_REFRESH_ID_OP          0x62
789
#define EFI_IFR_REFRESH_ID_OP           0x62
792
#define EFI_IFR_WARNING_IF_OP          0x63
790
#define EFI_IFR_WARNING_IF_OP           0x63
793
#define EFI_IFR_MATCH2_OP              0x64
791
#define EFI_IFR_MATCH2_OP               0x64
794
792
795
//
793
//
796
// Definitions of IFR Standard Headers
794
// Definitions of IFR Standard Headers
Lines 798-1327 typedef union { Link Here
798
//
796
//
799
797
800
typedef struct _EFI_IFR_OP_HEADER {
798
typedef struct _EFI_IFR_OP_HEADER {
801
  UINT8                    OpCode;
799
  UINT8    OpCode;
802
  UINT8                    Length:7;
800
  UINT8    Length : 7;
803
  UINT8                    Scope:1;
801
  UINT8    Scope  : 1;
804
} EFI_IFR_OP_HEADER;
802
} EFI_IFR_OP_HEADER;
805
803
806
typedef struct _EFI_IFR_STATEMENT_HEADER {
804
typedef struct _EFI_IFR_STATEMENT_HEADER {
807
  EFI_STRING_ID            Prompt;
805
  EFI_STRING_ID    Prompt;
808
  EFI_STRING_ID            Help;
806
  EFI_STRING_ID    Help;
809
} EFI_IFR_STATEMENT_HEADER;
807
} EFI_IFR_STATEMENT_HEADER;
810
808
811
typedef struct _EFI_IFR_QUESTION_HEADER {
809
typedef struct _EFI_IFR_QUESTION_HEADER {
812
  EFI_IFR_STATEMENT_HEADER Header;
810
  EFI_IFR_STATEMENT_HEADER    Header;
813
  EFI_QUESTION_ID          QuestionId;
811
  EFI_QUESTION_ID             QuestionId;
814
  EFI_VARSTORE_ID          VarStoreId;
812
  EFI_VARSTORE_ID             VarStoreId;
815
  union {
813
  union {
816
    EFI_STRING_ID          VarName;
814
    EFI_STRING_ID    VarName;
817
    UINT16                 VarOffset;
815
    UINT16           VarOffset;
818
  }                        VarStoreInfo;
816
  }                        VarStoreInfo;
819
  UINT8                    Flags;
817
  UINT8                       Flags;
820
} EFI_IFR_QUESTION_HEADER;
818
} EFI_IFR_QUESTION_HEADER;
821
819
822
//
820
//
823
// Flag values of EFI_IFR_QUESTION_HEADER
821
// Flag values of EFI_IFR_QUESTION_HEADER
824
//
822
//
825
#define EFI_IFR_FLAG_READ_ONLY          0x01
823
#define EFI_IFR_FLAG_READ_ONLY           0x01
826
#define EFI_IFR_FLAG_CALLBACK           0x04
824
#define EFI_IFR_FLAG_CALLBACK            0x04
827
#define EFI_IFR_FLAG_RESET_REQUIRED     0x10
825
#define EFI_IFR_FLAG_RESET_REQUIRED      0x10
828
#define EFI_IFR_FLAG_REST_STYLE         0x20
826
#define EFI_IFR_FLAG_REST_STYLE          0x20
829
#define EFI_IFR_FLAG_RECONNECT_REQUIRED 0x40
827
#define EFI_IFR_FLAG_RECONNECT_REQUIRED  0x40
830
#define EFI_IFR_FLAG_OPTIONS_ONLY       0x80
828
#define EFI_IFR_FLAG_OPTIONS_ONLY        0x80
831
829
832
//
830
//
833
// Definition for Opcode Reference
831
// Definition for Opcode Reference
834
// Section 27.3.8.3
832
// Section 27.3.8.3
835
//
833
//
836
typedef struct _EFI_IFR_DEFAULTSTORE {
834
typedef struct _EFI_IFR_DEFAULTSTORE {
837
  EFI_IFR_OP_HEADER        Header;
835
  EFI_IFR_OP_HEADER    Header;
838
  EFI_STRING_ID            DefaultName;
836
  EFI_STRING_ID        DefaultName;
839
  UINT16                   DefaultId;
837
  UINT16               DefaultId;
840
} EFI_IFR_DEFAULTSTORE;
838
} EFI_IFR_DEFAULTSTORE;
841
839
842
//
840
//
843
// Default Identifier of default store
841
// Default Identifier of default store
844
//
842
//
845
#define EFI_HII_DEFAULT_CLASS_STANDARD       0x0000
843
#define EFI_HII_DEFAULT_CLASS_STANDARD        0x0000
846
#define EFI_HII_DEFAULT_CLASS_MANUFACTURING  0x0001
844
#define EFI_HII_DEFAULT_CLASS_MANUFACTURING   0x0001
847
#define EFI_HII_DEFAULT_CLASS_SAFE           0x0002
845
#define EFI_HII_DEFAULT_CLASS_SAFE            0x0002
848
#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
846
#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN  0x4000
849
#define EFI_HII_DEFAULT_CLASS_PLATFORM_END   0x7fff
847
#define EFI_HII_DEFAULT_CLASS_PLATFORM_END    0x7fff
850
#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
848
#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN  0x8000
851
#define EFI_HII_DEFAULT_CLASS_HARDWARE_END   0xbfff
849
#define EFI_HII_DEFAULT_CLASS_HARDWARE_END    0xbfff
852
#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
850
#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN  0xc000
853
#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END   0xffff
851
#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END    0xffff
854
852
855
typedef struct _EFI_IFR_VARSTORE {
853
typedef struct _EFI_IFR_VARSTORE {
856
  EFI_IFR_OP_HEADER        Header;
854
  EFI_IFR_OP_HEADER    Header;
857
  EFI_GUID                 Guid;
855
  EFI_GUID             Guid;
858
  EFI_VARSTORE_ID          VarStoreId;
856
  EFI_VARSTORE_ID      VarStoreId;
859
  UINT16                   Size;
857
  UINT16               Size;
860
  UINT8                    Name[1];
858
  UINT8                Name[1];
861
} EFI_IFR_VARSTORE;
859
} EFI_IFR_VARSTORE;
862
860
863
typedef struct _EFI_IFR_VARSTORE_EFI {
861
typedef struct _EFI_IFR_VARSTORE_EFI {
864
  EFI_IFR_OP_HEADER        Header;
862
  EFI_IFR_OP_HEADER    Header;
865
  EFI_VARSTORE_ID          VarStoreId;
863
  EFI_VARSTORE_ID      VarStoreId;
866
  EFI_GUID                 Guid;
864
  EFI_GUID             Guid;
867
  UINT32                   Attributes;
865
  UINT32               Attributes;
868
  UINT16                   Size;
866
  UINT16               Size;
869
  UINT8                    Name[1];
867
  UINT8                Name[1];
870
} EFI_IFR_VARSTORE_EFI;
868
} EFI_IFR_VARSTORE_EFI;
871
869
872
typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
870
typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
873
  EFI_IFR_OP_HEADER        Header;
871
  EFI_IFR_OP_HEADER    Header;
874
  EFI_VARSTORE_ID          VarStoreId;
872
  EFI_VARSTORE_ID      VarStoreId;
875
  EFI_GUID                 Guid;
873
  EFI_GUID             Guid;
876
} EFI_IFR_VARSTORE_NAME_VALUE;
874
} EFI_IFR_VARSTORE_NAME_VALUE;
877
875
878
typedef struct _EFI_IFR_FORM_SET {
876
typedef struct _EFI_IFR_FORM_SET {
879
  EFI_IFR_OP_HEADER        Header;
877
  EFI_IFR_OP_HEADER    Header;
880
  EFI_GUID                 Guid;
878
  EFI_GUID             Guid;
881
  EFI_STRING_ID            FormSetTitle;
879
  EFI_STRING_ID        FormSetTitle;
882
  EFI_STRING_ID            Help;
880
  EFI_STRING_ID        Help;
883
  UINT8                    Flags;
881
  UINT8                Flags;
884
  // EFI_GUID              ClassGuid[];
882
  // EFI_GUID              ClassGuid[];
885
} EFI_IFR_FORM_SET;
883
} EFI_IFR_FORM_SET;
886
884
887
typedef struct _EFI_IFR_END {
885
typedef struct _EFI_IFR_END {
888
  EFI_IFR_OP_HEADER        Header;
886
  EFI_IFR_OP_HEADER    Header;
889
} EFI_IFR_END;
887
} EFI_IFR_END;
890
888
891
typedef struct _EFI_IFR_FORM {
889
typedef struct _EFI_IFR_FORM {
892
  EFI_IFR_OP_HEADER        Header;
890
  EFI_IFR_OP_HEADER    Header;
893
  UINT16                   FormId;
891
  UINT16               FormId;
894
  EFI_STRING_ID            FormTitle;
892
  EFI_STRING_ID        FormTitle;
895
} EFI_IFR_FORM;
893
} EFI_IFR_FORM;
896
894
897
typedef struct _EFI_IFR_IMAGE {
895
typedef struct _EFI_IFR_IMAGE {
898
  EFI_IFR_OP_HEADER        Header;
896
  EFI_IFR_OP_HEADER    Header;
899
  EFI_IMAGE_ID             Id;
897
  EFI_IMAGE_ID         Id;
900
} EFI_IFR_IMAGE;
898
} EFI_IFR_IMAGE;
901
899
902
typedef struct _EFI_IFR_MODAL_TAG {
900
typedef struct _EFI_IFR_MODAL_TAG {
903
  EFI_IFR_OP_HEADER        Header;
901
  EFI_IFR_OP_HEADER    Header;
904
} EFI_IFR_MODAL_TAG;
902
} EFI_IFR_MODAL_TAG;
905
903
906
typedef struct _EFI_IFR_LOCKED {
904
typedef struct _EFI_IFR_LOCKED {
907
  EFI_IFR_OP_HEADER        Header;
905
  EFI_IFR_OP_HEADER    Header;
908
} EFI_IFR_LOCKED;
906
} EFI_IFR_LOCKED;
909
907
910
typedef struct _EFI_IFR_RULE {
908
typedef struct _EFI_IFR_RULE {
911
  EFI_IFR_OP_HEADER        Header;
909
  EFI_IFR_OP_HEADER    Header;
912
  UINT8                    RuleId;
910
  UINT8                RuleId;
913
} EFI_IFR_RULE;
911
} EFI_IFR_RULE;
914
912
915
typedef struct _EFI_IFR_DEFAULT {
913
typedef struct _EFI_IFR_DEFAULT {
916
  EFI_IFR_OP_HEADER        Header;
914
  EFI_IFR_OP_HEADER     Header;
917
  UINT16                   DefaultId;
915
  UINT16                DefaultId;
918
  UINT8                    Type;
916
  UINT8                 Type;
919
  EFI_IFR_TYPE_VALUE       Value;
917
  EFI_IFR_TYPE_VALUE    Value;
920
} EFI_IFR_DEFAULT;
918
} EFI_IFR_DEFAULT;
921
919
922
typedef struct _EFI_IFR_DEFAULT_2 {
920
typedef struct _EFI_IFR_DEFAULT_2 {
923
  EFI_IFR_OP_HEADER        Header;
921
  EFI_IFR_OP_HEADER    Header;
924
  UINT16                   DefaultId;
922
  UINT16               DefaultId;
925
  UINT8                    Type;
923
  UINT8                Type;
926
} EFI_IFR_DEFAULT_2;
924
} EFI_IFR_DEFAULT_2;
927
925
928
typedef struct _EFI_IFR_VALUE {
926
typedef struct _EFI_IFR_VALUE {
929
  EFI_IFR_OP_HEADER        Header;
927
  EFI_IFR_OP_HEADER    Header;
930
} EFI_IFR_VALUE;
928
} EFI_IFR_VALUE;
931
929
932
typedef struct _EFI_IFR_SUBTITLE {
930
typedef struct _EFI_IFR_SUBTITLE {
933
  EFI_IFR_OP_HEADER        Header;
931
  EFI_IFR_OP_HEADER           Header;
934
  EFI_IFR_STATEMENT_HEADER Statement;
932
  EFI_IFR_STATEMENT_HEADER    Statement;
935
  UINT8                    Flags;
933
  UINT8                       Flags;
936
} EFI_IFR_SUBTITLE;
934
} EFI_IFR_SUBTITLE;
937
935
938
#define EFI_IFR_FLAGS_HORIZONTAL       0x01
936
#define EFI_IFR_FLAGS_HORIZONTAL  0x01
939
937
940
typedef struct _EFI_IFR_CHECKBOX {
938
typedef struct _EFI_IFR_CHECKBOX {
941
  EFI_IFR_OP_HEADER        Header;
939
  EFI_IFR_OP_HEADER          Header;
942
  EFI_IFR_QUESTION_HEADER  Question;
940
  EFI_IFR_QUESTION_HEADER    Question;
943
  UINT8                    Flags;
941
  UINT8                      Flags;
944
} EFI_IFR_CHECKBOX;
942
} EFI_IFR_CHECKBOX;
945
943
946
#define EFI_IFR_CHECKBOX_DEFAULT       0x01
944
#define EFI_IFR_CHECKBOX_DEFAULT      0x01
947
#define EFI_IFR_CHECKBOX_DEFAULT_MFG   0x02
945
#define EFI_IFR_CHECKBOX_DEFAULT_MFG  0x02
948
946
949
typedef struct _EFI_IFR_TEXT {
947
typedef struct _EFI_IFR_TEXT {
950
  EFI_IFR_OP_HEADER        Header;
948
  EFI_IFR_OP_HEADER           Header;
951
  EFI_IFR_STATEMENT_HEADER Statement;
949
  EFI_IFR_STATEMENT_HEADER    Statement;
952
  EFI_STRING_ID            TextTwo;
950
  EFI_STRING_ID               TextTwo;
953
} EFI_IFR_TEXT;
951
} EFI_IFR_TEXT;
954
952
955
typedef struct _EFI_IFR_REF {
953
typedef struct _EFI_IFR_REF {
956
  EFI_IFR_OP_HEADER        Header;
954
  EFI_IFR_OP_HEADER          Header;
957
  EFI_IFR_QUESTION_HEADER  Question;
955
  EFI_IFR_QUESTION_HEADER    Question;
958
  EFI_FORM_ID              FormId;
956
  EFI_FORM_ID                FormId;
959
} EFI_IFR_REF;
957
} EFI_IFR_REF;
960
958
961
typedef struct _EFI_IFR_REF2 {
959
typedef struct _EFI_IFR_REF2 {
962
  EFI_IFR_OP_HEADER        Header;
960
  EFI_IFR_OP_HEADER          Header;
963
  EFI_IFR_QUESTION_HEADER  Question;
961
  EFI_IFR_QUESTION_HEADER    Question;
964
  EFI_FORM_ID              FormId;
962
  EFI_FORM_ID                FormId;
965
  EFI_QUESTION_ID          QuestionId;
963
  EFI_QUESTION_ID            QuestionId;
966
} EFI_IFR_REF2;
964
} EFI_IFR_REF2;
967
965
968
typedef struct _EFI_IFR_REF3 {
966
typedef struct _EFI_IFR_REF3 {
969
  EFI_IFR_OP_HEADER        Header;
967
  EFI_IFR_OP_HEADER          Header;
970
  EFI_IFR_QUESTION_HEADER  Question;
968
  EFI_IFR_QUESTION_HEADER    Question;
971
  EFI_FORM_ID              FormId;
969
  EFI_FORM_ID                FormId;
972
  EFI_QUESTION_ID          QuestionId;
970
  EFI_QUESTION_ID            QuestionId;
973
  EFI_GUID                 FormSetId;
971
  EFI_GUID                   FormSetId;
974
} EFI_IFR_REF3;
972
} EFI_IFR_REF3;
975
973
976
typedef struct _EFI_IFR_REF4 {
974
typedef struct _EFI_IFR_REF4 {
977
  EFI_IFR_OP_HEADER        Header;
975
  EFI_IFR_OP_HEADER          Header;
978
  EFI_IFR_QUESTION_HEADER  Question;
976
  EFI_IFR_QUESTION_HEADER    Question;
979
  EFI_FORM_ID              FormId;
977
  EFI_FORM_ID                FormId;
980
  EFI_QUESTION_ID          QuestionId;
978
  EFI_QUESTION_ID            QuestionId;
981
  EFI_GUID                 FormSetId;
979
  EFI_GUID                   FormSetId;
982
  EFI_STRING_ID            DevicePath;
980
  EFI_STRING_ID              DevicePath;
983
} EFI_IFR_REF4;
981
} EFI_IFR_REF4;
984
982
985
typedef struct _EFI_IFR_REF5 {
983
typedef struct _EFI_IFR_REF5 {
986
  EFI_IFR_OP_HEADER Header;
984
  EFI_IFR_OP_HEADER          Header;
987
  EFI_IFR_QUESTION_HEADER Question;
985
  EFI_IFR_QUESTION_HEADER    Question;
988
} EFI_IFR_REF5;
986
} EFI_IFR_REF5;
989
987
990
typedef struct _EFI_IFR_RESET_BUTTON {
988
typedef struct _EFI_IFR_RESET_BUTTON {
991
  EFI_IFR_OP_HEADER        Header;
989
  EFI_IFR_OP_HEADER           Header;
992
  EFI_IFR_STATEMENT_HEADER Statement;
990
  EFI_IFR_STATEMENT_HEADER    Statement;
993
  EFI_DEFAULT_ID           DefaultId;
991
  EFI_DEFAULT_ID              DefaultId;
994
} EFI_IFR_RESET_BUTTON;
992
} EFI_IFR_RESET_BUTTON;
995
993
996
typedef struct _EFI_IFR_ACTION {
994
typedef struct _EFI_IFR_ACTION {
997
  EFI_IFR_OP_HEADER        Header;
995
  EFI_IFR_OP_HEADER          Header;
998
  EFI_IFR_QUESTION_HEADER  Question;
996
  EFI_IFR_QUESTION_HEADER    Question;
999
  EFI_STRING_ID            QuestionConfig;
997
  EFI_STRING_ID              QuestionConfig;
1000
} EFI_IFR_ACTION;
998
} EFI_IFR_ACTION;
1001
999
1002
typedef struct _EFI_IFR_ACTION_1 {
1000
typedef struct _EFI_IFR_ACTION_1 {
1003
  EFI_IFR_OP_HEADER        Header;
1001
  EFI_IFR_OP_HEADER          Header;
1004
  EFI_IFR_QUESTION_HEADER  Question;
1002
  EFI_IFR_QUESTION_HEADER    Question;
1005
} EFI_IFR_ACTION_1;
1003
} EFI_IFR_ACTION_1;
1006
1004
1007
typedef struct _EFI_IFR_DATE {
1005
typedef struct _EFI_IFR_DATE {
1008
  EFI_IFR_OP_HEADER        Header;
1006
  EFI_IFR_OP_HEADER          Header;
1009
  EFI_IFR_QUESTION_HEADER  Question;
1007
  EFI_IFR_QUESTION_HEADER    Question;
1010
  UINT8                    Flags;
1008
  UINT8                      Flags;
1011
} EFI_IFR_DATE;
1009
} EFI_IFR_DATE;
1012
1010
1013
//
1011
//
1014
// Flags that describe the behavior of the question.
1012
// Flags that describe the behavior of the question.
1015
//
1013
//
1016
#define EFI_QF_DATE_YEAR_SUPPRESS      0x01
1014
#define EFI_QF_DATE_YEAR_SUPPRESS   0x01
1017
#define EFI_QF_DATE_MONTH_SUPPRESS     0x02
1015
#define EFI_QF_DATE_MONTH_SUPPRESS  0x02
1018
#define EFI_QF_DATE_DAY_SUPPRESS       0x04
1016
#define EFI_QF_DATE_DAY_SUPPRESS    0x04
1019
1017
1020
#define EFI_QF_DATE_STORAGE            0x30
1018
#define EFI_QF_DATE_STORAGE         0x30
1021
#define     QF_DATE_STORAGE_NORMAL     0x00
1019
#define     QF_DATE_STORAGE_NORMAL  0x00
1022
#define     QF_DATE_STORAGE_TIME       0x10
1020
#define     QF_DATE_STORAGE_TIME    0x10
1023
#define     QF_DATE_STORAGE_WAKEUP     0x20
1021
#define     QF_DATE_STORAGE_WAKEUP  0x20
1024
1022
1025
typedef union {
1023
typedef union {
1026
  struct {
1024
  struct {
1027
    UINT8 MinValue;
1025
    UINT8    MinValue;
1028
    UINT8 MaxValue;
1026
    UINT8    MaxValue;
1029
    UINT8 Step;
1027
    UINT8    Step;
1030
  } u8;
1028
  } u8;
1031
  struct {
1029
  struct {
1032
    UINT16 MinValue;
1030
    UINT16    MinValue;
1033
    UINT16 MaxValue;
1031
    UINT16    MaxValue;
1034
    UINT16 Step;
1032
    UINT16    Step;
1035
  } u16;
1033
  } u16;
1036
  struct {
1034
  struct {
1037
    UINT32 MinValue;
1035
    UINT32    MinValue;
1038
    UINT32 MaxValue;
1036
    UINT32    MaxValue;
1039
    UINT32 Step;
1037
    UINT32    Step;
1040
  } u32;
1038
  } u32;
1041
  struct {
1039
  struct {
1042
    UINT64 MinValue;
1040
    UINT64    MinValue;
1043
    UINT64 MaxValue;
1041
    UINT64    MaxValue;
1044
    UINT64 Step;
1042
    UINT64    Step;
1045
  } u64;
1043
  } u64;
1046
} MINMAXSTEP_DATA;
1044
} MINMAXSTEP_DATA;
1047
1045
1048
typedef struct _EFI_IFR_NUMERIC {
1046
typedef struct _EFI_IFR_NUMERIC {
1049
  EFI_IFR_OP_HEADER        Header;
1047
  EFI_IFR_OP_HEADER          Header;
1050
  EFI_IFR_QUESTION_HEADER  Question;
1048
  EFI_IFR_QUESTION_HEADER    Question;
1051
  UINT8                    Flags;
1049
  UINT8                      Flags;
1052
  MINMAXSTEP_DATA          data;
1050
  MINMAXSTEP_DATA            data;
1053
} EFI_IFR_NUMERIC;
1051
} EFI_IFR_NUMERIC;
1054
1052
1055
//
1053
//
1056
// Flags related to the numeric question
1054
// Flags related to the numeric question
1057
//
1055
//
1058
#define EFI_IFR_NUMERIC_SIZE           0x03
1056
#define EFI_IFR_NUMERIC_SIZE      0x03
1059
#define   EFI_IFR_NUMERIC_SIZE_1       0x00
1057
#define   EFI_IFR_NUMERIC_SIZE_1  0x00
1060
#define   EFI_IFR_NUMERIC_SIZE_2       0x01
1058
#define   EFI_IFR_NUMERIC_SIZE_2  0x01
1061
#define   EFI_IFR_NUMERIC_SIZE_4       0x02
1059
#define   EFI_IFR_NUMERIC_SIZE_4  0x02
1062
#define   EFI_IFR_NUMERIC_SIZE_8       0x03
1060
#define   EFI_IFR_NUMERIC_SIZE_8  0x03
1063
1061
1064
#define EFI_IFR_DISPLAY                0x30
1062
#define EFI_IFR_DISPLAY             0x30
1065
#define   EFI_IFR_DISPLAY_INT_DEC      0x00
1063
#define   EFI_IFR_DISPLAY_INT_DEC   0x00
1066
#define   EFI_IFR_DISPLAY_UINT_DEC     0x10
1064
#define   EFI_IFR_DISPLAY_UINT_DEC  0x10
1067
#define   EFI_IFR_DISPLAY_UINT_HEX     0x20
1065
#define   EFI_IFR_DISPLAY_UINT_HEX  0x20
1068
1066
1069
typedef struct _EFI_IFR_ONE_OF {
1067
typedef struct _EFI_IFR_ONE_OF {
1070
  EFI_IFR_OP_HEADER        Header;
1068
  EFI_IFR_OP_HEADER          Header;
1071
  EFI_IFR_QUESTION_HEADER  Question;
1069
  EFI_IFR_QUESTION_HEADER    Question;
1072
  UINT8                    Flags;
1070
  UINT8                      Flags;
1073
  MINMAXSTEP_DATA          data;
1071
  MINMAXSTEP_DATA            data;
1074
} EFI_IFR_ONE_OF;
1072
} EFI_IFR_ONE_OF;
1075
1073
1076
typedef struct _EFI_IFR_STRING {
1074
typedef struct _EFI_IFR_STRING {
1077
  EFI_IFR_OP_HEADER        Header;
1075
  EFI_IFR_OP_HEADER          Header;
1078
  EFI_IFR_QUESTION_HEADER  Question;
1076
  EFI_IFR_QUESTION_HEADER    Question;
1079
  UINT8                    MinSize;
1077
  UINT8                      MinSize;
1080
  UINT8                    MaxSize;
1078
  UINT8                      MaxSize;
1081
  UINT8                    Flags;
1079
  UINT8                      Flags;
1082
} EFI_IFR_STRING;
1080
} EFI_IFR_STRING;
1083
1081
1084
#define EFI_IFR_STRING_MULTI_LINE      0x01
1082
#define EFI_IFR_STRING_MULTI_LINE  0x01
1085
1083
1086
typedef struct _EFI_IFR_PASSWORD {
1084
typedef struct _EFI_IFR_PASSWORD {
1087
  EFI_IFR_OP_HEADER        Header;
1085
  EFI_IFR_OP_HEADER          Header;
1088
  EFI_IFR_QUESTION_HEADER  Question;
1086
  EFI_IFR_QUESTION_HEADER    Question;
1089
  UINT16                   MinSize;
1087
  UINT16                     MinSize;
1090
  UINT16                   MaxSize;
1088
  UINT16                     MaxSize;
1091
} EFI_IFR_PASSWORD;
1089
} EFI_IFR_PASSWORD;
1092
1090
1093
typedef struct _EFI_IFR_ORDERED_LIST {
1091
typedef struct _EFI_IFR_ORDERED_LIST {
1094
  EFI_IFR_OP_HEADER        Header;
1092
  EFI_IFR_OP_HEADER          Header;
1095
  EFI_IFR_QUESTION_HEADER  Question;
1093
  EFI_IFR_QUESTION_HEADER    Question;
1096
  UINT8                    MaxContainers;
1094
  UINT8                      MaxContainers;
1097
  UINT8                    Flags;
1095
  UINT8                      Flags;
1098
} EFI_IFR_ORDERED_LIST;
1096
} EFI_IFR_ORDERED_LIST;
1099
1097
1100
#define EFI_IFR_UNIQUE_SET             0x01
1098
#define EFI_IFR_UNIQUE_SET    0x01
1101
#define EFI_IFR_NO_EMPTY_SET           0x02
1099
#define EFI_IFR_NO_EMPTY_SET  0x02
1102
1100
1103
typedef struct _EFI_IFR_TIME {
1101
typedef struct _EFI_IFR_TIME {
1104
  EFI_IFR_OP_HEADER        Header;
1102
  EFI_IFR_OP_HEADER          Header;
1105
  EFI_IFR_QUESTION_HEADER  Question;
1103
  EFI_IFR_QUESTION_HEADER    Question;
1106
  UINT8                    Flags;
1104
  UINT8                      Flags;
1107
} EFI_IFR_TIME;
1105
} EFI_IFR_TIME;
1108
1106
1109
//
1107
//
1110
// A bit-mask that determines which unique settings are active for this opcode.
1108
// A bit-mask that determines which unique settings are active for this opcode.
1111
//
1109
//
1112
#define QF_TIME_HOUR_SUPPRESS          0x01
1110
#define QF_TIME_HOUR_SUPPRESS    0x01
1113
#define QF_TIME_MINUTE_SUPPRESS        0x02
1111
#define QF_TIME_MINUTE_SUPPRESS  0x02
1114
#define QF_TIME_SECOND_SUPPRESS        0x04
1112
#define QF_TIME_SECOND_SUPPRESS  0x04
1115
1113
1116
#define QF_TIME_STORAGE                0x30
1114
#define QF_TIME_STORAGE           0x30
1117
#define   QF_TIME_STORAGE_NORMAL       0x00
1115
#define   QF_TIME_STORAGE_NORMAL  0x00
1118
#define   QF_TIME_STORAGE_TIME         0x10
1116
#define   QF_TIME_STORAGE_TIME    0x10
1119
#define   QF_TIME_STORAGE_WAKEUP       0x20
1117
#define   QF_TIME_STORAGE_WAKEUP  0x20
1120
1118
1121
typedef struct _EFI_IFR_DISABLE_IF {
1119
typedef struct _EFI_IFR_DISABLE_IF {
1122
  EFI_IFR_OP_HEADER        Header;
1120
  EFI_IFR_OP_HEADER    Header;
1123
} EFI_IFR_DISABLE_IF;
1121
} EFI_IFR_DISABLE_IF;
1124
1122
1125
typedef struct _EFI_IFR_SUPPRESS_IF {
1123
typedef struct _EFI_IFR_SUPPRESS_IF {
1126
  EFI_IFR_OP_HEADER        Header;
1124
  EFI_IFR_OP_HEADER    Header;
1127
} EFI_IFR_SUPPRESS_IF;
1125
} EFI_IFR_SUPPRESS_IF;
1128
1126
1129
typedef struct _EFI_IFR_GRAY_OUT_IF {
1127
typedef struct _EFI_IFR_GRAY_OUT_IF {
1130
  EFI_IFR_OP_HEADER        Header;
1128
  EFI_IFR_OP_HEADER    Header;
1131
} EFI_IFR_GRAY_OUT_IF;
1129
} EFI_IFR_GRAY_OUT_IF;
1132
1130
1133
typedef struct _EFI_IFR_INCONSISTENT_IF {
1131
typedef struct _EFI_IFR_INCONSISTENT_IF {
1134
  EFI_IFR_OP_HEADER        Header;
1132
  EFI_IFR_OP_HEADER    Header;
1135
  EFI_STRING_ID            Error;
1133
  EFI_STRING_ID        Error;
1136
} EFI_IFR_INCONSISTENT_IF;
1134
} EFI_IFR_INCONSISTENT_IF;
1137
1135
1138
typedef struct _EFI_IFR_NO_SUBMIT_IF {
1136
typedef struct _EFI_IFR_NO_SUBMIT_IF {
1139
  EFI_IFR_OP_HEADER        Header;
1137
  EFI_IFR_OP_HEADER    Header;
1140
  EFI_STRING_ID            Error;
1138
  EFI_STRING_ID        Error;
1141
} EFI_IFR_NO_SUBMIT_IF;
1139
} EFI_IFR_NO_SUBMIT_IF;
1142
1140
1143
typedef struct _EFI_IFR_WARNING_IF {
1141
typedef struct _EFI_IFR_WARNING_IF {
1144
  EFI_IFR_OP_HEADER        Header;
1142
  EFI_IFR_OP_HEADER    Header;
1145
  EFI_STRING_ID            Warning;
1143
  EFI_STRING_ID        Warning;
1146
  UINT8                    TimeOut;
1144
  UINT8                TimeOut;
1147
} EFI_IFR_WARNING_IF;
1145
} EFI_IFR_WARNING_IF;
1148
1146
1149
typedef struct _EFI_IFR_REFRESH {
1147
typedef struct _EFI_IFR_REFRESH {
1150
  EFI_IFR_OP_HEADER        Header;
1148
  EFI_IFR_OP_HEADER    Header;
1151
  UINT8                    RefreshInterval;
1149
  UINT8                RefreshInterval;
1152
} EFI_IFR_REFRESH;
1150
} EFI_IFR_REFRESH;
1153
1151
1154
typedef struct _EFI_IFR_VARSTORE_DEVICE {
1152
typedef struct _EFI_IFR_VARSTORE_DEVICE {
1155
  EFI_IFR_OP_HEADER        Header;
1153
  EFI_IFR_OP_HEADER    Header;
1156
  EFI_STRING_ID            DevicePath;
1154
  EFI_STRING_ID        DevicePath;
1157
} EFI_IFR_VARSTORE_DEVICE;
1155
} EFI_IFR_VARSTORE_DEVICE;
1158
1156
1159
typedef struct _EFI_IFR_ONE_OF_OPTION {
1157
typedef struct _EFI_IFR_ONE_OF_OPTION {
1160
  EFI_IFR_OP_HEADER        Header;
1158
  EFI_IFR_OP_HEADER     Header;
1161
  EFI_STRING_ID            Option;
1159
  EFI_STRING_ID         Option;
1162
  UINT8                    Flags;
1160
  UINT8                 Flags;
1163
  UINT8                    Type;
1161
  UINT8                 Type;
1164
  EFI_IFR_TYPE_VALUE       Value;
1162
  EFI_IFR_TYPE_VALUE    Value;
1165
} EFI_IFR_ONE_OF_OPTION;
1163
} EFI_IFR_ONE_OF_OPTION;
1166
1164
1167
//
1165
//
1168
// Types of the option's value.
1166
// Types of the option's value.
1169
//
1167
//
1170
#define EFI_IFR_TYPE_NUM_SIZE_8        0x00
1168
#define EFI_IFR_TYPE_NUM_SIZE_8   0x00
1171
#define EFI_IFR_TYPE_NUM_SIZE_16       0x01
1169
#define EFI_IFR_TYPE_NUM_SIZE_16  0x01
1172
#define EFI_IFR_TYPE_NUM_SIZE_32       0x02
1170
#define EFI_IFR_TYPE_NUM_SIZE_32  0x02
1173
#define EFI_IFR_TYPE_NUM_SIZE_64       0x03
1171
#define EFI_IFR_TYPE_NUM_SIZE_64  0x03
1174
#define EFI_IFR_TYPE_BOOLEAN           0x04
1172
#define EFI_IFR_TYPE_BOOLEAN      0x04
1175
#define EFI_IFR_TYPE_TIME              0x05
1173
#define EFI_IFR_TYPE_TIME         0x05
1176
#define EFI_IFR_TYPE_DATE              0x06
1174
#define EFI_IFR_TYPE_DATE         0x06
1177
#define EFI_IFR_TYPE_STRING            0x07
1175
#define EFI_IFR_TYPE_STRING       0x07
1178
#define EFI_IFR_TYPE_OTHER             0x08
1176
#define EFI_IFR_TYPE_OTHER        0x08
1179
#define EFI_IFR_TYPE_UNDEFINED         0x09
1177
#define EFI_IFR_TYPE_UNDEFINED    0x09
1180
#define EFI_IFR_TYPE_ACTION            0x0A
1178
#define EFI_IFR_TYPE_ACTION       0x0A
1181
#define EFI_IFR_TYPE_BUFFER            0x0B
1179
#define EFI_IFR_TYPE_BUFFER       0x0B
1182
#define EFI_IFR_TYPE_REF               0x0C
1180
#define EFI_IFR_TYPE_REF          0x0C
1183
1181
1184
#define EFI_IFR_OPTION_DEFAULT         0x10
1182
#define EFI_IFR_OPTION_DEFAULT      0x10
1185
#define EFI_IFR_OPTION_DEFAULT_MFG     0x20
1183
#define EFI_IFR_OPTION_DEFAULT_MFG  0x20
1186
1184
1187
typedef struct _EFI_IFR_GUID {
1185
typedef struct _EFI_IFR_GUID {
1188
  EFI_IFR_OP_HEADER        Header;
1186
  EFI_IFR_OP_HEADER    Header;
1189
  EFI_GUID                 Guid;
1187
  EFI_GUID             Guid;
1190
  //Optional Data Follows
1188
  // Optional Data Follows
1191
} EFI_IFR_GUID;
1189
} EFI_IFR_GUID;
1192
1190
1193
typedef struct _EFI_IFR_REFRESH_ID {
1191
typedef struct _EFI_IFR_REFRESH_ID {
1194
  EFI_IFR_OP_HEADER Header;
1192
  EFI_IFR_OP_HEADER    Header;
1195
  EFI_GUID          RefreshEventGroupId;
1193
  EFI_GUID             RefreshEventGroupId;
1196
} EFI_IFR_REFRESH_ID;
1194
} EFI_IFR_REFRESH_ID;
1197
1195
1198
typedef struct _EFI_IFR_DUP {
1196
typedef struct _EFI_IFR_DUP {
1199
  EFI_IFR_OP_HEADER        Header;
1197
  EFI_IFR_OP_HEADER    Header;
1200
} EFI_IFR_DUP;
1198
} EFI_IFR_DUP;
1201
1199
1202
typedef struct _EFI_IFR_EQ_ID_ID {
1200
typedef struct _EFI_IFR_EQ_ID_ID {
1203
  EFI_IFR_OP_HEADER        Header;
1201
  EFI_IFR_OP_HEADER    Header;
1204
  EFI_QUESTION_ID          QuestionId1;
1202
  EFI_QUESTION_ID      QuestionId1;
1205
  EFI_QUESTION_ID          QuestionId2;
1203
  EFI_QUESTION_ID      QuestionId2;
1206
} EFI_IFR_EQ_ID_ID;
1204
} EFI_IFR_EQ_ID_ID;
1207
1205
1208
typedef struct _EFI_IFR_EQ_ID_VAL {
1206
typedef struct _EFI_IFR_EQ_ID_VAL {
1209
  EFI_IFR_OP_HEADER        Header;
1207
  EFI_IFR_OP_HEADER    Header;
1210
  EFI_QUESTION_ID          QuestionId;
1208
  EFI_QUESTION_ID      QuestionId;
1211
  UINT16                   Value;
1209
  UINT16               Value;
1212
} EFI_IFR_EQ_ID_VAL;
1210
} EFI_IFR_EQ_ID_VAL;
1213
1211
1214
typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
1212
typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
1215
  EFI_IFR_OP_HEADER        Header;
1213
  EFI_IFR_OP_HEADER    Header;
1216
  EFI_QUESTION_ID          QuestionId;
1214
  EFI_QUESTION_ID      QuestionId;
1217
  UINT16                   ListLength;
1215
  UINT16               ListLength;
1218
  UINT16                   ValueList[1];
1216
  UINT16               ValueList[1];
1219
} EFI_IFR_EQ_ID_VAL_LIST;
1217
} EFI_IFR_EQ_ID_VAL_LIST;
1220
1218
1221
typedef struct _EFI_IFR_UINT8 {
1219
typedef struct _EFI_IFR_UINT8 {
1222
  EFI_IFR_OP_HEADER        Header;
1220
  EFI_IFR_OP_HEADER    Header;
1223
  UINT8 Value;
1221
  UINT8                Value;
1224
} EFI_IFR_UINT8;
1222
} EFI_IFR_UINT8;
1225
1223
1226
typedef struct _EFI_IFR_UINT16 {
1224
typedef struct _EFI_IFR_UINT16 {
1227
  EFI_IFR_OP_HEADER        Header;
1225
  EFI_IFR_OP_HEADER    Header;
1228
  UINT16                   Value;
1226
  UINT16               Value;
1229
} EFI_IFR_UINT16;
1227
} EFI_IFR_UINT16;
1230
1228
1231
typedef struct _EFI_IFR_UINT32 {
1229
typedef struct _EFI_IFR_UINT32 {
1232
  EFI_IFR_OP_HEADER        Header;
1230
  EFI_IFR_OP_HEADER    Header;
1233
  UINT32                   Value;
1231
  UINT32               Value;
1234
} EFI_IFR_UINT32;
1232
} EFI_IFR_UINT32;
1235
1233
1236
typedef struct _EFI_IFR_UINT64 {
1234
typedef struct _EFI_IFR_UINT64 {
1237
  EFI_IFR_OP_HEADER        Header;
1235
  EFI_IFR_OP_HEADER    Header;
1238
  UINT64 Value;
1236
  UINT64               Value;
1239
} EFI_IFR_UINT64;
1237
} EFI_IFR_UINT64;
1240
1238
1241
typedef struct _EFI_IFR_QUESTION_REF1 {
1239
typedef struct _EFI_IFR_QUESTION_REF1 {
1242
  EFI_IFR_OP_HEADER        Header;
1240
  EFI_IFR_OP_HEADER    Header;
1243
  EFI_QUESTION_ID          QuestionId;
1241
  EFI_QUESTION_ID      QuestionId;
1244
} EFI_IFR_QUESTION_REF1;
1242
} EFI_IFR_QUESTION_REF1;
1245
1243
1246
typedef struct _EFI_IFR_QUESTION_REF2 {
1244
typedef struct _EFI_IFR_QUESTION_REF2 {
1247
  EFI_IFR_OP_HEADER        Header;
1245
  EFI_IFR_OP_HEADER    Header;
1248
} EFI_IFR_QUESTION_REF2;
1246
} EFI_IFR_QUESTION_REF2;
1249
1247
1250
typedef struct _EFI_IFR_QUESTION_REF3 {
1248
typedef struct _EFI_IFR_QUESTION_REF3 {
1251
  EFI_IFR_OP_HEADER        Header;
1249
  EFI_IFR_OP_HEADER    Header;
1252
} EFI_IFR_QUESTION_REF3;
1250
} EFI_IFR_QUESTION_REF3;
1253
1251
1254
typedef struct _EFI_IFR_QUESTION_REF3_2 {
1252
typedef struct _EFI_IFR_QUESTION_REF3_2 {
1255
  EFI_IFR_OP_HEADER        Header;
1253
  EFI_IFR_OP_HEADER    Header;
1256
  EFI_STRING_ID            DevicePath;
1254
  EFI_STRING_ID        DevicePath;
1257
} EFI_IFR_QUESTION_REF3_2;
1255
} EFI_IFR_QUESTION_REF3_2;
1258
1256
1259
typedef struct _EFI_IFR_QUESTION_REF3_3 {
1257
typedef struct _EFI_IFR_QUESTION_REF3_3 {
1260
  EFI_IFR_OP_HEADER        Header;
1258
  EFI_IFR_OP_HEADER    Header;
1261
  EFI_STRING_ID            DevicePath;
1259
  EFI_STRING_ID        DevicePath;
1262
  EFI_GUID                 Guid;
1260
  EFI_GUID             Guid;
1263
} EFI_IFR_QUESTION_REF3_3;
1261
} EFI_IFR_QUESTION_REF3_3;
1264
1262
1265
typedef struct _EFI_IFR_RULE_REF {
1263
typedef struct _EFI_IFR_RULE_REF {
1266
  EFI_IFR_OP_HEADER        Header;
1264
  EFI_IFR_OP_HEADER    Header;
1267
  UINT8                    RuleId;
1265
  UINT8                RuleId;
1268
} EFI_IFR_RULE_REF;
1266
} EFI_IFR_RULE_REF;
1269
1267
1270
typedef struct _EFI_IFR_STRING_REF1 {
1268
typedef struct _EFI_IFR_STRING_REF1 {
1271
  EFI_IFR_OP_HEADER        Header;
1269
  EFI_IFR_OP_HEADER    Header;
1272
  EFI_STRING_ID            StringId;
1270
  EFI_STRING_ID        StringId;
1273
} EFI_IFR_STRING_REF1;
1271
} EFI_IFR_STRING_REF1;
1274
1272
1275
typedef struct _EFI_IFR_STRING_REF2 {
1273
typedef struct _EFI_IFR_STRING_REF2 {
1276
  EFI_IFR_OP_HEADER        Header;
1274
  EFI_IFR_OP_HEADER    Header;
1277
} EFI_IFR_STRING_REF2;
1275
} EFI_IFR_STRING_REF2;
1278
1276
1279
typedef struct _EFI_IFR_THIS {
1277
typedef struct _EFI_IFR_THIS {
1280
  EFI_IFR_OP_HEADER        Header;
1278
  EFI_IFR_OP_HEADER    Header;
1281
} EFI_IFR_THIS;
1279
} EFI_IFR_THIS;
1282
1280
1283
typedef struct _EFI_IFR_TRUE {
1281
typedef struct _EFI_IFR_TRUE {
1284
  EFI_IFR_OP_HEADER        Header;
1282
  EFI_IFR_OP_HEADER    Header;
1285
} EFI_IFR_TRUE;
1283
} EFI_IFR_TRUE;
1286
1284
1287
typedef struct _EFI_IFR_FALSE {
1285
typedef struct _EFI_IFR_FALSE {
1288
  EFI_IFR_OP_HEADER        Header;
1286
  EFI_IFR_OP_HEADER    Header;
1289
} EFI_IFR_FALSE;
1287
} EFI_IFR_FALSE;
1290
1288
1291
typedef struct _EFI_IFR_ONE {
1289
typedef struct _EFI_IFR_ONE {
1292
  EFI_IFR_OP_HEADER        Header;
1290
  EFI_IFR_OP_HEADER    Header;
1293
} EFI_IFR_ONE;
1291
} EFI_IFR_ONE;
1294
1292
1295
typedef struct _EFI_IFR_ONES {
1293
typedef struct _EFI_IFR_ONES {
1296
  EFI_IFR_OP_HEADER        Header;
1294
  EFI_IFR_OP_HEADER    Header;
1297
} EFI_IFR_ONES;
1295
} EFI_IFR_ONES;
1298
1296
1299
typedef struct _EFI_IFR_ZERO {
1297
typedef struct _EFI_IFR_ZERO {
1300
  EFI_IFR_OP_HEADER        Header;
1298
  EFI_IFR_OP_HEADER    Header;
1301
} EFI_IFR_ZERO;
1299
} EFI_IFR_ZERO;
1302
1300
1303
typedef struct _EFI_IFR_UNDEFINED {
1301
typedef struct _EFI_IFR_UNDEFINED {
1304
  EFI_IFR_OP_HEADER        Header;
1302
  EFI_IFR_OP_HEADER    Header;
1305
} EFI_IFR_UNDEFINED;
1303
} EFI_IFR_UNDEFINED;
1306
1304
1307
typedef struct _EFI_IFR_VERSION {
1305
typedef struct _EFI_IFR_VERSION {
1308
  EFI_IFR_OP_HEADER        Header;
1306
  EFI_IFR_OP_HEADER    Header;
1309
} EFI_IFR_VERSION;
1307
} EFI_IFR_VERSION;
1310
1308
1311
typedef struct _EFI_IFR_LENGTH {
1309
typedef struct _EFI_IFR_LENGTH {
1312
  EFI_IFR_OP_HEADER        Header;
1310
  EFI_IFR_OP_HEADER    Header;
1313
} EFI_IFR_LENGTH;
1311
} EFI_IFR_LENGTH;
1314
1312
1315
typedef struct _EFI_IFR_NOT {
1313
typedef struct _EFI_IFR_NOT {
1316
  EFI_IFR_OP_HEADER        Header;
1314
  EFI_IFR_OP_HEADER    Header;
1317
} EFI_IFR_NOT;
1315
} EFI_IFR_NOT;
1318
1316
1319
typedef struct _EFI_IFR_BITWISE_NOT {
1317
typedef struct _EFI_IFR_BITWISE_NOT {
1320
  EFI_IFR_OP_HEADER        Header;
1318
  EFI_IFR_OP_HEADER    Header;
1321
} EFI_IFR_BITWISE_NOT;
1319
} EFI_IFR_BITWISE_NOT;
1322
1320
1323
typedef struct _EFI_IFR_TO_BOOLEAN {
1321
typedef struct _EFI_IFR_TO_BOOLEAN {
1324
  EFI_IFR_OP_HEADER        Header;
1322
  EFI_IFR_OP_HEADER    Header;
1325
} EFI_IFR_TO_BOOLEAN;
1323
} EFI_IFR_TO_BOOLEAN;
1326
1324
1327
///
1325
///
Lines 1332-1341 typedef struct _EFI_IFR_TO_BOOLEAN { Link Here
1332
/// 2 = hexadecimal (lower-case alpha).
1330
/// 2 = hexadecimal (lower-case alpha).
1333
/// 3 = hexadecimal (upper-case alpha).
1331
/// 3 = hexadecimal (upper-case alpha).
1334
///@{
1332
///@{
1335
#define EFI_IFR_STRING_UNSIGNED_DEC      0
1333
#define EFI_IFR_STRING_UNSIGNED_DEC   0
1336
#define EFI_IFR_STRING_SIGNED_DEC        1
1334
#define EFI_IFR_STRING_SIGNED_DEC     1
1337
#define EFI_IFR_STRING_LOWERCASE_HEX     2
1335
#define EFI_IFR_STRING_LOWERCASE_HEX  2
1338
#define EFI_IFR_STRING_UPPERCASE_HEX     3
1336
#define EFI_IFR_STRING_UPPERCASE_HEX  3
1339
///@}
1337
///@}
1340
1338
1341
///
1339
///
Lines 1343-1452 typedef struct _EFI_IFR_TO_BOOLEAN { Link Here
1343
/// 0 = ASCII.
1341
/// 0 = ASCII.
1344
/// 8 = Unicode.
1342
/// 8 = Unicode.
1345
///@{
1343
///@{
1346
#define EFI_IFR_STRING_ASCII             0
1344
#define EFI_IFR_STRING_ASCII    0
1347
#define EFI_IFR_STRING_UNICODE           8
1345
#define EFI_IFR_STRING_UNICODE  8
1348
///@}
1346
///@}
1349
1347
1350
typedef struct _EFI_IFR_TO_STRING {
1348
typedef struct _EFI_IFR_TO_STRING {
1351
  EFI_IFR_OP_HEADER        Header;
1349
  EFI_IFR_OP_HEADER    Header;
1352
  UINT8                    Format;
1350
  UINT8                Format;
1353
} EFI_IFR_TO_STRING;
1351
} EFI_IFR_TO_STRING;
1354
1352
1355
typedef struct _EFI_IFR_TO_UINT {
1353
typedef struct _EFI_IFR_TO_UINT {
1356
  EFI_IFR_OP_HEADER        Header;
1354
  EFI_IFR_OP_HEADER    Header;
1357
} EFI_IFR_TO_UINT;
1355
} EFI_IFR_TO_UINT;
1358
1356
1359
typedef struct _EFI_IFR_TO_UPPER {
1357
typedef struct _EFI_IFR_TO_UPPER {
1360
  EFI_IFR_OP_HEADER        Header;
1358
  EFI_IFR_OP_HEADER    Header;
1361
} EFI_IFR_TO_UPPER;
1359
} EFI_IFR_TO_UPPER;
1362
1360
1363
typedef struct _EFI_IFR_TO_LOWER {
1361
typedef struct _EFI_IFR_TO_LOWER {
1364
  EFI_IFR_OP_HEADER        Header;
1362
  EFI_IFR_OP_HEADER    Header;
1365
} EFI_IFR_TO_LOWER;
1363
} EFI_IFR_TO_LOWER;
1366
1364
1367
typedef struct _EFI_IFR_ADD {
1365
typedef struct _EFI_IFR_ADD {
1368
  EFI_IFR_OP_HEADER        Header;
1366
  EFI_IFR_OP_HEADER    Header;
1369
} EFI_IFR_ADD;
1367
} EFI_IFR_ADD;
1370
1368
1371
typedef struct _EFI_IFR_AND {
1369
typedef struct _EFI_IFR_AND {
1372
  EFI_IFR_OP_HEADER        Header;
1370
  EFI_IFR_OP_HEADER    Header;
1373
} EFI_IFR_AND;
1371
} EFI_IFR_AND;
1374
1372
1375
typedef struct _EFI_IFR_BITWISE_AND {
1373
typedef struct _EFI_IFR_BITWISE_AND {
1376
  EFI_IFR_OP_HEADER        Header;
1374
  EFI_IFR_OP_HEADER    Header;
1377
} EFI_IFR_BITWISE_AND;
1375
} EFI_IFR_BITWISE_AND;
1378
1376
1379
typedef struct _EFI_IFR_BITWISE_OR {
1377
typedef struct _EFI_IFR_BITWISE_OR {
1380
  EFI_IFR_OP_HEADER        Header;
1378
  EFI_IFR_OP_HEADER    Header;
1381
} EFI_IFR_BITWISE_OR;
1379
} EFI_IFR_BITWISE_OR;
1382
1380
1383
typedef struct _EFI_IFR_CATENATE {
1381
typedef struct _EFI_IFR_CATENATE {
1384
  EFI_IFR_OP_HEADER        Header;
1382
  EFI_IFR_OP_HEADER    Header;
1385
} EFI_IFR_CATENATE;
1383
} EFI_IFR_CATENATE;
1386
1384
1387
typedef struct _EFI_IFR_DIVIDE {
1385
typedef struct _EFI_IFR_DIVIDE {
1388
  EFI_IFR_OP_HEADER        Header;
1386
  EFI_IFR_OP_HEADER    Header;
1389
} EFI_IFR_DIVIDE;
1387
} EFI_IFR_DIVIDE;
1390
1388
1391
typedef struct _EFI_IFR_EQUAL {
1389
typedef struct _EFI_IFR_EQUAL {
1392
  EFI_IFR_OP_HEADER        Header;
1390
  EFI_IFR_OP_HEADER    Header;
1393
} EFI_IFR_EQUAL;
1391
} EFI_IFR_EQUAL;
1394
1392
1395
typedef struct _EFI_IFR_GREATER_EQUAL {
1393
typedef struct _EFI_IFR_GREATER_EQUAL {
1396
  EFI_IFR_OP_HEADER        Header;
1394
  EFI_IFR_OP_HEADER    Header;
1397
} EFI_IFR_GREATER_EQUAL;
1395
} EFI_IFR_GREATER_EQUAL;
1398
1396
1399
typedef struct _EFI_IFR_GREATER_THAN {
1397
typedef struct _EFI_IFR_GREATER_THAN {
1400
  EFI_IFR_OP_HEADER        Header;
1398
  EFI_IFR_OP_HEADER    Header;
1401
} EFI_IFR_GREATER_THAN;
1399
} EFI_IFR_GREATER_THAN;
1402
1400
1403
typedef struct _EFI_IFR_LESS_EQUAL {
1401
typedef struct _EFI_IFR_LESS_EQUAL {
1404
  EFI_IFR_OP_HEADER        Header;
1402
  EFI_IFR_OP_HEADER    Header;
1405
} EFI_IFR_LESS_EQUAL;
1403
} EFI_IFR_LESS_EQUAL;
1406
1404
1407
typedef struct _EFI_IFR_LESS_THAN {
1405
typedef struct _EFI_IFR_LESS_THAN {
1408
  EFI_IFR_OP_HEADER        Header;
1406
  EFI_IFR_OP_HEADER    Header;
1409
} EFI_IFR_LESS_THAN;
1407
} EFI_IFR_LESS_THAN;
1410
1408
1411
typedef struct _EFI_IFR_MATCH {
1409
typedef struct _EFI_IFR_MATCH {
1412
  EFI_IFR_OP_HEADER        Header;
1410
  EFI_IFR_OP_HEADER    Header;
1413
} EFI_IFR_MATCH;
1411
} EFI_IFR_MATCH;
1414
1412
1415
typedef struct _EFI_IFR_MATCH2 {
1413
typedef struct _EFI_IFR_MATCH2 {
1416
  EFI_IFR_OP_HEADER        Header;
1414
  EFI_IFR_OP_HEADER    Header;
1417
  EFI_GUID                 SyntaxType;
1415
  EFI_GUID             SyntaxType;
1418
} EFI_IFR_MATCH2;
1416
} EFI_IFR_MATCH2;
1419
1417
1420
typedef struct _EFI_IFR_MULTIPLY {
1418
typedef struct _EFI_IFR_MULTIPLY {
1421
  EFI_IFR_OP_HEADER        Header;
1419
  EFI_IFR_OP_HEADER    Header;
1422
} EFI_IFR_MULTIPLY;
1420
} EFI_IFR_MULTIPLY;
1423
1421
1424
typedef struct _EFI_IFR_MODULO {
1422
typedef struct _EFI_IFR_MODULO {
1425
  EFI_IFR_OP_HEADER        Header;
1423
  EFI_IFR_OP_HEADER    Header;
1426
} EFI_IFR_MODULO;
1424
} EFI_IFR_MODULO;
1427
1425
1428
typedef struct _EFI_IFR_NOT_EQUAL {
1426
typedef struct _EFI_IFR_NOT_EQUAL {
1429
  EFI_IFR_OP_HEADER        Header;
1427
  EFI_IFR_OP_HEADER    Header;
1430
} EFI_IFR_NOT_EQUAL;
1428
} EFI_IFR_NOT_EQUAL;
1431
1429
1432
typedef struct _EFI_IFR_OR {
1430
typedef struct _EFI_IFR_OR {
1433
  EFI_IFR_OP_HEADER        Header;
1431
  EFI_IFR_OP_HEADER    Header;
1434
} EFI_IFR_OR;
1432
} EFI_IFR_OR;
1435
1433
1436
typedef struct _EFI_IFR_SHIFT_LEFT {
1434
typedef struct _EFI_IFR_SHIFT_LEFT {
1437
  EFI_IFR_OP_HEADER        Header;
1435
  EFI_IFR_OP_HEADER    Header;
1438
} EFI_IFR_SHIFT_LEFT;
1436
} EFI_IFR_SHIFT_LEFT;
1439
1437
1440
typedef struct _EFI_IFR_SHIFT_RIGHT {
1438
typedef struct _EFI_IFR_SHIFT_RIGHT {
1441
  EFI_IFR_OP_HEADER        Header;
1439
  EFI_IFR_OP_HEADER    Header;
1442
} EFI_IFR_SHIFT_RIGHT;
1440
} EFI_IFR_SHIFT_RIGHT;
1443
1441
1444
typedef struct _EFI_IFR_SUBTRACT {
1442
typedef struct _EFI_IFR_SUBTRACT {
1445
  EFI_IFR_OP_HEADER        Header;
1443
  EFI_IFR_OP_HEADER    Header;
1446
} EFI_IFR_SUBTRACT;
1444
} EFI_IFR_SUBTRACT;
1447
1445
1448
typedef struct _EFI_IFR_CONDITIONAL {
1446
typedef struct _EFI_IFR_CONDITIONAL {
1449
  EFI_IFR_OP_HEADER        Header;
1447
  EFI_IFR_OP_HEADER    Header;
1450
} EFI_IFR_CONDITIONAL;
1448
} EFI_IFR_CONDITIONAL;
1451
1449
1452
//
1450
//
Lines 1456-1494 typedef struct _EFI_IFR_CONDITIONAL { Link Here
1456
#define EFI_IFR_FF_CASE_INSENSITIVE  0x01
1454
#define EFI_IFR_FF_CASE_INSENSITIVE  0x01
1457
1455
1458
typedef struct _EFI_IFR_FIND {
1456
typedef struct _EFI_IFR_FIND {
1459
  EFI_IFR_OP_HEADER        Header;
1457
  EFI_IFR_OP_HEADER    Header;
1460
  UINT8                    Format;
1458
  UINT8                Format;
1461
} EFI_IFR_FIND;
1459
} EFI_IFR_FIND;
1462
1460
1463
typedef struct _EFI_IFR_MID {
1461
typedef struct _EFI_IFR_MID {
1464
  EFI_IFR_OP_HEADER        Header;
1462
  EFI_IFR_OP_HEADER    Header;
1465
} EFI_IFR_MID;
1463
} EFI_IFR_MID;
1466
1464
1467
typedef struct _EFI_IFR_TOKEN {
1465
typedef struct _EFI_IFR_TOKEN {
1468
  EFI_IFR_OP_HEADER        Header;
1466
  EFI_IFR_OP_HEADER    Header;
1469
} EFI_IFR_TOKEN;
1467
} EFI_IFR_TOKEN;
1470
1468
1471
//
1469
//
1472
// Flags specifying whether to find the first matching string
1470
// Flags specifying whether to find the first matching string
1473
// or the first non-matching string.
1471
// or the first non-matching string.
1474
//
1472
//
1475
#define EFI_IFR_FLAGS_FIRST_MATCHING     0x00
1473
#define EFI_IFR_FLAGS_FIRST_MATCHING      0x00
1476
#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
1474
#define EFI_IFR_FLAGS_FIRST_NON_MATCHING  0x01
1477
1475
1478
typedef struct _EFI_IFR_SPAN {
1476
typedef struct _EFI_IFR_SPAN {
1479
  EFI_IFR_OP_HEADER        Header;
1477
  EFI_IFR_OP_HEADER    Header;
1480
  UINT8                    Flags;
1478
  UINT8                Flags;
1481
} EFI_IFR_SPAN;
1479
} EFI_IFR_SPAN;
1482
1480
1483
typedef struct _EFI_IFR_SECURITY {
1481
typedef struct _EFI_IFR_SECURITY {
1484
  ///
1482
  ///
1485
  /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
1483
  /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
1486
  ///
1484
  ///
1487
  EFI_IFR_OP_HEADER        Header;
1485
  EFI_IFR_OP_HEADER    Header;
1488
  ///
1486
  ///
1489
  /// Security permission level.
1487
  /// Security permission level.
1490
  ///
1488
  ///
1491
  EFI_GUID                 Permissions;
1489
  EFI_GUID             Permissions;
1492
} EFI_IFR_SECURITY;
1490
} EFI_IFR_SECURITY;
1493
1491
1494
typedef struct _EFI_IFR_FORM_MAP_METHOD {
1492
typedef struct _EFI_IFR_FORM_MAP_METHOD {
Lines 1496-1507 typedef struct _EFI_IFR_FORM_MAP_METHOD { Link Here
1496
  /// The string identifier which provides the human-readable name of
1494
  /// The string identifier which provides the human-readable name of
1497
  /// the configuration method for this standards map form.
1495
  /// the configuration method for this standards map form.
1498
  ///
1496
  ///
1499
  EFI_STRING_ID            MethodTitle;
1497
  EFI_STRING_ID    MethodTitle;
1500
  ///
1498
  ///
1501
  /// Identifier which uniquely specifies the configuration methods
1499
  /// Identifier which uniquely specifies the configuration methods
1502
  /// associated with this standards map form.
1500
  /// associated with this standards map form.
1503
  ///
1501
  ///
1504
  EFI_GUID                 MethodIdentifier;
1502
  EFI_GUID         MethodIdentifier;
1505
} EFI_IFR_FORM_MAP_METHOD;
1503
} EFI_IFR_FORM_MAP_METHOD;
1506
1504
1507
typedef struct _EFI_IFR_FORM_MAP {
1505
typedef struct _EFI_IFR_FORM_MAP {
Lines 1509-1519 typedef struct _EFI_IFR_FORM_MAP { Link Here
1509
  /// The sequence that defines the type of opcode as well as the length
1507
  /// The sequence that defines the type of opcode as well as the length
1510
  /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
1508
  /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
1511
  ///
1509
  ///
1512
  EFI_IFR_OP_HEADER        Header;
1510
  EFI_IFR_OP_HEADER    Header;
1513
  ///
1511
  ///
1514
  /// The unique identifier for this particular form.
1512
  /// The unique identifier for this particular form.
1515
  ///
1513
  ///
1516
  EFI_FORM_ID              FormId;
1514
  EFI_FORM_ID          FormId;
1517
  ///
1515
  ///
1518
  /// One or more configuration method's name and unique identifier.
1516
  /// One or more configuration method's name and unique identifier.
1519
  ///
1517
  ///
Lines 1525-1536 typedef struct _EFI_IFR_SET { Link Here
1525
  /// The sequence that defines the type of opcode as well as the length
1523
  /// The sequence that defines the type of opcode as well as the length
1526
  /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
1524
  /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
1527
  ///
1525
  ///
1528
  EFI_IFR_OP_HEADER  Header;
1526
  EFI_IFR_OP_HEADER    Header;
1529
  ///
1527
  ///
1530
  /// Specifies the identifier of a previously declared variable store to
1528
  /// Specifies the identifier of a previously declared variable store to
1531
  /// use when storing the question's value.
1529
  /// use when storing the question's value.
1532
  ///
1530
  ///
1533
  EFI_VARSTORE_ID    VarStoreId;
1531
  EFI_VARSTORE_ID      VarStoreId;
1534
  union {
1532
  union {
1535
    ///
1533
    ///
1536
    /// A 16-bit Buffer Storage offset.
1534
    /// A 16-bit Buffer Storage offset.
Lines 1544-1550 typedef struct _EFI_IFR_SET { Link Here
1544
  ///
1542
  ///
1545
  /// Specifies the type used for storage.
1543
  /// Specifies the type used for storage.
1546
  ///
1544
  ///
1547
  UINT8              VarStoreType;
1545
  UINT8    VarStoreType;
1548
} EFI_IFR_SET;
1546
} EFI_IFR_SET;
1549
1547
1550
typedef struct _EFI_IFR_GET {
1548
typedef struct _EFI_IFR_GET {
Lines 1552-1563 typedef struct _EFI_IFR_GET { Link Here
1552
  /// The sequence that defines the type of opcode as well as the length
1550
  /// The sequence that defines the type of opcode as well as the length
1553
  /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
1551
  /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
1554
  ///
1552
  ///
1555
  EFI_IFR_OP_HEADER  Header;
1553
  EFI_IFR_OP_HEADER    Header;
1556
  ///
1554
  ///
1557
  /// Specifies the identifier of a previously declared variable store to
1555
  /// Specifies the identifier of a previously declared variable store to
1558
  /// use when retrieving the value.
1556
  /// use when retrieving the value.
1559
  ///
1557
  ///
1560
  EFI_VARSTORE_ID    VarStoreId;
1558
  EFI_VARSTORE_ID      VarStoreId;
1561
  union {
1559
  union {
1562
    ///
1560
    ///
1563
    /// A 16-bit Buffer Storage offset.
1561
    /// A 16-bit Buffer Storage offset.
Lines 1571-1589 typedef struct _EFI_IFR_GET { Link Here
1571
  ///
1569
  ///
1572
  /// Specifies the type used for storage.
1570
  /// Specifies the type used for storage.
1573
  ///
1571
  ///
1574
  UINT8              VarStoreType;
1572
  UINT8    VarStoreType;
1575
} EFI_IFR_GET;
1573
} EFI_IFR_GET;
1576
1574
1577
typedef struct _EFI_IFR_READ {
1575
typedef struct _EFI_IFR_READ {
1578
  EFI_IFR_OP_HEADER       Header;
1576
  EFI_IFR_OP_HEADER    Header;
1579
} EFI_IFR_READ;
1577
} EFI_IFR_READ;
1580
1578
1581
typedef struct _EFI_IFR_WRITE {
1579
typedef struct _EFI_IFR_WRITE {
1582
  EFI_IFR_OP_HEADER      Header;
1580
  EFI_IFR_OP_HEADER    Header;
1583
} EFI_IFR_WRITE;
1581
} EFI_IFR_WRITE;
1584
1582
1585
typedef struct _EFI_IFR_MAP {
1583
typedef struct _EFI_IFR_MAP {
1586
  EFI_IFR_OP_HEADER      Header;
1584
  EFI_IFR_OP_HEADER    Header;
1587
} EFI_IFR_MAP;
1585
} EFI_IFR_MAP;
1588
//
1586
//
1589
// Definitions for Keyboard Package
1587
// Definitions for Keyboard Package
Lines 1698-1741 typedef enum { Link Here
1698
  EfiKeyF12,
1696
  EfiKeyF12,
1699
  EfiKeyPrint,
1697
  EfiKeyPrint,
1700
  EfiKeySLck,
1698
  EfiKeySLck,
1701
  EfiKeyPause
1699
  EfiKeyPause,
1700
  EfiKeyIntl0,
1701
  EfiKeyIntl1,
1702
  EfiKeyIntl2,
1703
  EfiKeyIntl3,
1704
  EfiKeyIntl4,
1705
  EfiKeyIntl5,
1706
  EfiKeyIntl6,
1707
  EfiKeyIntl7,
1708
  EfiKeyIntl8,
1709
  EfiKeyIntl9
1702
} EFI_KEY;
1710
} EFI_KEY;
1703
1711
1704
typedef struct {
1712
typedef struct {
1705
  ///
1713
  ///
1706
  /// Used to describe a physical key on a keyboard.
1714
  /// Used to describe a physical key on a keyboard.
1707
  ///
1715
  ///
1708
  EFI_KEY                 Key;
1716
  EFI_KEY    Key;
1709
  ///
1717
  ///
1710
  /// Unicode character code for the Key.
1718
  /// Unicode character code for the Key.
1711
  ///
1719
  ///
1712
  CHAR16                  Unicode;
1720
  CHAR16     Unicode;
1713
  ///
1721
  ///
1714
  /// Unicode character code for the key with the shift key being held down.
1722
  /// Unicode character code for the key with the shift key being held down.
1715
  ///
1723
  ///
1716
  CHAR16                  ShiftedUnicode;
1724
  CHAR16     ShiftedUnicode;
1717
  ///
1725
  ///
1718
  /// Unicode character code for the key with the Alt-GR being held down.
1726
  /// Unicode character code for the key with the Alt-GR being held down.
1719
  ///
1727
  ///
1720
  CHAR16                  AltGrUnicode;
1728
  CHAR16     AltGrUnicode;
1721
  ///
1729
  ///
1722
  /// Unicode character code for the key with the Alt-GR and shift keys being held down.
1730
  /// Unicode character code for the key with the Alt-GR and shift keys being held down.
1723
  ///
1731
  ///
1724
  CHAR16                  ShiftedAltGrUnicode;
1732
  CHAR16     ShiftedAltGrUnicode;
1725
  ///
1733
  ///
1726
  /// Modifier keys are defined to allow for special functionality that is not necessarily
1734
  /// Modifier keys are defined to allow for special functionality that is not necessarily
1727
  /// accomplished by a printable character. Many of these modifier keys are flags to toggle
1735
  /// accomplished by a printable character. Many of these modifier keys are flags to toggle
1728
  /// certain state bits on and off inside of a keyboard driver.
1736
  /// certain state bits on and off inside of a keyboard driver.
1729
  ///
1737
  ///
1730
  UINT16                  Modifier;
1738
  UINT16     Modifier;
1731
  UINT16                  AffectedAttribute;
1739
  UINT16     AffectedAttribute;
1732
} EFI_KEY_DESCRIPTOR;
1740
} EFI_KEY_DESCRIPTOR;
1733
1741
1734
///
1742
///
1735
/// A key which is affected by all the standard shift modifiers.
1743
/// A key which is affected by all the standard shift modifiers.
1736
/// Most keys would be expected to have this bit active.
1744
/// Most keys would be expected to have this bit active.
1737
///
1745
///
1738
#define EFI_AFFECTED_BY_STANDARD_SHIFT       0x0001
1746
#define EFI_AFFECTED_BY_STANDARD_SHIFT  0x0001
1739
1747
1740
///
1748
///
1741
/// This key is affected by the caps lock so that if a keyboard driver
1749
/// This key is affected by the caps lock so that if a keyboard driver
Lines 1743-1807 typedef struct { Link Here
1743
/// versus an "a" character.  Having this bit turned on would tell
1751
/// versus an "a" character.  Having this bit turned on would tell
1744
/// the keyboard driver to use the appropriate shifted state or not.
1752
/// the keyboard driver to use the appropriate shifted state or not.
1745
///
1753
///
1746
#define EFI_AFFECTED_BY_CAPS_LOCK            0x0002
1754
#define EFI_AFFECTED_BY_CAPS_LOCK  0x0002
1747
1755
1748
///
1756
///
1749
/// Similar to the case of CAPS lock, if this bit is active, the key
1757
/// Similar to the case of CAPS lock, if this bit is active, the key
1750
/// is affected by the num lock being turned on.
1758
/// is affected by the num lock being turned on.
1751
///
1759
///
1752
#define EFI_AFFECTED_BY_NUM_LOCK             0x0004
1760
#define EFI_AFFECTED_BY_NUM_LOCK  0x0004
1753
1761
1754
typedef struct {
1762
typedef struct {
1755
  UINT16                  LayoutLength;
1763
  UINT16      LayoutLength;
1756
  EFI_GUID                Guid;
1764
  EFI_GUID    Guid;
1757
  UINT32                  LayoutDescriptorStringOffset;
1765
  UINT32      LayoutDescriptorStringOffset;
1758
  UINT8                   DescriptorCount;
1766
  UINT8       DescriptorCount;
1759
  // EFI_KEY_DESCRIPTOR    Descriptors[];
1767
  // EFI_KEY_DESCRIPTOR    Descriptors[];
1760
} EFI_HII_KEYBOARD_LAYOUT;
1768
} EFI_HII_KEYBOARD_LAYOUT;
1761
1769
1762
typedef struct {
1770
typedef struct {
1763
  EFI_HII_PACKAGE_HEADER  Header;
1771
  EFI_HII_PACKAGE_HEADER    Header;
1764
  UINT16                  LayoutCount;
1772
  UINT16                    LayoutCount;
1765
  // EFI_HII_KEYBOARD_LAYOUT Layout[];
1773
  // EFI_HII_KEYBOARD_LAYOUT Layout[];
1766
} EFI_HII_KEYBOARD_PACKAGE_HDR;
1774
} EFI_HII_KEYBOARD_PACKAGE_HDR;
1767
1775
1768
//
1776
//
1769
// Modifier values
1777
// Modifier values
1770
//
1778
//
1771
#define EFI_NULL_MODIFIER                0x0000
1779
#define EFI_NULL_MODIFIER                 0x0000
1772
#define EFI_LEFT_CONTROL_MODIFIER        0x0001
1780
#define EFI_LEFT_CONTROL_MODIFIER         0x0001
1773
#define EFI_RIGHT_CONTROL_MODIFIER       0x0002
1781
#define EFI_RIGHT_CONTROL_MODIFIER        0x0002
1774
#define EFI_LEFT_ALT_MODIFIER            0x0003
1782
#define EFI_LEFT_ALT_MODIFIER             0x0003
1775
#define EFI_RIGHT_ALT_MODIFIER           0x0004
1783
#define EFI_RIGHT_ALT_MODIFIER            0x0004
1776
#define EFI_ALT_GR_MODIFIER              0x0005
1784
#define EFI_ALT_GR_MODIFIER               0x0005
1777
#define EFI_INSERT_MODIFIER              0x0006
1785
#define EFI_INSERT_MODIFIER               0x0006
1778
#define EFI_DELETE_MODIFIER              0x0007
1786
#define EFI_DELETE_MODIFIER               0x0007
1779
#define EFI_PAGE_DOWN_MODIFIER           0x0008
1787
#define EFI_PAGE_DOWN_MODIFIER            0x0008
1780
#define EFI_PAGE_UP_MODIFIER             0x0009
1788
#define EFI_PAGE_UP_MODIFIER              0x0009
1781
#define EFI_HOME_MODIFIER                0x000A
1789
#define EFI_HOME_MODIFIER                 0x000A
1782
#define EFI_END_MODIFIER                 0x000B
1790
#define EFI_END_MODIFIER                  0x000B
1783
#define EFI_LEFT_SHIFT_MODIFIER          0x000C
1791
#define EFI_LEFT_SHIFT_MODIFIER           0x000C
1784
#define EFI_RIGHT_SHIFT_MODIFIER         0x000D
1792
#define EFI_RIGHT_SHIFT_MODIFIER          0x000D
1785
#define EFI_CAPS_LOCK_MODIFIER           0x000E
1793
#define EFI_CAPS_LOCK_MODIFIER            0x000E
1786
#define EFI_NUM_LOCK_MODIFIER            0x000F
1794
#define EFI_NUM_LOCK_MODIFIER             0x000F
1787
#define EFI_LEFT_ARROW_MODIFIER          0x0010
1795
#define EFI_LEFT_ARROW_MODIFIER           0x0010
1788
#define EFI_RIGHT_ARROW_MODIFIER         0x0011
1796
#define EFI_RIGHT_ARROW_MODIFIER          0x0011
1789
#define EFI_DOWN_ARROW_MODIFIER          0x0012
1797
#define EFI_DOWN_ARROW_MODIFIER           0x0012
1790
#define EFI_UP_ARROW_MODIFIER            0x0013
1798
#define EFI_UP_ARROW_MODIFIER             0x0013
1791
#define EFI_NS_KEY_MODIFIER              0x0014
1799
#define EFI_NS_KEY_MODIFIER               0x0014
1792
#define EFI_NS_KEY_DEPENDENCY_MODIFIER   0x0015
1800
#define EFI_NS_KEY_DEPENDENCY_MODIFIER    0x0015
1793
#define EFI_FUNCTION_KEY_ONE_MODIFIER    0x0016
1801
#define EFI_FUNCTION_KEY_ONE_MODIFIER     0x0016
1794
#define EFI_FUNCTION_KEY_TWO_MODIFIER    0x0017
1802
#define EFI_FUNCTION_KEY_TWO_MODIFIER     0x0017
1795
#define EFI_FUNCTION_KEY_THREE_MODIFIER  0x0018
1803
#define EFI_FUNCTION_KEY_THREE_MODIFIER   0x0018
1796
#define EFI_FUNCTION_KEY_FOUR_MODIFIER   0x0019
1804
#define EFI_FUNCTION_KEY_FOUR_MODIFIER    0x0019
1797
#define EFI_FUNCTION_KEY_FIVE_MODIFIER   0x001A
1805
#define EFI_FUNCTION_KEY_FIVE_MODIFIER    0x001A
1798
#define EFI_FUNCTION_KEY_SIX_MODIFIER    0x001B
1806
#define EFI_FUNCTION_KEY_SIX_MODIFIER     0x001B
1799
#define EFI_FUNCTION_KEY_SEVEN_MODIFIER  0x001C
1807
#define EFI_FUNCTION_KEY_SEVEN_MODIFIER   0x001C
1800
#define EFI_FUNCTION_KEY_EIGHT_MODIFIER  0x001D
1808
#define EFI_FUNCTION_KEY_EIGHT_MODIFIER   0x001D
1801
#define EFI_FUNCTION_KEY_NINE_MODIFIER   0x001E
1809
#define EFI_FUNCTION_KEY_NINE_MODIFIER    0x001E
1802
#define EFI_FUNCTION_KEY_TEN_MODIFIER    0x001F
1810
#define EFI_FUNCTION_KEY_TEN_MODIFIER     0x001F
1803
#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
1811
#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER  0x0020
1804
#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
1812
#define EFI_FUNCTION_KEY_TWELVE_MODIFIER  0x0021
1805
1813
1806
//
1814
//
1807
// Keys that have multiple control functions based on modifier
1815
// Keys that have multiple control functions based on modifier
Lines 1810-1824 typedef struct { Link Here
1810
// is still a nonprinting character, but might have an alternate
1818
// is still a nonprinting character, but might have an alternate
1811
// control function like SYSREQUEST
1819
// control function like SYSREQUEST
1812
//
1820
//
1813
#define EFI_PRINT_MODIFIER               0x0022
1821
#define EFI_PRINT_MODIFIER        0x0022
1814
#define EFI_SYS_REQUEST_MODIFIER         0x0023
1822
#define EFI_SYS_REQUEST_MODIFIER  0x0023
1815
#define EFI_SCROLL_LOCK_MODIFIER         0x0024
1823
#define EFI_SCROLL_LOCK_MODIFIER  0x0024
1816
#define EFI_PAUSE_MODIFIER               0x0025
1824
#define EFI_PAUSE_MODIFIER        0x0025
1817
#define EFI_BREAK_MODIFIER               0x0026
1825
#define EFI_BREAK_MODIFIER        0x0026
1818
1826
1819
#define EFI_LEFT_LOGO_MODIFIER           0x0027
1827
#define EFI_LEFT_LOGO_MODIFIER   0x0027
1820
#define EFI_RIGHT_LOGO_MODIFIER          0x0028
1828
#define EFI_RIGHT_LOGO_MODIFIER  0x0028
1821
#define EFI_MENU_MODIFIER                0x0029
1829
#define EFI_MENU_MODIFIER        0x0029
1822
1830
1823
///
1831
///
1824
/// Animation IFR opcode
1832
/// Animation IFR opcode
Lines 1828-1838 typedef struct _EFI_IFR_ANIMATION { Link Here
1828
  /// Standard opcode header, where Header.OpCode is
1836
  /// Standard opcode header, where Header.OpCode is
1829
  /// EFI_IFR_ANIMATION_OP.
1837
  /// EFI_IFR_ANIMATION_OP.
1830
  ///
1838
  ///
1831
  EFI_IFR_OP_HEADER        Header;
1839
  EFI_IFR_OP_HEADER    Header;
1832
  ///
1840
  ///
1833
  /// Animation identifier in the HII database.
1841
  /// Animation identifier in the HII database.
1834
  ///
1842
  ///
1835
  EFI_ANIMATION_ID         Id;
1843
  EFI_ANIMATION_ID     Id;
1836
} EFI_IFR_ANIMATION;
1844
} EFI_IFR_ANIMATION;
1837
1845
1838
///
1846
///
Lines 1842-1853 typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR { Link Here
1842
  ///
1850
  ///
1843
  /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS.
1851
  /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS.
1844
  ///
1852
  ///
1845
  EFI_HII_PACKAGE_HEADER  Header;
1853
  EFI_HII_PACKAGE_HEADER    Header;
1846
  ///
1854
  ///
1847
  /// Offset, relative to this header, of the animation information. If
1855
  /// Offset, relative to this header, of the animation information. If
1848
  /// this is zero, then there are no animation sequences in the package.
1856
  /// this is zero, then there are no animation sequences in the package.
1849
  ///
1857
  ///
1850
  UINT32                  AnimationInfoOffset;
1858
  UINT32                    AnimationInfoOffset;
1851
} EFI_HII_ANIMATION_PACKAGE_HDR;
1859
} EFI_HII_ANIMATION_PACKAGE_HDR;
1852
1860
1853
///
1861
///
Lines 1855-1880 typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR { Link Here
1855
/// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK.
1863
/// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK.
1856
///
1864
///
1857
typedef struct _EFI_HII_ANIMATION_BLOCK {
1865
typedef struct _EFI_HII_ANIMATION_BLOCK {
1858
  UINT8  BlockType;
1866
  UINT8    BlockType;
1859
  //UINT8  BlockBody[];
1867
  // UINT8  BlockBody[];
1860
} EFI_HII_ANIMATION_BLOCK;
1868
} EFI_HII_ANIMATION_BLOCK;
1861
1869
1862
///
1870
///
1863
/// Animation block types.
1871
/// Animation block types.
1864
///
1872
///
1865
#define EFI_HII_AIBT_END                 0x00
1873
#define EFI_HII_AIBT_END                  0x00
1866
#define EFI_HII_AIBT_OVERLAY_IMAGES      0x10
1874
#define EFI_HII_AIBT_OVERLAY_IMAGES       0x10
1867
#define EFI_HII_AIBT_CLEAR_IMAGES        0x11
1875
#define EFI_HII_AIBT_CLEAR_IMAGES         0x11
1868
#define EFI_HII_AIBT_RESTORE_SCRN        0x12
1876
#define EFI_HII_AIBT_RESTORE_SCRN         0x12
1869
#define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP 0x18
1877
#define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP  0x18
1870
#define EFI_HII_AIBT_CLEAR_IMAGES_LOOP   0x19
1878
#define EFI_HII_AIBT_CLEAR_IMAGES_LOOP    0x19
1871
#define EFI_HII_AIBT_RESTORE_SCRN_LOOP   0x1A
1879
#define EFI_HII_AIBT_RESTORE_SCRN_LOOP    0x1A
1872
#define EFI_HII_AIBT_DUPLICATE           0x20
1880
#define EFI_HII_AIBT_DUPLICATE            0x20
1873
#define EFI_HII_AIBT_SKIP2               0x21
1881
#define EFI_HII_AIBT_SKIP2                0x21
1874
#define EFI_HII_AIBT_SKIP1               0x22
1882
#define EFI_HII_AIBT_SKIP1                0x22
1875
#define EFI_HII_AIBT_EXT1                0x30
1883
#define EFI_HII_AIBT_EXT1                 0x30
1876
#define EFI_HII_AIBT_EXT2                0x31
1884
#define EFI_HII_AIBT_EXT2                 0x31
1877
#define EFI_HII_AIBT_EXT4                0x32
1885
#define EFI_HII_AIBT_EXT4                 0x32
1878
1886
1879
///
1887
///
1880
/// Extended block headers used for variable sized animation records
1888
/// Extended block headers used for variable sized animation records
Lines 1885-1929 typedef struct _EFI_HII_AIBT_EXT1_BLOCK { Link Here
1885
  ///
1893
  ///
1886
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1.
1894
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1.
1887
  ///
1895
  ///
1888
  EFI_HII_ANIMATION_BLOCK  Header;
1896
  EFI_HII_ANIMATION_BLOCK    Header;
1889
  ///
1897
  ///
1890
  /// The block type.
1898
  /// The block type.
1891
  ///
1899
  ///
1892
  UINT8                    BlockType2;
1900
  UINT8                      BlockType2;
1893
  ///
1901
  ///
1894
  /// Size of the animation block, in bytes, including the animation block header.
1902
  /// Size of the animation block, in bytes, including the animation block header.
1895
  ///
1903
  ///
1896
  UINT8                    Length;
1904
  UINT8                      Length;
1897
} EFI_HII_AIBT_EXT1_BLOCK;
1905
} EFI_HII_AIBT_EXT1_BLOCK;
1898
1906
1899
typedef struct _EFI_HII_AIBT_EXT2_BLOCK {
1907
typedef struct _EFI_HII_AIBT_EXT2_BLOCK {
1900
  ///
1908
  ///
1901
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2.
1909
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2.
1902
  ///
1910
  ///
1903
  EFI_HII_ANIMATION_BLOCK  Header;
1911
  EFI_HII_ANIMATION_BLOCK    Header;
1904
  ///
1912
  ///
1905
  /// The block type
1913
  /// The block type
1906
  ///
1914
  ///
1907
  UINT8                    BlockType2;
1915
  UINT8                      BlockType2;
1908
  ///
1916
  ///
1909
  /// Size of the animation block, in bytes, including the animation block header.
1917
  /// Size of the animation block, in bytes, including the animation block header.
1910
  ///
1918
  ///
1911
  UINT16                   Length;
1919
  UINT16                     Length;
1912
} EFI_HII_AIBT_EXT2_BLOCK;
1920
} EFI_HII_AIBT_EXT2_BLOCK;
1913
1921
1914
typedef struct _EFI_HII_AIBT_EXT4_BLOCK {
1922
typedef struct _EFI_HII_AIBT_EXT4_BLOCK {
1915
  ///
1923
  ///
1916
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4.
1924
  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4.
1917
  ///
1925
  ///
1918
  EFI_HII_ANIMATION_BLOCK  Header;
1926
  EFI_HII_ANIMATION_BLOCK    Header;
1919
  ///
1927
  ///
1920
  /// The block type
1928
  /// The block type
1921
  ///
1929
  ///
1922
  UINT8                    BlockType2;
1930
  UINT8                      BlockType2;
1923
  ///
1931
  ///
1924
  /// Size of the animation block, in bytes, including the animation block header.
1932
  /// Size of the animation block, in bytes, including the animation block header.
1925
  ///
1933
  ///
1926
  UINT32                   Length;
1934
  UINT32                     Length;
1927
} EFI_HII_AIBT_EXT4_BLOCK;
1935
} EFI_HII_AIBT_EXT4_BLOCK;
1928
1936
1929
typedef struct _EFI_HII_ANIMATION_CELL {
1937
typedef struct _EFI_HII_ANIMATION_CELL {
Lines 1931-1953 typedef struct _EFI_HII_ANIMATION_CELL { Link Here
1931
  /// The X offset from the upper left hand corner of the logical
1939
  /// The X offset from the upper left hand corner of the logical
1932
  /// window to position the indexed image.
1940
  /// window to position the indexed image.
1933
  ///
1941
  ///
1934
  UINT16                    OffsetX;
1942
  UINT16          OffsetX;
1935
  ///
1943
  ///
1936
  /// The Y offset from the upper left hand corner of the logical
1944
  /// The Y offset from the upper left hand corner of the logical
1937
  /// window to position the indexed image.
1945
  /// window to position the indexed image.
1938
  ///
1946
  ///
1939
  UINT16                    OffsetY;
1947
  UINT16          OffsetY;
1940
  ///
1948
  ///
1941
  /// The image to display at the specified offset from the upper left
1949
  /// The image to display at the specified offset from the upper left
1942
  /// hand corner of the logical window.
1950
  /// hand corner of the logical window.
1943
  ///
1951
  ///
1944
  EFI_IMAGE_ID              ImageId;
1952
  EFI_IMAGE_ID    ImageId;
1945
  ///
1953
  ///
1946
  /// The number of milliseconds to delay after displaying the indexed
1954
  /// The number of milliseconds to delay after displaying the indexed
1947
  /// image and before continuing on to the next linked image.  If value
1955
  /// image and before continuing on to the next linked image.  If value
1948
  /// is zero, no delay.
1956
  /// is zero, no delay.
1949
  ///
1957
  ///
1950
  UINT16                    Delay;
1958
  UINT16          Delay;
1951
} EFI_HII_ANIMATION_CELL;
1959
} EFI_HII_ANIMATION_CELL;
1952
1960
1953
///
1961
///
Lines 1963-1986 typedef struct _EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK { Link Here
1963
  /// image that can be displayed alone. If the value is zero, no image
1971
  /// image that can be displayed alone. If the value is zero, no image
1964
  /// is displayed.
1972
  /// is displayed.
1965
  ///
1973
  ///
1966
  EFI_IMAGE_ID            DftImageId;
1974
  EFI_IMAGE_ID              DftImageId;
1967
  ///
1975
  ///
1968
  /// The overall width of the set of images (logical window width).
1976
  /// The overall width of the set of images (logical window width).
1969
  ///
1977
  ///
1970
  UINT16                  Width;
1978
  UINT16                    Width;
1971
  ///
1979
  ///
1972
  /// The overall height of the set of images (logical window height).
1980
  /// The overall height of the set of images (logical window height).
1973
  ///
1981
  ///
1974
  UINT16                  Height;
1982
  UINT16                    Height;
1975
  ///
1983
  ///
1976
  /// The number of EFI_HII_ANIMATION_CELL contained in the
1984
  /// The number of EFI_HII_ANIMATION_CELL contained in the
1977
  /// animation sequence.
1985
  /// animation sequence.
1978
  ///
1986
  ///
1979
  UINT16                  CellCount;
1987
  UINT16                    CellCount;
1980
  ///
1988
  ///
1981
  /// An array of CellCount animation cells.
1989
  /// An array of CellCount animation cells.
1982
  ///
1990
  ///
1983
  EFI_HII_ANIMATION_CELL  AnimationCell[1];
1991
  EFI_HII_ANIMATION_CELL    AnimationCell[1];
1984
} EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK;
1992
} EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK;
1985
1993
1986
///
1994
///
Lines 1997-2025 typedef struct _EFI_HII_AIBT_CLEAR_IMAGES_BLOCK { Link Here
1997
  /// image that can be displayed alone. If the value is zero, no image
2005
  /// image that can be displayed alone. If the value is zero, no image
1998
  /// is displayed.
2006
  /// is displayed.
1999
  ///
2007
  ///
2000
  EFI_IMAGE_ID       DftImageId;
2008
  EFI_IMAGE_ID              DftImageId;
2001
  ///
2009
  ///
2002
  /// The overall width of the set of images (logical window width).
2010
  /// The overall width of the set of images (logical window width).
2003
  ///
2011
  ///
2004
  UINT16             Width;
2012
  UINT16                    Width;
2005
  ///
2013
  ///
2006
  /// The overall height of the set of images (logical window height).
2014
  /// The overall height of the set of images (logical window height).
2007
  ///
2015
  ///
2008
  UINT16             Height;
2016
  UINT16                    Height;
2009
  ///
2017
  ///
2010
  /// The number of EFI_HII_ANIMATION_CELL contained in the
2018
  /// The number of EFI_HII_ANIMATION_CELL contained in the
2011
  /// animation sequence.
2019
  /// animation sequence.
2012
  ///
2020
  ///
2013
  UINT16             CellCount;
2021
  UINT16                    CellCount;
2014
  ///
2022
  ///
2015
  /// The color to clear the logical window to before displaying the
2023
  /// The color to clear the logical window to before displaying the
2016
  /// indexed image.
2024
  /// indexed image.
2017
  ///
2025
  ///
2018
  EFI_HII_RGB_PIXEL  BackgndColor;
2026
  EFI_HII_RGB_PIXEL         BackgndColor;
2019
  ///
2027
  ///
2020
  /// An array of CellCount animation cells.
2028
  /// An array of CellCount animation cells.
2021
  ///
2029
  ///
2022
  EFI_HII_ANIMATION_CELL AnimationCell[1];
2030
  EFI_HII_ANIMATION_CELL    AnimationCell[1];
2023
} EFI_HII_AIBT_CLEAR_IMAGES_BLOCK;
2031
} EFI_HII_AIBT_CLEAR_IMAGES_BLOCK;
2024
2032
2025
///
2033
///
Lines 2036-2080 typedef struct _EFI_HII_AIBT_RESTORE_SCRN_BLOCK { Link Here
2036
  /// image that can be displayed alone. If the value is zero, no image
2044
  /// image that can be displayed alone. If the value is zero, no image
2037
  /// is displayed.
2045
  /// is displayed.
2038
  ///
2046
  ///
2039
  EFI_IMAGE_ID            DftImageId;
2047
  EFI_IMAGE_ID              DftImageId;
2040
  ///
2048
  ///
2041
  /// The overall width of the set of images (logical window width).
2049
  /// The overall width of the set of images (logical window width).
2042
  ///
2050
  ///
2043
  UINT16                  Width;
2051
  UINT16                    Width;
2044
  ///
2052
  ///
2045
  /// The overall height of the set of images (logical window height).
2053
  /// The overall height of the set of images (logical window height).
2046
  ///
2054
  ///
2047
  UINT16                  Height;
2055
  UINT16                    Height;
2048
  ///
2056
  ///
2049
  /// The number of EFI_HII_ANIMATION_CELL contained in the
2057
  /// The number of EFI_HII_ANIMATION_CELL contained in the
2050
  /// animation sequence.
2058
  /// animation sequence.
2051
  ///
2059
  ///
2052
  UINT16                  CellCount;
2060
  UINT16                    CellCount;
2053
  ///
2061
  ///
2054
  /// An array of CellCount animation cells.
2062
  /// An array of CellCount animation cells.
2055
  ///
2063
  ///
2056
  EFI_HII_ANIMATION_CELL  AnimationCell[1];
2064
  EFI_HII_ANIMATION_CELL    AnimationCell[1];
2057
} EFI_HII_AIBT_RESTORE_SCRN_BLOCK;
2065
} EFI_HII_AIBT_RESTORE_SCRN_BLOCK;
2058
2066
2059
///
2067
///
2060
/// An animation block to describe an animation sequence that continuously cycles,
2068
/// An animation block to describe an animation sequence that continuously cycles,
2061
/// and where one image is simply displayed over the previous image.
2069
/// and where one image is simply displayed over the previous image.
2062
///
2070
///
2063
typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK  EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK;
2071
typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK;
2064
2072
2065
///
2073
///
2066
/// An animation block to describe an animation sequence that continuously cycles,
2074
/// An animation block to describe an animation sequence that continuously cycles,
2067
/// and where the logical window is cleared to the specified color before
2075
/// and where the logical window is cleared to the specified color before
2068
/// the next image is displayed.
2076
/// the next image is displayed.
2069
///
2077
///
2070
typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK    EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK;
2078
typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK;
2071
2079
2072
///
2080
///
2073
/// An animation block to describe an animation sequence that continuously cycles,
2081
/// An animation block to describe an animation sequence that continuously cycles,
2074
/// and where the screen is restored to the original state before
2082
/// and where the screen is restored to the original state before
2075
/// the next image is displayed.
2083
/// the next image is displayed.
2076
///
2084
///
2077
typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK    EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK;
2085
typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK;
2078
2086
2079
///
2087
///
2080
/// Assigns a new character value to a previously defined animation sequence.
2088
/// Assigns a new character value to a previously defined animation sequence.
Lines 2084-2090 typedef struct _EFI_HII_AIBT_DUPLICATE_BLOCK { Link Here
2084
  /// The previously defined animation ID with the exact same
2092
  /// The previously defined animation ID with the exact same
2085
  /// animation information.
2093
  /// animation information.
2086
  ///
2094
  ///
2087
  EFI_ANIMATION_ID  AnimationId;
2095
  EFI_ANIMATION_ID    AnimationId;
2088
} EFI_HII_AIBT_DUPLICATE_BLOCK;
2096
} EFI_HII_AIBT_DUPLICATE_BLOCK;
2089
2097
2090
///
2098
///
Lines 2094-2100 typedef struct _EFI_HII_AIBT_SKIP1_BLOCK { Link Here
2094
  ///
2102
  ///
2095
  /// The unsigned 8-bit value to add to AnimationIdCurrent.
2103
  /// The unsigned 8-bit value to add to AnimationIdCurrent.
2096
  ///
2104
  ///
2097
  UINT8  SkipCount;
2105
  UINT8    SkipCount;
2098
} EFI_HII_AIBT_SKIP1_BLOCK;
2106
} EFI_HII_AIBT_SKIP1_BLOCK;
2099
2107
2100
///
2108
///
Lines 2104-2116 typedef struct _EFI_HII_AIBT_SKIP2_BLOCK { Link Here
2104
  ///
2112
  ///
2105
  /// The unsigned 16-bit value to add to AnimationIdCurrent.
2113
  /// The unsigned 16-bit value to add to AnimationIdCurrent.
2106
  ///
2114
  ///
2107
  UINT16  SkipCount;
2115
  UINT16    SkipCount;
2108
} EFI_HII_AIBT_SKIP2_BLOCK;
2116
} EFI_HII_AIBT_SKIP2_BLOCK;
2109
2117
2110
#pragma pack()
2118
#pragma pack()
2111
2119
2112
2113
2114
///
2120
///
2115
/// References to string tokens must use this macro to enable scanning for
2121
/// References to string tokens must use this macro to enable scanning for
2116
/// token usages.
2122
/// token usages.
Lines 2119-2130 typedef struct _EFI_HII_AIBT_SKIP2_BLOCK { Link Here
2119
/// STRING_TOKEN is not defined in UEFI specification. But it is placed
2125
/// STRING_TOKEN is not defined in UEFI specification. But it is placed
2120
/// here for the easy access by C files and VFR source files.
2126
/// here for the easy access by C files and VFR source files.
2121
///
2127
///
2122
#define STRING_TOKEN(t) t
2128
#define STRING_TOKEN(t)  t
2123
2129
2124
///
2130
///
2125
/// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
2131
/// IMAGE_TOKEN is not defined in UEFI specification. But it is placed
2126
/// here for the easy access by C files and VFR source files.
2132
/// here for the easy access by C files and VFR source files.
2127
///
2133
///
2128
#define IMAGE_TOKEN(t) t
2134
#define IMAGE_TOKEN(t)  t
2129
2135
2130
#endif
2136
#endif
(-)b/sys/contrib/edk2/Include/Uefi/UefiMultiPhase.h (-18 / +23 lines)
Lines 12-37 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
12
///
12
///
13
/// Attributes of variable.
13
/// Attributes of variable.
14
///
14
///
15
#define EFI_VARIABLE_NON_VOLATILE                            0x00000001
15
#define EFI_VARIABLE_NON_VOLATILE        0x00000001
16
#define EFI_VARIABLE_BOOTSERVICE_ACCESS                      0x00000002
16
#define EFI_VARIABLE_BOOTSERVICE_ACCESS  0x00000002
17
#define EFI_VARIABLE_RUNTIME_ACCESS                          0x00000004
17
#define EFI_VARIABLE_RUNTIME_ACCESS      0x00000004
18
///
18
///
19
/// This attribute is identified by the mnemonic 'HR'
19
/// This attribute is identified by the mnemonic 'HR'
20
/// elsewhere in this specification.
20
/// elsewhere in this specification.
21
///
21
///
22
#define EFI_VARIABLE_HARDWARE_ERROR_RECORD                   0x00000008
22
#define EFI_VARIABLE_HARDWARE_ERROR_RECORD  0x00000008
23
///
23
///
24
/// Attributes of Authenticated Variable
24
/// Attributes of Authenticated Variable
25
///
25
///
26
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS   0x00000020
26
#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS  0x00000020
27
#define EFI_VARIABLE_APPEND_WRITE                            0x00000040
27
#define EFI_VARIABLE_APPEND_WRITE                           0x00000040
28
///
28
///
29
/// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.
29
/// NOTE: EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS is deprecated and should be considered reserved.
30
///
30
///
31
#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS              0x00000010
31
#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS  0x00000010
32
32
33
#ifndef VFRCOMPILE
33
#ifndef VFRCOMPILE
34
#include <Guid/WinCertificate.h>
34
  #include <Guid/WinCertificate.h>
35
///
35
///
36
/// Enumeration of memory types introduced in UEFI.
36
/// Enumeration of memory types introduced in UEFI.
37
///
37
///
Lines 103-108 typedef enum { Link Here
103
  /// however it happens to also support byte-addressable non-volatility.
103
  /// however it happens to also support byte-addressable non-volatility.
104
  ///
104
  ///
105
  EfiPersistentMemory,
105
  EfiPersistentMemory,
106
  ///
107
  /// A memory region that describes system memory that has not been accepted
108
  /// by a corresponding call to the underlying isolation architecture.
109
  ///
110
  EfiUnacceptedMemoryType,
106
  EfiMaxMemoryType
111
  EfiMaxMemoryType
107
} EFI_MEMORY_TYPE;
112
} EFI_MEMORY_TYPE;
108
113
Lines 148-174 typedef struct { Link Here
148
  /// Unique signatures have been generated for the EFI System Table,
153
  /// Unique signatures have been generated for the EFI System Table,
149
  /// the EFI Boot Services Table, and the EFI Runtime Services Table.
154
  /// the EFI Boot Services Table, and the EFI Runtime Services Table.
150
  ///
155
  ///
151
  UINT64  Signature;
156
  UINT64    Signature;
152
  ///
157
  ///
153
  /// The revision of the EFI Specification to which this table
158
  /// The revision of the EFI Specification to which this table
154
  /// conforms. The upper 16 bits of this field contain the major
159
  /// conforms. The upper 16 bits of this field contain the major
155
  /// revision value, and the lower 16 bits contain the minor revision
160
  /// revision value, and the lower 16 bits contain the minor revision
156
  /// value. The minor revision values are limited to the range of 00..99.
161
  /// value. The minor revision values are limited to the range of 00..99.
157
  ///
162
  ///
158
  UINT32  Revision;
163
  UINT32    Revision;
159
  ///
164
  ///
160
  /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
165
  /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
161
  ///
166
  ///
162
  UINT32  HeaderSize;
167
  UINT32    HeaderSize;
163
  ///
168
  ///
164
  /// The 32-bit CRC for the entire table. This value is computed by
169
  /// The 32-bit CRC for the entire table. This value is computed by
165
  /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
170
  /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
166
  ///
171
  ///
167
  UINT32  CRC32;
172
  UINT32    CRC32;
168
  ///
173
  ///
169
  /// Reserved field that must be set to 0.
174
  /// Reserved field that must be set to 0.
170
  ///
175
  ///
171
  UINT32  Reserved;
176
  UINT32    Reserved;
172
} EFI_TABLE_HEADER;
177
} EFI_TABLE_HEADER;
173
178
174
///
179
///
Lines 193-199 typedef struct { Link Here
193
  /// replay. Incremented during each
198
  /// replay. Incremented during each
194
  /// "Write" access.
199
  /// "Write" access.
195
  ///
200
  ///
196
  UINT64                      MonotonicCount;
201
  UINT64    MonotonicCount;
197
  ///
202
  ///
198
  /// Provides the authorization for the variable
203
  /// Provides the authorization for the variable
199
  /// access. It is a signature across the
204
  /// access. It is a signature across the
Lines 202-208 typedef struct { Link Here
202
  /// associated with a public key that has been
207
  /// associated with a public key that has been
203
  /// provisioned via the key exchange.
208
  /// provisioned via the key exchange.
204
  ///
209
  ///
205
  WIN_CERTIFICATE_UEFI_GUID   AuthInfo;
210
  WIN_CERTIFICATE_UEFI_GUID    AuthInfo;
206
} EFI_VARIABLE_AUTHENTICATION;
211
} EFI_VARIABLE_AUTHENTICATION;
207
212
208
///
213
///
Lines 218-229 typedef struct { Link Here
218
  /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
223
  /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
219
  /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
224
  /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
220
  ///
225
  ///
221
  EFI_TIME                    TimeStamp;
226
  EFI_TIME                     TimeStamp;
222
  ///
227
  ///
223
  /// Only a CertType of  EFI_CERT_TYPE_PKCS7_GUID is accepted.
228
  /// Only a CertType of  EFI_CERT_TYPE_PKCS7_GUID is accepted.
224
  ///
229
  ///
225
  WIN_CERTIFICATE_UEFI_GUID   AuthInfo;
230
  WIN_CERTIFICATE_UEFI_GUID    AuthInfo;
226
 } EFI_VARIABLE_AUTHENTICATION_2;
231
} EFI_VARIABLE_AUTHENTICATION_2;
227
#endif // VFRCOMPILE
232
#endif // VFRCOMPILE
228
233
229
#endif
234
#endif
(-)b/sys/contrib/edk2/Include/Uefi/UefiPxe.h (-307 / +301 lines)
Lines 26-40 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
26
///
26
///
27
/// UNDI ROM ID and devive ID signature.
27
/// UNDI ROM ID and devive ID signature.
28
///
28
///
29
#define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')
29
#define PXE_BUSTYPE_PXE  PXE_BUSTYPE ('!', 'P', 'X', 'E')
30
30
31
///
31
///
32
/// BUS ROM ID signatures.
32
/// BUS ROM ID signatures.
33
///
33
///
34
#define PXE_BUSTYPE_PCI     PXE_BUSTYPE ('P', 'C', 'I', 'R')
34
#define PXE_BUSTYPE_PCI      PXE_BUSTYPE ('P', 'C', 'I', 'R')
35
#define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')
35
#define PXE_BUSTYPE_PC_CARD  PXE_BUSTYPE ('P', 'C', 'C', 'R')
36
#define PXE_BUSTYPE_USB     PXE_BUSTYPE ('U', 'S', 'B', 'R')
36
#define PXE_BUSTYPE_USB      PXE_BUSTYPE ('U', 'S', 'B', 'R')
37
#define PXE_BUSTYPE_1394    PXE_BUSTYPE ('1', '3', '9', '4')
37
#define PXE_BUSTYPE_1394     PXE_BUSTYPE ('1', '3', '9', '4')
38
38
39
#define PXE_SWAP_UINT16(n)  ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8))
39
#define PXE_SWAP_UINT16(n)  ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8))
40
40
Lines 54-84 SPDX-License-Identifier: BSD-2-Clause-Patent Link Here
54
   (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \
54
   (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \
55
   (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))
55
   (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))
56
56
57
58
#define PXE_CPBSIZE_NOT_USED  0               ///< zero
57
#define PXE_CPBSIZE_NOT_USED  0               ///< zero
59
#define PXE_DBSIZE_NOT_USED   0               ///< zero
58
#define PXE_DBSIZE_NOT_USED   0               ///< zero
60
#define PXE_CPBADDR_NOT_USED  (PXE_UINT64) 0  ///< zero
59
#define PXE_CPBADDR_NOT_USED  (PXE_UINT64) 0  ///< zero
61
#define PXE_DBADDR_NOT_USED   (PXE_UINT64) 0  ///< zero
60
#define PXE_DBADDR_NOT_USED   (PXE_UINT64) 0  ///< zero
62
#define PXE_CONST             CONST
61
#define PXE_CONST             CONST
63
62
64
#define PXE_VOLATILE          volatile
63
#define PXE_VOLATILE  volatile
65
64
66
typedef VOID           PXE_VOID;
65
typedef VOID    PXE_VOID;
67
typedef UINT8          PXE_UINT8;
66
typedef UINT8   PXE_UINT8;
68
typedef UINT16         PXE_UINT16;
67
typedef UINT16  PXE_UINT16;
69
typedef UINT32         PXE_UINT32;
68
typedef UINT32  PXE_UINT32;
70
typedef UINTN          PXE_UINTN;
69
typedef UINTN   PXE_UINTN;
71
70
72
///
71
///
73
/// Typedef unsigned long PXE_UINT64.
72
/// Typedef unsigned long PXE_UINT64.
74
///
73
///
75
typedef UINT64      PXE_UINT64;
74
typedef UINT64 PXE_UINT64;
76
75
77
typedef PXE_UINT8 PXE_BOOL;
76
typedef PXE_UINT8 PXE_BOOL;
78
#define PXE_FALSE 0            ///< zero
77
#define PXE_FALSE  0           ///< zero
79
#define PXE_TRUE  (!PXE_FALSE)
78
#define PXE_TRUE   (!PXE_FALSE)
80
79
81
typedef PXE_UINT16      PXE_OPCODE;
80
typedef PXE_UINT16 PXE_OPCODE;
82
81
83
///
82
///
84
/// Return UNDI operational state.
83
/// Return UNDI operational state.
Lines 93-99 typedef PXE_UINT16 PXE_OPCODE; Link Here
93
///
92
///
94
/// Change UNDI operational state from Started to Stopped.
93
/// Change UNDI operational state from Started to Stopped.
95
///
94
///
96
#define PXE_OPCODE_STOP 0x0002
95
#define PXE_OPCODE_STOP  0x0002
97
96
98
///
97
///
99
/// Get UNDI initialization information.
98
/// Get UNDI initialization information.
Lines 108-114 typedef PXE_UINT16 PXE_OPCODE; Link Here
108
///
107
///
109
/// Changed UNDI operational state from Started to Initialized.
108
/// Changed UNDI operational state from Started to Initialized.
110
///
109
///
111
#define PXE_OPCODE_INITIALIZE 0x0005
110
#define PXE_OPCODE_INITIALIZE  0x0005
112
111
113
///
112
///
114
/// Re-initialize the NIC H/W.
113
/// Re-initialize the NIC H/W.
Lines 118-124 typedef PXE_UINT16 PXE_OPCODE; Link Here
118
///
117
///
119
/// Change the UNDI operational state from Initialized to Started.
118
/// Change the UNDI operational state from Initialized to Started.
120
///
119
///
121
#define PXE_OPCODE_SHUTDOWN 0x0007
120
#define PXE_OPCODE_SHUTDOWN  0x0007
122
121
123
///
122
///
124
/// Read & change state of external interrupt enables.
123
/// Read & change state of external interrupt enables.
Lines 138-144 typedef PXE_UINT16 PXE_OPCODE; Link Here
138
///
137
///
139
/// Read traffic statistics.
138
/// Read traffic statistics.
140
///
139
///
141
#define PXE_OPCODE_STATISTICS 0x000B
140
#define PXE_OPCODE_STATISTICS  0x000B
142
141
143
///
142
///
144
/// Convert multicast IP address to multicast MAC address.
143
/// Convert multicast IP address to multicast MAC address.
Lines 148-159 typedef PXE_UINT16 PXE_OPCODE; Link Here
148
///
147
///
149
/// Read or change non-volatile storage on the NIC.
148
/// Read or change non-volatile storage on the NIC.
150
///
149
///
151
#define PXE_OPCODE_NVDATA 0x000D
150
#define PXE_OPCODE_NVDATA  0x000D
152
151
153
///
152
///
154
/// Get & clear interrupt status.
153
/// Get & clear interrupt status.
155
///
154
///
156
#define PXE_OPCODE_GET_STATUS 0x000E
155
#define PXE_OPCODE_GET_STATUS  0x000E
157
156
158
///
157
///
159
/// Fill media header in packet for transmit.
158
/// Fill media header in packet for transmit.
Lines 163-169 typedef PXE_UINT16 PXE_OPCODE; Link Here
163
///
162
///
164
/// Transmit packet(s).
163
/// Transmit packet(s).
165
///
164
///
166
#define PXE_OPCODE_TRANSMIT 0x0010
165
#define PXE_OPCODE_TRANSMIT  0x0010
167
166
168
///
167
///
169
/// Receive packet.
168
/// Receive packet.
Lines 173-181 typedef PXE_UINT16 PXE_OPCODE; Link Here
173
///
172
///
174
/// Last valid PXE UNDI OpCode number.
173
/// Last valid PXE UNDI OpCode number.
175
///
174
///
176
#define PXE_OPCODE_LAST_VALID 0x0011
175
#define PXE_OPCODE_LAST_VALID  0x0011
177
176
178
typedef PXE_UINT16  PXE_OPFLAGS;
177
typedef PXE_UINT16 PXE_OPFLAGS;
179
178
180
#define PXE_OPFLAGS_NOT_USED  0x0000
179
#define PXE_OPFLAGS_NOT_USED  0x0000
181
180
Lines 231-246 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
231
/// Select whether to enable or disable external interrupt signals.
230
/// Select whether to enable or disable external interrupt signals.
232
/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
231
/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
233
///
232
///
234
#define PXE_OPFLAGS_INTERRUPT_OPMASK  0xC000
233
#define PXE_OPFLAGS_INTERRUPT_OPMASK   0xC000
235
#define PXE_OPFLAGS_INTERRUPT_ENABLE  0x8000
234
#define PXE_OPFLAGS_INTERRUPT_ENABLE   0x8000
236
#define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000
235
#define PXE_OPFLAGS_INTERRUPT_DISABLE  0x4000
237
#define PXE_OPFLAGS_INTERRUPT_READ    0x0000
236
#define PXE_OPFLAGS_INTERRUPT_READ     0x0000
238
237
239
///
238
///
240
/// Enable receive interrupts.  An external interrupt will be generated
239
/// Enable receive interrupts.  An external interrupt will be generated
241
/// after a complete non-error packet has been received.
240
/// after a complete non-error packet has been received.
242
///
241
///
243
#define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001
242
#define PXE_OPFLAGS_INTERRUPT_RECEIVE  0x0001
244
243
245
///
244
///
246
/// Enable transmit interrupts.  An external interrupt will be generated
245
/// Enable transmit interrupts.  An external interrupt will be generated
Lines 252-258 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
252
/// Enable command interrupts.  An external interrupt will be generated
251
/// Enable command interrupts.  An external interrupt will be generated
253
/// when command execution stops.
252
/// when command execution stops.
254
///
253
///
255
#define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004
254
#define PXE_OPFLAGS_INTERRUPT_COMMAND  0x0004
256
255
257
///
256
///
258
/// Generate software interrupt.  Setting this bit generates an external
257
/// Generate software interrupt.  Setting this bit generates an external
Lines 276-282 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
276
/// To reset the contents of the multicast MAC address filter list,
275
/// To reset the contents of the multicast MAC address filter list,
277
/// set this OpFlag:
276
/// set this OpFlag:
278
///
277
///
279
#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000
278
#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST  0x2000
280
279
281
///
280
///
282
/// Enable unicast packet receiving.  Packets sent to the current station
281
/// Enable unicast packet receiving.  Packets sent to the current station
Lines 295-301 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
295
/// of the multicast MAC addresses in the multicast MAC address filter
294
/// of the multicast MAC addresses in the multicast MAC address filter
296
/// list will be received.  If the filter list is empty, no multicast
295
/// list will be received.  If the filter list is empty, no multicast
297
///
296
///
298
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
297
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST  0x0004
299
298
300
///
299
///
301
/// Enable promiscuous packet receiving.  All packets will be received.
300
/// Enable promiscuous packet receiving.  All packets will be received.
Lines 337-345 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
337
///
336
///
338
/// Select the type of non-volatile data operation.
337
/// Select the type of non-volatile data operation.
339
///
338
///
340
#define PXE_OPFLAGS_NVDATA_OPMASK 0x0001
339
#define PXE_OPFLAGS_NVDATA_OPMASK  0x0001
341
#define PXE_OPFLAGS_NVDATA_READ   0x0000
340
#define PXE_OPFLAGS_NVDATA_READ    0x0000
342
#define PXE_OPFLAGS_NVDATA_WRITE  0x0001
341
#define PXE_OPFLAGS_NVDATA_WRITE   0x0001
343
342
344
///
343
///
345
/// UNDI Get Status.
344
/// UNDI Get Status.
Lines 360-371 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
360
/// buffers.  Do not plan on getting one buffer per interrupt.  Some
359
/// buffers.  Do not plan on getting one buffer per interrupt.  Some
361
/// NICs and UNDIs may transmit multiple buffers per interrupt.
360
/// NICs and UNDIs may transmit multiple buffers per interrupt.
362
///
361
///
363
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
362
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS  0x0002
364
363
365
///
364
///
366
/// Return current media status.
365
/// Return current media status.
367
///
366
///
368
#define PXE_OPFLAGS_GET_MEDIA_STATUS    0x0004
367
#define PXE_OPFLAGS_GET_MEDIA_STATUS  0x0004
369
368
370
///
369
///
371
/// UNDI Fill Header.
370
/// UNDI Fill Header.
Lines 386-394 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
386
#define PXE_OPFLAGS_TRANSMIT_BLOCK          0x0001
385
#define PXE_OPFLAGS_TRANSMIT_BLOCK          0x0001
387
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK     0x0000
386
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK     0x0000
388
387
389
#define PXE_OPFLAGS_TRANSMIT_OPMASK     0x0002
388
#define PXE_OPFLAGS_TRANSMIT_OPMASK      0x0002
390
#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002
389
#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED  0x0002
391
#define PXE_OPFLAGS_TRANSMIT_WHOLE      0x0000
390
#define PXE_OPFLAGS_TRANSMIT_WHOLE       0x0000
392
391
393
///
392
///
394
/// UNDI Receive.
393
/// UNDI Receive.
Lines 399-405 typedef PXE_UINT16 PXE_OPFLAGS; Link Here
399
///
398
///
400
/// PXE STATFLAGS.
399
/// PXE STATFLAGS.
401
///
400
///
402
typedef PXE_UINT16  PXE_STATFLAGS;
401
typedef PXE_UINT16 PXE_STATFLAGS;
403
402
404
#define PXE_STATFLAGS_INITIALIZE  0x0000
403
#define PXE_STATFLAGS_INITIALIZE  0x0000
405
404
Lines 419-428 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
419
///
418
///
420
/// UNDI Get State.
419
/// UNDI Get State.
421
///
420
///
422
#define PXE_STATFLAGS_GET_STATE_MASK        0x0003
421
#define PXE_STATFLAGS_GET_STATE_MASK         0x0003
423
#define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002
422
#define PXE_STATFLAGS_GET_STATE_INITIALIZED  0x0002
424
#define PXE_STATFLAGS_GET_STATE_STARTED     0x0001
423
#define PXE_STATFLAGS_GET_STATE_STARTED      0x0001
425
#define PXE_STATFLAGS_GET_STATE_STOPPED     0x0000
424
#define PXE_STATFLAGS_GET_STATE_STOPPED      0x0000
426
425
427
///
426
///
428
/// UNDI Start.
427
/// UNDI Start.
Lines 462-468 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
462
///
461
///
463
/// If set, receive interrupts are enabled.
462
/// If set, receive interrupts are enabled.
464
///
463
///
465
#define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001
464
#define PXE_STATFLAGS_INTERRUPT_RECEIVE  0x0001
466
465
467
///
466
///
468
/// If set, transmit interrupts are enabled.
467
/// If set, transmit interrupts are enabled.
Lines 472-478 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
472
///
471
///
473
/// If set, command interrupts are enabled.
472
/// If set, command interrupts are enabled.
474
///
473
///
475
#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
474
#define PXE_STATFLAGS_INTERRUPT_COMMAND  0x0004
476
475
477
///
476
///
478
/// UNDI Receive Filters.
477
/// UNDI Receive Filters.
Lines 492-498 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
492
/// If set, multicast packets that match up with the multicast address
491
/// If set, multicast packets that match up with the multicast address
493
/// filter list will be received.
492
/// filter list will be received.
494
///
493
///
495
#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
494
#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST  0x0004
496
495
497
///
496
///
498
/// If set, all packets will be received.
497
/// If set, all packets will be received.
Lines 534-541 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
534
///
533
///
535
/// Use to determine if an interrupt has occurred.
534
/// Use to determine if an interrupt has occurred.
536
///
535
///
537
#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F
536
#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK  0x000F
538
#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS  0x0000
537
#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS   0x0000
539
538
540
///
539
///
541
/// If set, at least one receive interrupt occurred.
540
/// If set, at least one receive interrupt occurred.
Lines 545-551 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
545
///
544
///
546
/// If set, at least one transmit interrupt occurred.
545
/// If set, at least one transmit interrupt occurred.
547
///
546
///
548
#define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002
547
#define PXE_STATFLAGS_GET_STATUS_TRANSMIT  0x0002
549
548
550
///
549
///
551
/// If set, at least one command interrupt occurred.
550
/// If set, at least one command interrupt occurred.
Lines 555-561 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
555
///
554
///
556
/// If set, at least one software interrupt occurred.
555
/// If set, at least one software interrupt occurred.
557
///
556
///
558
#define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008
557
#define PXE_STATFLAGS_GET_STATUS_SOFTWARE  0x0008
559
558
560
///
559
///
561
/// This flag is set if the transmitted buffer queue is empty.  This flag
560
/// This flag is set if the transmitted buffer queue is empty.  This flag
Lines 587-606 typedef PXE_UINT16 PXE_STATFLAGS; Link Here
587
586
588
///
587
///
589
/// UNDI Receive
588
/// UNDI Receive
590
///.
589
/// .
591
590
592
///
591
///
593
/// No additional StatFlags.
592
/// No additional StatFlags.
594
///
593
///
595
typedef PXE_UINT16  PXE_STATCODE;
594
typedef PXE_UINT16 PXE_STATCODE;
596
595
597
#define PXE_STATCODE_INITIALIZE 0x0000
596
#define PXE_STATCODE_INITIALIZE  0x0000
598
597
599
///
598
///
600
/// Common StatCodes returned by all UNDI commands, UNDI protocol functions
599
/// Common StatCodes returned by all UNDI commands, UNDI protocol functions
601
/// and BC protocol functions.
600
/// and BC protocol functions.
602
///
601
///
603
#define PXE_STATCODE_SUCCESS              0x0000
602
#define PXE_STATCODE_SUCCESS  0x0000
604
603
605
#define PXE_STATCODE_INVALID_CDB          0x0001
604
#define PXE_STATCODE_INVALID_CDB          0x0001
606
#define PXE_STATCODE_INVALID_CPB          0x0002
605
#define PXE_STATCODE_INVALID_CPB          0x0002
Lines 622-641 typedef PXE_UINT16 PXE_STATCODE; Link Here
622
#define PXE_STATCODE_NOT_ENOUGH_MEMORY    0x0012
621
#define PXE_STATCODE_NOT_ENOUGH_MEMORY    0x0012
623
#define PXE_STATCODE_NO_DATA              0x0013
622
#define PXE_STATCODE_NO_DATA              0x0013
624
623
625
typedef PXE_UINT16  PXE_IFNUM;
624
typedef PXE_UINT16 PXE_IFNUM;
626
625
627
///
626
///
628
/// This interface number must be passed to the S/W UNDI Start command.
627
/// This interface number must be passed to the S/W UNDI Start command.
629
///
628
///
630
#define PXE_IFNUM_START 0x0000
629
#define PXE_IFNUM_START  0x0000
631
630
632
///
631
///
633
/// This interface number is returned by the S/W UNDI Get State and
632
/// This interface number is returned by the S/W UNDI Get State and
634
/// Start commands if information in the CDB, CPB or DB is invalid.
633
/// Start commands if information in the CDB, CPB or DB is invalid.
635
///
634
///
636
#define PXE_IFNUM_INVALID 0x0000
635
#define PXE_IFNUM_INVALID  0x0000
637
636
638
typedef PXE_UINT16  PXE_CONTROL;
637
typedef PXE_UINT16 PXE_CONTROL;
639
638
640
///
639
///
641
/// Setting this flag directs the UNDI to queue this command for later
640
/// Setting this flag directs the UNDI to queue this command for later
Lines 644-650 typedef PXE_UINT16 PXE_CONTROL; Link Here
644
/// is returned.  If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
643
/// is returned.  If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
645
/// error is returned.
644
/// error is returned.
646
///
645
///
647
#define PXE_CONTROL_QUEUE_IF_BUSY 0x0002
646
#define PXE_CONTROL_QUEUE_IF_BUSY  0x0002
648
647
649
///
648
///
650
/// These two bit values are used to determine if there are more UNDI
649
/// These two bit values are used to determine if there are more UNDI
Lines 656-681 typedef PXE_UINT16 PXE_CONTROL; Link Here
656
#define PXE_CONTROL_LINK              0x0001
655
#define PXE_CONTROL_LINK              0x0001
657
#define PXE_CONTROL_LAST_CDB_IN_LIST  0x0000
656
#define PXE_CONTROL_LAST_CDB_IN_LIST  0x0000
658
657
659
typedef PXE_UINT8   PXE_FRAME_TYPE;
658
typedef PXE_UINT8 PXE_FRAME_TYPE;
660
659
661
#define PXE_FRAME_TYPE_NONE                     0x00
660
#define PXE_FRAME_TYPE_NONE                   0x00
662
#define PXE_FRAME_TYPE_UNICAST                  0x01
661
#define PXE_FRAME_TYPE_UNICAST                0x01
663
#define PXE_FRAME_TYPE_BROADCAST                0x02
662
#define PXE_FRAME_TYPE_BROADCAST              0x02
664
#define PXE_FRAME_TYPE_FILTERED_MULTICAST       0x03
663
#define PXE_FRAME_TYPE_FILTERED_MULTICAST     0x03
665
#define PXE_FRAME_TYPE_PROMISCUOUS              0x04
664
#define PXE_FRAME_TYPE_PROMISCUOUS            0x04
666
#define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST    0x05
665
#define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST  0x05
667
666
668
#define PXE_FRAME_TYPE_MULTICAST                PXE_FRAME_TYPE_FILTERED_MULTICAST
667
#define PXE_FRAME_TYPE_MULTICAST  PXE_FRAME_TYPE_FILTERED_MULTICAST
669
668
670
typedef PXE_UINT32  PXE_IPV4;
669
typedef PXE_UINT32 PXE_IPV4;
671
670
672
typedef PXE_UINT32  PXE_IPV6[4];
671
typedef PXE_UINT32 PXE_IPV6[4];
673
#define PXE_MAC_LENGTH  32
672
#define PXE_MAC_LENGTH  32
674
673
675
typedef PXE_UINT8   PXE_MAC_ADDR[PXE_MAC_LENGTH];
674
typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH];
676
675
677
typedef PXE_UINT8   PXE_IFTYPE;
676
typedef PXE_UINT8 PXE_IFTYPE;
678
typedef UINT16      PXE_MEDIA_PROTOCOL;
677
typedef UINT16    PXE_MEDIA_PROTOCOL;
679
678
680
///
679
///
681
/// This information is from the ARP section of RFC 1700.
680
/// This information is from the ARP section of RFC 1700.
Lines 709-724 typedef UINT16 PXE_MEDIA_PROTOCOL; Link Here
709
#define PXE_IFTYPE_FIBRE_CHANNEL  0x12
708
#define PXE_IFTYPE_FIBRE_CHANNEL  0x12
710
709
711
typedef struct s_pxe_hw_undi {
710
typedef struct s_pxe_hw_undi {
712
  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE.
711
  PXE_UINT32    Signature;      ///< PXE_ROMID_SIGNATURE.
713
  PXE_UINT8   Len;            ///< sizeof(PXE_HW_UNDI).
712
  PXE_UINT8     Len;            ///< sizeof(PXE_HW_UNDI).
714
  PXE_UINT8   Fudge;          ///< makes 8-bit cksum equal zero.
713
  PXE_UINT8     Fudge;          ///< makes 8-bit cksum equal zero.
715
  PXE_UINT8   Rev;            ///< PXE_ROMID_REV.
714
  PXE_UINT8     Rev;            ///< PXE_ROMID_REV.
716
  PXE_UINT8   IFcnt;          ///< physical connector count lower byte.
715
  PXE_UINT8     IFcnt;          ///< physical connector count lower byte.
717
  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.
716
  PXE_UINT8     MajorVer;       ///< PXE_ROMID_MAJORVER.
718
  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.
717
  PXE_UINT8     MinorVer;       ///< PXE_ROMID_MINORVER.
719
  PXE_UINT8   IFcntExt;       ///< physical connector count upper byte.
718
  PXE_UINT8     IFcntExt;       ///< physical connector count upper byte.
720
  PXE_UINT8   reserved;       ///< zero, not used.
719
  PXE_UINT8     reserved;       ///< zero, not used.
721
  PXE_UINT32  Implementation; ///< implementation flags.
720
  PXE_UINT32    Implementation; ///< implementation flags.
722
  ///< reserved             ///< vendor use.
721
  ///< reserved             ///< vendor use.
723
  ///< UINT32 Status;       ///< status port.
722
  ///< UINT32 Status;       ///< status port.
724
  ///< UINT32 Command;      ///< command port.
723
  ///< UINT32 Command;      ///< command port.
Lines 742-773 typedef struct s_pxe_hw_undi { Link Here
742
///
741
///
743
/// If set, last command failed.
742
/// If set, last command failed.
744
///
743
///
745
#define PXE_HWSTAT_COMMAND_FAILED 0x20000000
744
#define PXE_HWSTAT_COMMAND_FAILED  0x20000000
746
745
747
///
746
///
748
/// If set, identifies enabled receive filters.
747
/// If set, identifies enabled receive filters.
749
///
748
///
750
#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000
749
#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED  0x00001000
751
#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED           0x00000800
750
#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED            0x00000800
752
#define PXE_HWSTAT_BROADCAST_RX_ENABLED             0x00000400
751
#define PXE_HWSTAT_BROADCAST_RX_ENABLED              0x00000400
753
#define PXE_HWSTAT_MULTICAST_RX_ENABLED             0x00000200
752
#define PXE_HWSTAT_MULTICAST_RX_ENABLED              0x00000200
754
#define PXE_HWSTAT_UNICAST_RX_ENABLED               0x00000100
753
#define PXE_HWSTAT_UNICAST_RX_ENABLED                0x00000100
755
754
756
///
755
///
757
/// If set, identifies enabled external interrupts.
756
/// If set, identifies enabled external interrupts.
758
///
757
///
759
#define PXE_HWSTAT_SOFTWARE_INT_ENABLED     0x00000080
758
#define PXE_HWSTAT_SOFTWARE_INT_ENABLED      0x00000080
760
#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED  0x00000040
759
#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED   0x00000040
761
#define PXE_HWSTAT_PACKET_RX_INT_ENABLED    0x00000020
760
#define PXE_HWSTAT_PACKET_RX_INT_ENABLED     0x00000020
762
#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010
761
#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED  0x00000010
763
762
764
///
763
///
765
/// If set, identifies pending interrupts.
764
/// If set, identifies pending interrupts.
766
///
765
///
767
#define PXE_HWSTAT_SOFTWARE_INT_PENDING     0x00000008
766
#define PXE_HWSTAT_SOFTWARE_INT_PENDING      0x00000008
768
#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING  0x00000004
767
#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING   0x00000004
769
#define PXE_HWSTAT_PACKET_RX_INT_PENDING    0x00000002
768
#define PXE_HWSTAT_PACKET_RX_INT_PENDING     0x00000002
770
#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
769
#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING  0x00000001
771
770
772
///
771
///
773
/// Command port definitions.
772
/// Command port definitions.
Lines 783-801 typedef struct s_pxe_hw_undi { Link Here
783
///
782
///
784
/// Use these to enable/disable receive filters.
783
/// Use these to enable/disable receive filters.
785
///
784
///
786
#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000
785
#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE  0x00001000
787
#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE           0x00000800
786
#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE            0x00000800
788
#define PXE_HWCMD_BROADCAST_RX_ENABLE             0x00000400
787
#define PXE_HWCMD_BROADCAST_RX_ENABLE              0x00000400
789
#define PXE_HWCMD_MULTICAST_RX_ENABLE             0x00000200
788
#define PXE_HWCMD_MULTICAST_RX_ENABLE              0x00000200
790
#define PXE_HWCMD_UNICAST_RX_ENABLE               0x00000100
789
#define PXE_HWCMD_UNICAST_RX_ENABLE                0x00000100
791
790
792
///
791
///
793
/// Use these to enable/disable external interrupts.
792
/// Use these to enable/disable external interrupts.
794
///
793
///
795
#define PXE_HWCMD_SOFTWARE_INT_ENABLE     0x00000080
794
#define PXE_HWCMD_SOFTWARE_INT_ENABLE      0x00000080
796
#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE  0x00000040
795
#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE   0x00000040
797
#define PXE_HWCMD_PACKET_RX_INT_ENABLE    0x00000020
796
#define PXE_HWCMD_PACKET_RX_INT_ENABLE     0x00000020
798
#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010
797
#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE  0x00000010
799
798
800
///
799
///
801
/// Use these to clear pending external interrupts.
800
/// Use these to clear pending external interrupts.
Lines 806-849 typedef struct s_pxe_hw_undi { Link Here
806
#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT  0x00000001
805
#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT  0x00000001
807
806
808
typedef struct s_pxe_sw_undi {
807
typedef struct s_pxe_sw_undi {
809
  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE.
808
  PXE_UINT32    Signature;      ///< PXE_ROMID_SIGNATURE.
810
  PXE_UINT8   Len;            ///< sizeof(PXE_SW_UNDI).
809
  PXE_UINT8     Len;            ///< sizeof(PXE_SW_UNDI).
811
  PXE_UINT8   Fudge;          ///< makes 8-bit cksum zero.
810
  PXE_UINT8     Fudge;          ///< makes 8-bit cksum zero.
812
  PXE_UINT8   Rev;            ///< PXE_ROMID_REV.
811
  PXE_UINT8     Rev;            ///< PXE_ROMID_REV.
813
  PXE_UINT8   IFcnt;          ///< physical connector count lower byte.
812
  PXE_UINT8     IFcnt;          ///< physical connector count lower byte.
814
  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.
813
  PXE_UINT8     MajorVer;       ///< PXE_ROMID_MAJORVER.
815
  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.
814
  PXE_UINT8     MinorVer;       ///< PXE_ROMID_MINORVER.
816
  PXE_UINT8   IFcntExt;       ///< physical connector count upper byte.
815
  PXE_UINT8     IFcntExt;       ///< physical connector count upper byte.
817
  PXE_UINT8   reserved1;      ///< zero, not used.
816
  PXE_UINT8     reserved1;      ///< zero, not used.
818
  PXE_UINT32  Implementation; ///< Implementation flags.
817
  PXE_UINT32    Implementation; ///< Implementation flags.
819
  PXE_UINT64  EntryPoint;     ///< API entry point.
818
  PXE_UINT64    EntryPoint;     ///< API entry point.
820
  PXE_UINT8   reserved2[3];   ///< zero, not used.
819
  PXE_UINT8     reserved2[3];   ///< zero, not used.
821
  PXE_UINT8   BusCnt;         ///< number of bustypes supported.
820
  PXE_UINT8     BusCnt;         ///< number of bustypes supported.
822
  PXE_UINT32  BusType[1];     ///< list of supported bustypes.
821
  PXE_UINT32    BusType[1];     ///< list of supported bustypes.
823
} PXE_SW_UNDI;
822
} PXE_SW_UNDI;
824
823
825
typedef union u_pxe_undi {
824
typedef union u_pxe_undi {
826
  PXE_HW_UNDI hw;
825
  PXE_HW_UNDI    hw;
827
  PXE_SW_UNDI sw;
826
  PXE_SW_UNDI    sw;
828
} PXE_UNDI;
827
} PXE_UNDI;
829
828
830
///
829
///
831
/// Signature of !PXE structure.
830
/// Signature of !PXE structure.
832
///
831
///
833
#define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')
832
#define PXE_ROMID_SIGNATURE  PXE_BUSTYPE ('!', 'P', 'X', 'E')
834
833
835
///
834
///
836
/// !PXE structure format revision
835
/// !PXE structure format revision
837
///.
836
/// .
838
#define PXE_ROMID_REV 0x02
837
#define PXE_ROMID_REV  0x02
839
838
840
///
839
///
841
/// UNDI command interface revision.  These are the values that get sent
840
/// UNDI command interface revision.  These are the values that get sent
842
/// in option 94 (Client Network Interface Identifier) in the DHCP Discover
841
/// in option 94 (Client Network Interface Identifier) in the DHCP Discover
843
/// and PXE Boot Server Request packets.
842
/// and PXE Boot Server Request packets.
844
///
843
///
845
#define PXE_ROMID_MAJORVER    0x03
844
#define PXE_ROMID_MAJORVER  0x03
846
#define PXE_ROMID_MINORVER    0x01
845
#define PXE_ROMID_MINORVER  0x01
847
846
848
///
847
///
849
/// Implementation flags.
848
/// Implementation flags.
Lines 872-892 typedef union u_pxe_undi { Link Here
872
#define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED          0x00000001
871
#define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED          0x00000001
873
872
874
typedef struct s_pxe_cdb {
873
typedef struct s_pxe_cdb {
875
  PXE_OPCODE    OpCode;
874
  PXE_OPCODE       OpCode;
876
  PXE_OPFLAGS   OpFlags;
875
  PXE_OPFLAGS      OpFlags;
877
  PXE_UINT16    CPBsize;
876
  PXE_UINT16       CPBsize;
878
  PXE_UINT16    DBsize;
877
  PXE_UINT16       DBsize;
879
  PXE_UINT64    CPBaddr;
878
  PXE_UINT64       CPBaddr;
880
  PXE_UINT64    DBaddr;
879
  PXE_UINT64       DBaddr;
881
  PXE_STATCODE  StatCode;
880
  PXE_STATCODE     StatCode;
882
  PXE_STATFLAGS StatFlags;
881
  PXE_STATFLAGS    StatFlags;
883
  PXE_UINT16    IFnum;
882
  PXE_UINT16       IFnum;
884
  PXE_CONTROL   Control;
883
  PXE_CONTROL      Control;
885
} PXE_CDB;
884
} PXE_CDB;
886
885
887
typedef union u_pxe_ip_addr {
886
typedef union u_pxe_ip_addr {
888
  PXE_IPV6  IPv6;
887
  PXE_IPV6    IPv6;
889
  PXE_IPV4  IPv4;
888
  PXE_IPV4    IPv4;
890
} PXE_IP_ADDR;
889
} PXE_IP_ADDR;
891
890
892
typedef union pxe_device {
891
typedef union pxe_device {
Lines 901-926 typedef union pxe_device { Link Here
901
    /// See S/W UNDI ROMID structure definition for PCI and
900
    /// See S/W UNDI ROMID structure definition for PCI and
902
    /// PCC BusType definitions.
901
    /// PCC BusType definitions.
903
    ///
902
    ///
904
    PXE_UINT32  BusType;
903
    PXE_UINT32    BusType;
905
904
906
    ///
905
    ///
907
    /// Bus, device & function numbers that locate this device.
906
    /// Bus, device & function numbers that locate this device.
908
    ///
907
    ///
909
    PXE_UINT16  Bus;
908
    PXE_UINT16    Bus;
910
    PXE_UINT8   Device;
909
    PXE_UINT8     Device;
911
    PXE_UINT8   Function;
910
    PXE_UINT8     Function;
912
  }
911
  } PCI, PCC;
913
  PCI, PCC;
914
915
} PXE_DEVICE;
912
} PXE_DEVICE;
916
913
917
///
914
///
918
/// cpb and db definitions
915
/// cpb and db definitions
919
///
916
///
920
#define MAX_PCI_CONFIG_LEN    64  ///< # of dwords.
917
#define MAX_PCI_CONFIG_LEN     64  ///< # of dwords.
921
#define MAX_EEPROM_LEN        128 ///< # of dwords.
918
#define MAX_EEPROM_LEN         128 ///< # of dwords.
922
#define MAX_XMIT_BUFFERS      32  ///< recycling Q length for xmit_done.
919
#define MAX_XMIT_BUFFERS       32  ///< recycling Q length for xmit_done.
923
#define MAX_MCAST_ADDRESS_CNT 8
920
#define MAX_MCAST_ADDRESS_CNT  8
924
921
925
typedef struct s_pxe_cpb_start_30 {
922
typedef struct s_pxe_cpb_start_30 {
926
  ///
923
  ///
Lines 933-939 typedef struct s_pxe_cpb_start_30 { Link Here
933
  ///
930
  ///
934
  /// This field cannot be set to zero.
931
  /// This field cannot be set to zero.
935
  ///
932
  ///
936
  UINT64  Delay;
933
  UINT64    Delay;
937
934
938
  ///
935
  ///
939
  /// PXE_VOID Block(UINT32 enable);
936
  /// PXE_VOID Block(UINT32 enable);
Lines 949-955 typedef struct s_pxe_cpb_start_30 { Link Here
949
  ///
946
  ///
950
  /// This field cannot be set to zero.
947
  /// This field cannot be set to zero.
951
  ///
948
  ///
952
  UINT64  Block;
949
  UINT64    Block;
953
950
954
  ///
951
  ///
955
  /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);
952
  /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);
Lines 963-969 typedef struct s_pxe_cpb_start_30 { Link Here
963
  /// This field can be set to zero if virtual and physical addresses
960
  /// This field can be set to zero if virtual and physical addresses
964
  /// are equal.
961
  /// are equal.
965
  ///
962
  ///
966
  UINT64  Virt2Phys;
963
  UINT64    Virt2Phys;
967
  ///
964
  ///
968
  /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,
965
  /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,
969
  ///              UINT64 buf_addr);
966
  ///              UINT64 buf_addr);
Lines 974-980 typedef struct s_pxe_cpb_start_30 { Link Here
974
  ///
971
  ///
975
  /// This field can not be set to zero.
972
  /// This field can not be set to zero.
976
  ///
973
  ///
977
  UINT64  Mem_IO;
974
  UINT64    Mem_IO;
978
} PXE_CPB_START_30;
975
} PXE_CPB_START_30;
979
976
980
typedef struct s_pxe_cpb_start_31 {
977
typedef struct s_pxe_cpb_start_31 {
Lines 988-994 typedef struct s_pxe_cpb_start_31 { Link Here
988
  ///
985
  ///
989
  /// This field cannot be set to zero.
986
  /// This field cannot be set to zero.
990
  ///
987
  ///
991
  UINT64  Delay;
988
  UINT64    Delay;
992
989
993
  ///
990
  ///
994
  /// PXE_VOID Block(UINT64 unq_id, UINT32 enable);
991
  /// PXE_VOID Block(UINT64 unq_id, UINT32 enable);
Lines 1004-1010 typedef struct s_pxe_cpb_start_31 { Link Here
1004
  ///
1001
  ///
1005
  /// This field cannot be set to zero.
1002
  /// This field cannot be set to zero.
1006
  ///
1003
  ///
1007
  UINT64  Block;
1004
  UINT64    Block;
1008
1005
1009
  ///
1006
  ///
1010
  /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);
1007
  /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);
Lines 1018-1024 typedef struct s_pxe_cpb_start_31 { Link Here
1018
  /// This field can be set to zero if virtual and physical addresses
1015
  /// This field can be set to zero if virtual and physical addresses
1019
  /// are equal.
1016
  /// are equal.
1020
  ///
1017
  ///
1021
  UINT64  Virt2Phys;
1018
  UINT64    Virt2Phys;
1022
  ///
1019
  ///
1023
  /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,
1020
  /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,
1024
  ///              UINT64 buf_addr);
1021
  ///              UINT64 buf_addr);
Lines 1029-1035 typedef struct s_pxe_cpb_start_31 { Link Here
1029
  ///
1026
  ///
1030
  /// This field can not be set to zero.
1027
  /// This field can not be set to zero.
1031
  ///
1028
  ///
1032
  UINT64  Mem_IO;
1029
  UINT64    Mem_IO;
1033
  ///
1030
  ///
1034
  /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
1031
  /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
1035
  ///                 UINT32 Direction, UINT64 mapped_addr);
1032
  ///                 UINT32 Direction, UINT64 mapped_addr);
Lines 1046-1052 typedef struct s_pxe_cpb_start_31 { Link Here
1046
  ///
1043
  ///
1047
  /// This field can be set to zero if there is no mapping service available.
1044
  /// This field can be set to zero if there is no mapping service available.
1048
  ///
1045
  ///
1049
  UINT64  Map_Mem;
1046
  UINT64    Map_Mem;
1050
1047
1051
  ///
1048
  ///
1052
  /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
1049
  /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
Lines 1057-1063 typedef struct s_pxe_cpb_start_31 { Link Here
1057
  ///
1054
  ///
1058
  /// This field can be set to zero if there is no unmapping service available.
1055
  /// This field can be set to zero if there is no unmapping service available.
1059
  ///
1056
  ///
1060
  UINT64  UnMap_Mem;
1057
  UINT64    UnMap_Mem;
1061
1058
1062
  ///
1059
  ///
1063
  /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,
1060
  /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,
Lines 1069-1075 typedef struct s_pxe_cpb_start_31 { Link Here
1069
  ///
1066
  ///
1070
  /// This field can be set to zero if there is no service available.
1067
  /// This field can be set to zero if there is no service available.
1071
  ///
1068
  ///
1072
  UINT64  Sync_Mem;
1069
  UINT64    Sync_Mem;
1073
1070
1074
  ///
1071
  ///
1075
  /// protocol driver can provide anything for this Unique_ID, UNDI remembers
1072
  /// protocol driver can provide anything for this Unique_ID, UNDI remembers
Lines 1077-1095 typedef struct s_pxe_cpb_start_31 { Link Here
1077
  /// the ifnum and gives it back as a parameter to all the call-back routines
1074
  /// the ifnum and gives it back as a parameter to all the call-back routines
1078
  /// when calling for that interface!
1075
  /// when calling for that interface!
1079
  ///
1076
  ///
1080
  UINT64  Unique_ID;
1077
  UINT64    Unique_ID;
1081
} PXE_CPB_START_31;
1078
} PXE_CPB_START_31;
1082
1079
1083
#define TO_AND_FROM_DEVICE    0
1080
#define TO_AND_FROM_DEVICE  0
1084
#define FROM_DEVICE           1
1081
#define FROM_DEVICE         1
1085
#define TO_DEVICE             2
1082
#define TO_DEVICE           2
1086
1083
1087
#define PXE_DELAY_MILLISECOND 1000
1084
#define PXE_DELAY_MILLISECOND  1000
1088
#define PXE_DELAY_SECOND      1000000
1085
#define PXE_DELAY_SECOND       1000000
1089
#define PXE_IO_READ           0
1086
#define PXE_IO_READ            0
1090
#define PXE_IO_WRITE          1
1087
#define PXE_IO_WRITE           1
1091
#define PXE_MEM_READ          2
1088
#define PXE_MEM_READ           2
1092
#define PXE_MEM_WRITE         4
1089
#define PXE_MEM_WRITE          4
1093
1090
1094
typedef struct s_pxe_db_get_init_info {
1091
typedef struct s_pxe_db_get_init_info {
1095
  ///
1092
  ///
Lines 1100-1146 typedef struct s_pxe_db_get_init_info { Link Here
1100
  /// If MemoryRequired is zero, the UNDI does not need and will not
1097
  /// If MemoryRequired is zero, the UNDI does not need and will not
1101
  /// use system memory to receive and transmit packets.
1098
  /// use system memory to receive and transmit packets.
1102
  ///
1099
  ///
1103
  PXE_UINT32  MemoryRequired;
1100
  PXE_UINT32    MemoryRequired;
1104
1101
1105
  ///
1102
  ///
1106
  /// Maximum frame data length for Tx/Rx excluding the media header.
1103
  /// Maximum frame data length for Tx/Rx excluding the media header.
1107
  ///
1104
  ///
1108
  PXE_UINT32  FrameDataLen;
1105
  PXE_UINT32    FrameDataLen;
1109
1106
1110
  ///
1107
  ///
1111
  /// Supported link speeds are in units of mega bits.  Common ethernet
1108
  /// Supported link speeds are in units of mega bits.  Common ethernet
1112
  /// values are 10, 100 and 1000.  Unused LinkSpeeds[] entries are zero
1109
  /// values are 10, 100 and 1000.  Unused LinkSpeeds[] entries are zero
1113
  /// filled.
1110
  /// filled.
1114
  ///
1111
  ///
1115
  PXE_UINT32  LinkSpeeds[4];
1112
  PXE_UINT32    LinkSpeeds[4];
1116
1113
1117
  ///
1114
  ///
1118
  /// Number of non-volatile storage items.
1115
  /// Number of non-volatile storage items.
1119
  ///
1116
  ///
1120
  PXE_UINT32  NvCount;
1117
  PXE_UINT32    NvCount;
1121
1118
1122
  ///
1119
  ///
1123
  /// Width of non-volatile storage item in bytes.  0, 1, 2 or 4
1120
  /// Width of non-volatile storage item in bytes.  0, 1, 2 or 4
1124
  ///
1121
  ///
1125
  PXE_UINT16  NvWidth;
1122
  PXE_UINT16    NvWidth;
1126
1123
1127
  ///
1124
  ///
1128
  /// Media header length.  This is the typical media header length for
1125
  /// Media header length.  This is the typical media header length for
1129
  /// this UNDI.  This information is needed when allocating receive
1126
  /// this UNDI.  This information is needed when allocating receive
1130
  /// and transmit buffers.
1127
  /// and transmit buffers.
1131
  ///
1128
  ///
1132
  PXE_UINT16  MediaHeaderLen;
1129
  PXE_UINT16    MediaHeaderLen;
1133
1130
1134
  ///
1131
  ///
1135
  /// Number of bytes in the NIC hardware (MAC) address.
1132
  /// Number of bytes in the NIC hardware (MAC) address.
1136
  ///
1133
  ///
1137
  PXE_UINT16  HWaddrLen;
1134
  PXE_UINT16    HWaddrLen;
1138
1135
1139
  ///
1136
  ///
1140
  /// Maximum number of multicast MAC addresses in the multicast
1137
  /// Maximum number of multicast MAC addresses in the multicast
1141
  /// MAC address filter list.
1138
  /// MAC address filter list.
1142
  ///
1139
  ///
1143
  PXE_UINT16  MCastFilterCnt;
1140
  PXE_UINT16    MCastFilterCnt;
1144
1141
1145
  ///
1142
  ///
1146
  /// Default number and size of transmit and receive buffers that will
1143
  /// Default number and size of transmit and receive buffers that will
Lines 1149-1211 typedef struct s_pxe_db_get_init_info { Link Here
1149
  /// command.  If MemoryRequired is zero, this allocation will come out of
1146
  /// command.  If MemoryRequired is zero, this allocation will come out of
1150
  /// memory on the NIC.
1147
  /// memory on the NIC.
1151
  ///
1148
  ///
1152
  PXE_UINT16  TxBufCnt;
1149
  PXE_UINT16    TxBufCnt;
1153
  PXE_UINT16  TxBufSize;
1150
  PXE_UINT16    TxBufSize;
1154
  PXE_UINT16  RxBufCnt;
1151
  PXE_UINT16    RxBufCnt;
1155
  PXE_UINT16  RxBufSize;
1152
  PXE_UINT16    RxBufSize;
1156
1153
1157
  ///
1154
  ///
1158
  /// Hardware interface types defined in the Assigned Numbers RFC
1155
  /// Hardware interface types defined in the Assigned Numbers RFC
1159
  /// and used in DHCP and ARP packets.
1156
  /// and used in DHCP and ARP packets.
1160
  /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
1157
  /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
1161
  ///
1158
  ///
1162
  PXE_UINT8   IFtype;
1159
  PXE_UINT8     IFtype;
1163
1160
1164
  ///
1161
  ///
1165
  /// Supported duplex.  See PXE_DUPLEX_xxxxx #defines below.
1162
  /// Supported duplex.  See PXE_DUPLEX_xxxxx #defines below.
1166
  ///
1163
  ///
1167
  PXE_UINT8   SupportedDuplexModes;
1164
  PXE_UINT8     SupportedDuplexModes;
1168
1165
1169
  ///
1166
  ///
1170
  /// Supported loopback options.  See PXE_LOOPBACK_xxxxx #defines below.
1167
  /// Supported loopback options.  See PXE_LOOPBACK_xxxxx #defines below.
1171
  ///
1168
  ///
1172
  PXE_UINT8   SupportedLoopBackModes;
1169
  PXE_UINT8     SupportedLoopBackModes;
1173
} PXE_DB_GET_INIT_INFO;
1170
} PXE_DB_GET_INIT_INFO;
1174
1171
1175
#define PXE_MAX_TXRX_UNIT_ETHER           1500
1172
#define PXE_MAX_TXRX_UNIT_ETHER  1500
1176
1173
1177
#define PXE_HWADDR_LEN_ETHER              0x0006
1174
#define PXE_HWADDR_LEN_ETHER      0x0006
1178
#define PXE_MAC_HEADER_LEN_ETHER          0x000E
1175
#define PXE_MAC_HEADER_LEN_ETHER  0x000E
1179
1176
1180
#define PXE_DUPLEX_ENABLE_FULL_SUPPORTED  1
1177
#define PXE_DUPLEX_ENABLE_FULL_SUPPORTED  1
1181
#define PXE_DUPLEX_FORCE_FULL_SUPPORTED   2
1178
#define PXE_DUPLEX_FORCE_FULL_SUPPORTED   2
1182
1179
1183
#define PXE_LOOPBACK_INTERNAL_SUPPORTED   1
1180
#define PXE_LOOPBACK_INTERNAL_SUPPORTED  1
1184
#define PXE_LOOPBACK_EXTERNAL_SUPPORTED   2
1181
#define PXE_LOOPBACK_EXTERNAL_SUPPORTED  2
1185
1182
1186
typedef struct s_pxe_pci_config_info {
1183
typedef struct s_pxe_pci_config_info {
1187
  ///
1184
  ///
1188
  /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1185
  /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1189
  /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
1186
  /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
1190
  ///
1187
  ///
1191
  UINT32  BusType;
1188
  UINT32    BusType;
1192
1189
1193
  ///
1190
  ///
1194
  /// This identifies the PCI network device that this UNDI interface.
1191
  /// This identifies the PCI network device that this UNDI interface.
1195
  /// is bound to.
1192
  /// is bound to.
1196
  ///
1193
  ///
1197
  UINT16  Bus;
1194
  UINT16    Bus;
1198
  UINT8   Device;
1195
  UINT8     Device;
1199
  UINT8   Function;
1196
  UINT8     Function;
1200
1197
1201
  ///
1198
  ///
1202
  /// This is a copy of the PCI configuration space for this
1199
  /// This is a copy of the PCI configuration space for this
1203
  /// network device.
1200
  /// network device.
1204
  ///
1201
  ///
1205
  union {
1202
  union {
1206
    UINT8   Byte[256];
1203
    UINT8     Byte[256];
1207
    UINT16  Word[128];
1204
    UINT16    Word[128];
1208
    UINT32  Dword[64];
1205
    UINT32    Dword[64];
1209
  } Config;
1206
  } Config;
1210
} PXE_PCI_CONFIG_INFO;
1207
} PXE_PCI_CONFIG_INFO;
1211
1208
Lines 1214-1243 typedef struct s_pxe_pcc_config_info { Link Here
1214
  /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1211
  /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
1215
  /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
1212
  /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
1216
  ///
1213
  ///
1217
  PXE_UINT32  BusType;
1214
  PXE_UINT32    BusType;
1218
1215
1219
  ///
1216
  ///
1220
  /// This identifies the PCC network device that this UNDI interface
1217
  /// This identifies the PCC network device that this UNDI interface
1221
  /// is bound to.
1218
  /// is bound to.
1222
  ///
1219
  ///
1223
  PXE_UINT16  Bus;
1220
  PXE_UINT16    Bus;
1224
  PXE_UINT8   Device;
1221
  PXE_UINT8     Device;
1225
  PXE_UINT8   Function;
1222
  PXE_UINT8     Function;
1226
1223
1227
  ///
1224
  ///
1228
  /// This is a copy of the PCC configuration space for this
1225
  /// This is a copy of the PCC configuration space for this
1229
  /// network device.
1226
  /// network device.
1230
  ///
1227
  ///
1231
  union {
1228
  union {
1232
    PXE_UINT8   Byte[256];
1229
    PXE_UINT8     Byte[256];
1233
    PXE_UINT16  Word[128];
1230
    PXE_UINT16    Word[128];
1234
    PXE_UINT32  Dword[64];
1231
    PXE_UINT32    Dword[64];
1235
  } Config;
1232
  } Config;
1236
} PXE_PCC_CONFIG_INFO;
1233
} PXE_PCC_CONFIG_INFO;
1237
1234
1238
typedef union u_pxe_db_get_config_info {
1235
typedef union u_pxe_db_get_config_info {
1239
  PXE_PCI_CONFIG_INFO   pci;
1236
  PXE_PCI_CONFIG_INFO    pci;
1240
  PXE_PCC_CONFIG_INFO   pcc;
1237
  PXE_PCC_CONFIG_INFO    pcc;
1241
} PXE_DB_GET_CONFIG_INFO;
1238
} PXE_DB_GET_CONFIG_INFO;
1242
1239
1243
typedef struct s_pxe_cpb_initialize {
1240
typedef struct s_pxe_cpb_initialize {
Lines 1246-1265 typedef struct s_pxe_cpb_initialize { Link Here
1246
  /// be in contiguous physical memory and cannot be swapped out.  The UNDI
1243
  /// be in contiguous physical memory and cannot be swapped out.  The UNDI
1247
  /// will be using this for transmit and receive buffering.
1244
  /// will be using this for transmit and receive buffering.
1248
  ///
1245
  ///
1249
  PXE_UINT64  MemoryAddr;
1246
  PXE_UINT64    MemoryAddr;
1250
1247
1251
  ///
1248
  ///
1252
  /// MemoryLength must be greater than or equal to MemoryRequired
1249
  /// MemoryLength must be greater than or equal to MemoryRequired
1253
  /// returned by the Get Init Info command.
1250
  /// returned by the Get Init Info command.
1254
  ///
1251
  ///
1255
  PXE_UINT32  MemoryLength;
1252
  PXE_UINT32    MemoryLength;
1256
1253
1257
  ///
1254
  ///
1258
  /// Desired link speed in Mbit/sec.  Common ethernet values are 10, 100
1255
  /// Desired link speed in Mbit/sec.  Common ethernet values are 10, 100
1259
  /// and 1000.  Setting a value of zero will auto-detect and/or use the
1256
  /// and 1000.  Setting a value of zero will auto-detect and/or use the
1260
  /// default link speed (operation depends on UNDI/NIC functionality).
1257
  /// default link speed (operation depends on UNDI/NIC functionality).
1261
  ///
1258
  ///
1262
  PXE_UINT32  LinkSpeed;
1259
  PXE_UINT32    LinkSpeed;
1263
1260
1264
  ///
1261
  ///
1265
  /// Suggested number and size of receive and transmit buffers to
1262
  /// Suggested number and size of receive and transmit buffers to
Lines 1271-1299 typedef struct s_pxe_cpb_initialize { Link Here
1271
  /// If these fields are set to zero, the UNDI will allocate buffer
1268
  /// If these fields are set to zero, the UNDI will allocate buffer
1272
  /// counts and sizes as it sees fit.
1269
  /// counts and sizes as it sees fit.
1273
  ///
1270
  ///
1274
  PXE_UINT16  TxBufCnt;
1271
  PXE_UINT16    TxBufCnt;
1275
  PXE_UINT16  TxBufSize;
1272
  PXE_UINT16    TxBufSize;
1276
  PXE_UINT16  RxBufCnt;
1273
  PXE_UINT16    RxBufCnt;
1277
  PXE_UINT16  RxBufSize;
1274
  PXE_UINT16    RxBufSize;
1278
1275
1279
  ///
1276
  ///
1280
  /// The following configuration parameters are optional and must be zero
1277
  /// The following configuration parameters are optional and must be zero
1281
  /// to use the default values.
1278
  /// to use the default values.
1282
  ///
1279
  ///
1283
  PXE_UINT8   DuplexMode;
1280
  PXE_UINT8     DuplexMode;
1284
1281
1285
  PXE_UINT8   LoopBackMode;
1282
  PXE_UINT8     LoopBackMode;
1286
} PXE_CPB_INITIALIZE;
1283
} PXE_CPB_INITIALIZE;
1287
1284
1288
#define PXE_DUPLEX_DEFAULT      0x00
1285
#define PXE_DUPLEX_DEFAULT       0x00
1289
#define PXE_FORCE_FULL_DUPLEX   0x01
1286
#define PXE_FORCE_FULL_DUPLEX    0x01
1290
#define PXE_ENABLE_FULL_DUPLEX  0x02
1287
#define PXE_ENABLE_FULL_DUPLEX   0x02
1291
#define PXE_FORCE_HALF_DUPLEX   0x04
1288
#define PXE_FORCE_HALF_DUPLEX    0x04
1292
#define PXE_DISABLE_FULL_DUPLEX 0x08
1289
#define PXE_DISABLE_FULL_DUPLEX  0x08
1293
1290
1294
#define LOOPBACK_NORMAL         0
1291
#define LOOPBACK_NORMAL    0
1295
#define LOOPBACK_INTERNAL       1
1292
#define LOOPBACK_INTERNAL  1
1296
#define LOOPBACK_EXTERNAL       2
1293
#define LOOPBACK_EXTERNAL  2
1297
1294
1298
typedef struct s_pxe_db_initialize {
1295
typedef struct s_pxe_db_initialize {
1299
  ///
1296
  ///
Lines 1304-1319 typedef struct s_pxe_db_initialize { Link Here
1304
  /// Memory used by the UNDI and network device is allocated from the
1301
  /// Memory used by the UNDI and network device is allocated from the
1305
  /// lowest memory buffer address.
1302
  /// lowest memory buffer address.
1306
  ///
1303
  ///
1307
  PXE_UINT32  MemoryUsed;
1304
  PXE_UINT32    MemoryUsed;
1308
1305
1309
  ///
1306
  ///
1310
  /// Actual number and size of receive and transmit buffers that were
1307
  /// Actual number and size of receive and transmit buffers that were
1311
  /// allocated.
1308
  /// allocated.
1312
  ///
1309
  ///
1313
  PXE_UINT16  TxBufCnt;
1310
  PXE_UINT16    TxBufCnt;
1314
  PXE_UINT16  TxBufSize;
1311
  PXE_UINT16    TxBufSize;
1315
  PXE_UINT16  RxBufCnt;
1312
  PXE_UINT16    RxBufCnt;
1316
  PXE_UINT16  RxBufSize;
1313
  PXE_UINT16    RxBufSize;
1317
} PXE_DB_INITIALIZE;
1314
} PXE_DB_INITIALIZE;
1318
1315
1319
typedef struct s_pxe_cpb_receive_filters {
1316
typedef struct s_pxe_cpb_receive_filters {
Lines 1321-1334 typedef struct s_pxe_cpb_receive_filters { Link Here
1321
  /// List of multicast MAC addresses.  This list, if present, will
1318
  /// List of multicast MAC addresses.  This list, if present, will
1322
  /// replace the existing multicast MAC address filter list.
1319
  /// replace the existing multicast MAC address filter list.
1323
  ///
1320
  ///
1324
  PXE_MAC_ADDR  MCastList[MAX_MCAST_ADDRESS_CNT];
1321
  PXE_MAC_ADDR    MCastList[MAX_MCAST_ADDRESS_CNT];
1325
} PXE_CPB_RECEIVE_FILTERS;
1322
} PXE_CPB_RECEIVE_FILTERS;
1326
1323
1327
typedef struct s_pxe_db_receive_filters {
1324
typedef struct s_pxe_db_receive_filters {
1328
  ///
1325
  ///
1329
  /// Filtered multicast MAC address list.
1326
  /// Filtered multicast MAC address list.
1330
  ///
1327
  ///
1331
  PXE_MAC_ADDR  MCastList[MAX_MCAST_ADDRESS_CNT];
1328
  PXE_MAC_ADDR    MCastList[MAX_MCAST_ADDRESS_CNT];
1332
} PXE_DB_RECEIVE_FILTERS;
1329
} PXE_DB_RECEIVE_FILTERS;
1333
1330
1334
typedef struct s_pxe_cpb_station_address {
1331
typedef struct s_pxe_cpb_station_address {
Lines 1336-1359 typedef struct s_pxe_cpb_station_address { Link Here
1336
  /// If supplied and supported, the current station MAC address
1333
  /// If supplied and supported, the current station MAC address
1337
  /// will be changed.
1334
  /// will be changed.
1338
  ///
1335
  ///
1339
  PXE_MAC_ADDR  StationAddr;
1336
  PXE_MAC_ADDR    StationAddr;
1340
} PXE_CPB_STATION_ADDRESS;
1337
} PXE_CPB_STATION_ADDRESS;
1341
1338
1342
typedef struct s_pxe_dpb_station_address {
1339
typedef struct s_pxe_dpb_station_address {
1343
  ///
1340
  ///
1344
  /// Current station MAC address.
1341
  /// Current station MAC address.
1345
  ///
1342
  ///
1346
  PXE_MAC_ADDR  StationAddr;
1343
  PXE_MAC_ADDR    StationAddr;
1347
1344
1348
  ///
1345
  ///
1349
  /// Station broadcast MAC address.
1346
  /// Station broadcast MAC address.
1350
  ///
1347
  ///
1351
  PXE_MAC_ADDR  BroadcastAddr;
1348
  PXE_MAC_ADDR    BroadcastAddr;
1352
1349
1353
  ///
1350
  ///
1354
  /// Permanent station MAC address.
1351
  /// Permanent station MAC address.
1355
  ///
1352
  ///
1356
  PXE_MAC_ADDR  PermanentAddr;
1353
  PXE_MAC_ADDR    PermanentAddr;
1357
} PXE_DB_STATION_ADDRESS;
1354
} PXE_DB_STATION_ADDRESS;
1358
1355
1359
typedef struct s_pxe_db_statistics {
1356
typedef struct s_pxe_db_statistics {
Lines 1366-1377 typedef struct s_pxe_db_statistics { Link Here
1366
  /// If bit 0x21 is set, Data[0x21] is collected.
1363
  /// If bit 0x21 is set, Data[0x21] is collected.
1367
  /// Etc.
1364
  /// Etc.
1368
  ///
1365
  ///
1369
  PXE_UINT64  Supported;
1366
  PXE_UINT64    Supported;
1370
1367
1371
  ///
1368
  ///
1372
  /// Statistic data.
1369
  /// Statistic data.
1373
  ///
1370
  ///
1374
  PXE_UINT64  Data[64];
1371
  PXE_UINT64    Data[64];
1375
} PXE_DB_STATISTICS;
1372
} PXE_DB_STATISTICS;
1376
1373
1377
///
1374
///
Lines 1383-1389 typedef struct s_pxe_db_statistics { Link Here
1383
///
1380
///
1384
/// Number of valid frames received and copied into receive buffers.
1381
/// Number of valid frames received and copied into receive buffers.
1385
///
1382
///
1386
#define PXE_STATISTICS_RX_GOOD_FRAMES 0x01
1383
#define PXE_STATISTICS_RX_GOOD_FRAMES  0x01
1387
1384
1388
///
1385
///
1389
/// Number of frames below the minimum length for the media.
1386
/// Number of frames below the minimum length for the media.
Lines 1395-1401 typedef struct s_pxe_db_statistics { Link Here
1395
/// Number of frames longer than the maxminum length for the
1392
/// Number of frames longer than the maxminum length for the
1396
/// media.  This would be >1500 for ethernet.
1393
/// media.  This would be >1500 for ethernet.
1397
///
1394
///
1398
#define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03
1395
#define PXE_STATISTICS_RX_OVERSIZE_FRAMES  0x03
1399
1396
1400
///
1397
///
1401
/// Valid frames that were dropped because receive buffers were full.
1398
/// Valid frames that were dropped because receive buffers were full.
Lines 1426-1432 typedef struct s_pxe_db_statistics { Link Here
1426
/// Total number of bytes received.  Includes frames with errors
1423
/// Total number of bytes received.  Includes frames with errors
1427
/// and dropped frames.
1424
/// and dropped frames.
1428
///
1425
///
1429
#define PXE_STATISTICS_RX_TOTAL_BYTES 0x09
1426
#define PXE_STATISTICS_RX_TOTAL_BYTES  0x09
1430
1427
1431
///
1428
///
1432
/// Transmit statistics.
1429
/// Transmit statistics.
Lines 1445-1489 typedef struct s_pxe_db_statistics { Link Here
1445
///
1442
///
1446
/// Number of collisions detection on this subnet.
1443
/// Number of collisions detection on this subnet.
1447
///
1444
///
1448
#define PXE_STATISTICS_COLLISIONS 0x14
1445
#define PXE_STATISTICS_COLLISIONS  0x14
1449
1446
1450
///
1447
///
1451
/// Number of frames destined for unsupported protocol.
1448
/// Number of frames destined for unsupported protocol.
1452
///
1449
///
1453
#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15
1450
#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL  0x15
1454
1451
1455
///
1452
///
1456
/// Number of valid frames received that were duplicated.
1453
/// Number of valid frames received that were duplicated.
1457
///
1454
///
1458
#define PXE_STATISTICS_RX_DUPLICATED_FRAMES 0x16
1455
#define PXE_STATISTICS_RX_DUPLICATED_FRAMES  0x16
1459
1456
1460
///
1457
///
1461
/// Number of encrypted frames received that failed to decrypt.
1458
/// Number of encrypted frames received that failed to decrypt.
1462
///
1459
///
1463
#define PXE_STATISTICS_RX_DECRYPT_ERROR_FRAMES 0x17
1460
#define PXE_STATISTICS_RX_DECRYPT_ERROR_FRAMES  0x17
1464
1461
1465
///
1462
///
1466
/// Number of frames that failed to transmit after exceeding the retry limit.
1463
/// Number of frames that failed to transmit after exceeding the retry limit.
1467
///
1464
///
1468
#define PXE_STATISTICS_TX_ERROR_FRAMES 0x18
1465
#define PXE_STATISTICS_TX_ERROR_FRAMES  0x18
1469
1466
1470
///
1467
///
1471
/// Number of frames transmitted successfully after more than one attempt.
1468
/// Number of frames transmitted successfully after more than one attempt.
1472
///
1469
///
1473
#define PXE_STATISTICS_TX_RETRY_FRAMES 0x19
1470
#define PXE_STATISTICS_TX_RETRY_FRAMES  0x19
1474
1471
1475
typedef struct s_pxe_cpb_mcast_ip_to_mac {
1472
typedef struct s_pxe_cpb_mcast_ip_to_mac {
1476
  ///
1473
  ///
1477
  /// Multicast IP address to be converted to multicast MAC address.
1474
  /// Multicast IP address to be converted to multicast MAC address.
1478
  ///
1475
  ///
1479
  PXE_IP_ADDR IP;
1476
  PXE_IP_ADDR    IP;
1480
} PXE_CPB_MCAST_IP_TO_MAC;
1477
} PXE_CPB_MCAST_IP_TO_MAC;
1481
1478
1482
typedef struct s_pxe_db_mcast_ip_to_mac {
1479
typedef struct s_pxe_db_mcast_ip_to_mac {
1483
  ///
1480
  ///
1484
  /// Multicast MAC address.
1481
  /// Multicast MAC address.
1485
  ///
1482
  ///
1486
  PXE_MAC_ADDR  MAC;
1483
  PXE_MAC_ADDR    MAC;
1487
} PXE_DB_MCAST_IP_TO_MAC;
1484
} PXE_DB_MCAST_IP_TO_MAC;
1488
1485
1489
typedef struct s_pxe_cpb_nvdata_sparse {
1486
typedef struct s_pxe_cpb_nvdata_sparse {
Lines 1494-1508 typedef struct s_pxe_cpb_nvdata_sparse { Link Here
1494
    ///
1491
    ///
1495
    ///  Non-volatile storage address to be changed.
1492
    ///  Non-volatile storage address to be changed.
1496
    ///
1493
    ///
1497
    PXE_UINT32  Addr;
1494
    PXE_UINT32    Addr;
1498
1495
1499
    ///
1496
    ///
1500
    /// Data item to write into above storage address.
1497
    /// Data item to write into above storage address.
1501
    ///
1498
    ///
1502
    union {
1499
    union {
1503
      PXE_UINT8   Byte;
1500
      PXE_UINT8     Byte;
1504
      PXE_UINT16  Word;
1501
      PXE_UINT16    Word;
1505
      PXE_UINT32  Dword;
1502
      PXE_UINT32    Dword;
1506
    } Data;
1503
    } Data;
1507
  } Item[MAX_EEPROM_LEN];
1504
  } Item[MAX_EEPROM_LEN];
1508
} PXE_CPB_NVDATA_SPARSE;
1505
} PXE_CPB_NVDATA_SPARSE;
Lines 1515-1531 typedef union u_pxe_cpb_nvdata_bulk { Link Here
1515
  ///
1512
  ///
1516
  /// Array of byte-wide data items.
1513
  /// Array of byte-wide data items.
1517
  ///
1514
  ///
1518
  PXE_UINT8   Byte[MAX_EEPROM_LEN << 2];
1515
  PXE_UINT8     Byte[MAX_EEPROM_LEN << 2];
1519
1516
1520
  ///
1517
  ///
1521
  /// Array of word-wide data items.
1518
  /// Array of word-wide data items.
1522
  ///
1519
  ///
1523
  PXE_UINT16  Word[MAX_EEPROM_LEN << 1];
1520
  PXE_UINT16    Word[MAX_EEPROM_LEN << 1];
1524
1521
1525
  ///
1522
  ///
1526
  /// Array of dword-wide data items.
1523
  /// Array of dword-wide data items.
1527
  ///
1524
  ///
1528
  PXE_UINT32  Dword[MAX_EEPROM_LEN];
1525
  PXE_UINT32    Dword[MAX_EEPROM_LEN];
1529
} PXE_CPB_NVDATA_BULK;
1526
} PXE_CPB_NVDATA_BULK;
1530
1527
1531
typedef struct s_pxe_db_nvdata {
1528
typedef struct s_pxe_db_nvdata {
Lines 1536-1552 typedef struct s_pxe_db_nvdata { Link Here
1536
    ///
1533
    ///
1537
    /// Array of byte-wide data items.
1534
    /// Array of byte-wide data items.
1538
    ///
1535
    ///
1539
    PXE_UINT8   Byte[MAX_EEPROM_LEN << 2];
1536
    PXE_UINT8     Byte[MAX_EEPROM_LEN << 2];
1540
1537
1541
    ///
1538
    ///
1542
    /// Array of word-wide data items.
1539
    /// Array of word-wide data items.
1543
    ///
1540
    ///
1544
    PXE_UINT16  Word[MAX_EEPROM_LEN << 1];
1541
    PXE_UINT16    Word[MAX_EEPROM_LEN << 1];
1545
1542
1546
    ///
1543
    ///
1547
    /// Array of dword-wide data items.
1544
    /// Array of dword-wide data items.
1548
    ///
1545
    ///
1549
    PXE_UINT32  Dword[MAX_EEPROM_LEN];
1546
    PXE_UINT32    Dword[MAX_EEPROM_LEN];
1550
  } Data;
1547
  } Data;
1551
} PXE_DB_NVDATA;
1548
} PXE_DB_NVDATA;
1552
1549
Lines 1555-1571 typedef struct s_pxe_db_get_status { Link Here
1555
  /// Length of next receive frame (header + data).  If this is zero,
1552
  /// Length of next receive frame (header + data).  If this is zero,
1556
  /// there is no next receive frame available.
1553
  /// there is no next receive frame available.
1557
  ///
1554
  ///
1558
  PXE_UINT32  RxFrameLen;
1555
  PXE_UINT32    RxFrameLen;
1559
1556
1560
  ///
1557
  ///
1561
  /// Reserved, set to zero.
1558
  /// Reserved, set to zero.
1562
  ///
1559
  ///
1563
  PXE_UINT32  reserved;
1560
  PXE_UINT32    reserved;
1564
1561
1565
  ///
1562
  ///
1566
  ///  Addresses of transmitted buffers that need to be recycled.
1563
  ///  Addresses of transmitted buffers that need to be recycled.
1567
  ///
1564
  ///
1568
  PXE_UINT64  TxBuffer[MAX_XMIT_BUFFERS];
1565
  PXE_UINT64    TxBuffer[MAX_XMIT_BUFFERS];
1569
} PXE_DB_GET_STATUS;
1566
} PXE_DB_GET_STATUS;
1570
1567
1571
typedef struct s_pxe_cpb_fill_header {
1568
typedef struct s_pxe_cpb_fill_header {
Lines 1573-1643 typedef struct s_pxe_cpb_fill_header { Link Here
1573
  /// Source and destination MAC addresses.  These will be copied into
1570
  /// Source and destination MAC addresses.  These will be copied into
1574
  /// the media header without doing byte swapping.
1571
  /// the media header without doing byte swapping.
1575
  ///
1572
  ///
1576
  PXE_MAC_ADDR  SrcAddr;
1573
  PXE_MAC_ADDR    SrcAddr;
1577
  PXE_MAC_ADDR  DestAddr;
1574
  PXE_MAC_ADDR    DestAddr;
1578
1575
1579
  ///
1576
  ///
1580
  /// Address of first byte of media header.  The first byte of packet data
1577
  /// Address of first byte of media header.  The first byte of packet data
1581
  /// follows the last byte of the media header.
1578
  /// follows the last byte of the media header.
1582
  ///
1579
  ///
1583
  PXE_UINT64        MediaHeader;
1580
  PXE_UINT64      MediaHeader;
1584
1581
1585
  ///
1582
  ///
1586
  /// Length of packet data in bytes (not including the media header).
1583
  /// Length of packet data in bytes (not including the media header).
1587
  ///
1584
  ///
1588
  PXE_UINT32        PacketLen;
1585
  PXE_UINT32      PacketLen;
1589
1586
1590
  ///
1587
  ///
1591
  /// Protocol type.  This will be copied into the media header without
1588
  /// Protocol type.  This will be copied into the media header without
1592
  /// doing byte swapping.  Protocol type numbers can be obtained from
1589
  /// doing byte swapping.  Protocol type numbers can be obtained from
1593
  /// the Assigned Numbers RFC 1700.
1590
  /// the Assigned Numbers RFC 1700.
1594
  ///
1591
  ///
1595
  PXE_UINT16        Protocol;
1592
  PXE_UINT16      Protocol;
1596
1593
1597
  ///
1594
  ///
1598
  /// Length of the media header in bytes.
1595
  /// Length of the media header in bytes.
1599
  ///
1596
  ///
1600
  PXE_UINT16        MediaHeaderLen;
1597
  PXE_UINT16      MediaHeaderLen;
1601
} PXE_CPB_FILL_HEADER;
1598
} PXE_CPB_FILL_HEADER;
1602
1599
1603
#define PXE_PROTOCOL_ETHERNET_IP  0x0800
1600
#define PXE_PROTOCOL_ETHERNET_IP   0x0800
1604
#define PXE_PROTOCOL_ETHERNET_ARP 0x0806
1601
#define PXE_PROTOCOL_ETHERNET_ARP  0x0806
1605
#define MAX_XMIT_FRAGMENTS        16
1602
#define MAX_XMIT_FRAGMENTS         16
1606
1603
1607
typedef struct s_pxe_cpb_fill_header_fragmented {
1604
typedef struct s_pxe_cpb_fill_header_fragmented {
1608
  ///
1605
  ///
1609
  /// Source and destination MAC addresses.  These will be copied into
1606
  /// Source and destination MAC addresses.  These will be copied into
1610
  /// the media header without doing byte swapping.
1607
  /// the media header without doing byte swapping.
1611
  ///
1608
  ///
1612
  PXE_MAC_ADDR        SrcAddr;
1609
  PXE_MAC_ADDR          SrcAddr;
1613
  PXE_MAC_ADDR        DestAddr;
1610
  PXE_MAC_ADDR          DestAddr;
1614
1611
1615
  ///
1612
  ///
1616
  /// Length of packet data in bytes (not including the media header).
1613
  /// Length of packet data in bytes (not including the media header).
1617
  ///
1614
  ///
1618
  PXE_UINT32          PacketLen;
1615
  PXE_UINT32            PacketLen;
1619
1616
1620
  ///
1617
  ///
1621
  /// Protocol type.  This will be copied into the media header without
1618
  /// Protocol type.  This will be copied into the media header without
1622
  /// doing byte swapping.  Protocol type numbers can be obtained from
1619
  /// doing byte swapping.  Protocol type numbers can be obtained from
1623
  /// the Assigned Numbers RFC 1700.
1620
  /// the Assigned Numbers RFC 1700.
1624
  ///
1621
  ///
1625
  PXE_MEDIA_PROTOCOL  Protocol;
1622
  PXE_MEDIA_PROTOCOL    Protocol;
1626
1623
1627
  ///
1624
  ///
1628
  /// Length of the media header in bytes.
1625
  /// Length of the media header in bytes.
1629
  ///
1626
  ///
1630
  PXE_UINT16          MediaHeaderLen;
1627
  PXE_UINT16            MediaHeaderLen;
1631
1628
1632
  ///
1629
  ///
1633
  /// Number of packet fragment descriptors.
1630
  /// Number of packet fragment descriptors.
1634
  ///
1631
  ///
1635
  PXE_UINT16          FragCnt;
1632
  PXE_UINT16            FragCnt;
1636
1633
1637
  ///
1634
  ///
1638
  /// Reserved, must be set to zero.
1635
  /// Reserved, must be set to zero.
1639
  ///
1636
  ///
1640
  PXE_UINT16          reserved;
1637
  PXE_UINT16            reserved;
1641
1638
1642
  ///
1639
  ///
1643
  /// Array of packet fragment descriptors.  The first byte of the media
1640
  /// Array of packet fragment descriptors.  The first byte of the media
Lines 1647-1706 typedef struct s_pxe_cpb_fill_header_fragmented { Link Here
1647
    ///
1644
    ///
1648
    /// Address of this packet fragment.
1645
    /// Address of this packet fragment.
1649
    ///
1646
    ///
1650
    PXE_UINT64  FragAddr;
1647
    PXE_UINT64    FragAddr;
1651
1648
1652
    ///
1649
    ///
1653
    /// Length of this packet fragment.
1650
    /// Length of this packet fragment.
1654
    ///
1651
    ///
1655
    PXE_UINT32  FragLen;
1652
    PXE_UINT32    FragLen;
1656
1653
1657
    ///
1654
    ///
1658
    /// Reserved, must be set to zero.
1655
    /// Reserved, must be set to zero.
1659
    ///
1656
    ///
1660
    PXE_UINT32  reserved;
1657
    PXE_UINT32    reserved;
1661
  } FragDesc[MAX_XMIT_FRAGMENTS];
1658
  } FragDesc[MAX_XMIT_FRAGMENTS];
1662
}
1659
} PXE_CPB_FILL_HEADER_FRAGMENTED;
1663
PXE_CPB_FILL_HEADER_FRAGMENTED;
1664
1660
1665
typedef struct s_pxe_cpb_transmit {
1661
typedef struct s_pxe_cpb_transmit {
1666
  ///
1662
  ///
1667
  /// Address of first byte of frame buffer.  This is also the first byte
1663
  /// Address of first byte of frame buffer.  This is also the first byte
1668
  /// of the media header.
1664
  /// of the media header.
1669
  ///
1665
  ///
1670
  PXE_UINT64  FrameAddr;
1666
  PXE_UINT64    FrameAddr;
1671
1667
1672
  ///
1668
  ///
1673
  /// Length of the data portion of the frame buffer in bytes.  Do not
1669
  /// Length of the data portion of the frame buffer in bytes.  Do not
1674
  /// include the length of the media header.
1670
  /// include the length of the media header.
1675
  ///
1671
  ///
1676
  PXE_UINT32  DataLen;
1672
  PXE_UINT32    DataLen;
1677
1673
1678
  ///
1674
  ///
1679
  /// Length of the media header in bytes.
1675
  /// Length of the media header in bytes.
1680
  ///
1676
  ///
1681
  PXE_UINT16  MediaheaderLen;
1677
  PXE_UINT16    MediaheaderLen;
1682
1678
1683
  ///
1679
  ///
1684
  /// Reserved, must be zero.
1680
  /// Reserved, must be zero.
1685
  ///
1681
  ///
1686
  PXE_UINT16  reserved;
1682
  PXE_UINT16    reserved;
1687
} PXE_CPB_TRANSMIT;
1683
} PXE_CPB_TRANSMIT;
1688
1684
1689
typedef struct s_pxe_cpb_transmit_fragments {
1685
typedef struct s_pxe_cpb_transmit_fragments {
1690
  ///
1686
  ///
1691
  /// Length of packet data in bytes (not including the media header).
1687
  /// Length of packet data in bytes (not including the media header).
1692
  ///
1688
  ///
1693
  PXE_UINT32  FrameLen;
1689
  PXE_UINT32    FrameLen;
1694
1690
1695
  ///
1691
  ///
1696
  /// Length of the media header in bytes.
1692
  /// Length of the media header in bytes.
1697
  ///
1693
  ///
1698
  PXE_UINT16  MediaheaderLen;
1694
  PXE_UINT16    MediaheaderLen;
1699
1695
1700
  ///
1696
  ///
1701
  /// Number of packet fragment descriptors.
1697
  /// Number of packet fragment descriptors.
1702
  ///
1698
  ///
1703
  PXE_UINT16  FragCnt;
1699
  PXE_UINT16    FragCnt;
1704
1700
1705
  ///
1701
  ///
1706
  /// Array of frame fragment descriptors.  The first byte of the first
1702
  /// Array of frame fragment descriptors.  The first byte of the first
Lines 1710-1784 typedef struct s_pxe_cpb_transmit_fragments { Link Here
1710
    ///
1706
    ///
1711
    /// Address of this frame fragment.
1707
    /// Address of this frame fragment.
1712
    ///
1708
    ///
1713
    PXE_UINT64  FragAddr;
1709
    PXE_UINT64    FragAddr;
1714
1710
1715
    ///
1711
    ///
1716
    /// Length of this frame fragment.
1712
    /// Length of this frame fragment.
1717
    ///
1713
    ///
1718
    PXE_UINT32  FragLen;
1714
    PXE_UINT32    FragLen;
1719
1715
1720
    ///
1716
    ///
1721
    /// Reserved, must be set to zero.
1717
    /// Reserved, must be set to zero.
1722
    ///
1718
    ///
1723
    PXE_UINT32  reserved;
1719
    PXE_UINT32    reserved;
1724
  } FragDesc[MAX_XMIT_FRAGMENTS];
1720
  } FragDesc[MAX_XMIT_FRAGMENTS];
1725
}
1721
} PXE_CPB_TRANSMIT_FRAGMENTS;
1726
PXE_CPB_TRANSMIT_FRAGMENTS;
1727
1722
1728
typedef struct s_pxe_cpb_receive {
1723
typedef struct s_pxe_cpb_receive {
1729
  ///
1724
  ///
1730
  /// Address of first byte of receive buffer.  This is also the first byte
1725
  /// Address of first byte of receive buffer.  This is also the first byte
1731
  /// of the frame header.
1726
  /// of the frame header.
1732
  ///
1727
  ///
1733
  PXE_UINT64  BufferAddr;
1728
  PXE_UINT64    BufferAddr;
1734
1729
1735
  ///
1730
  ///
1736
  /// Length of receive buffer.  This must be large enough to hold the
1731
  /// Length of receive buffer.  This must be large enough to hold the
1737
  /// received frame (media header + data).  If the length of smaller than
1732
  /// received frame (media header + data).  If the length of smaller than
1738
  /// the received frame, data will be lost.
1733
  /// the received frame, data will be lost.
1739
  ///
1734
  ///
1740
  PXE_UINT32  BufferLen;
1735
  PXE_UINT32    BufferLen;
1741
1736
1742
  ///
1737
  ///
1743
  /// Reserved, must be set to zero.
1738
  /// Reserved, must be set to zero.
1744
  ///
1739
  ///
1745
  PXE_UINT32  reserved;
1740
  PXE_UINT32    reserved;
1746
} PXE_CPB_RECEIVE;
1741
} PXE_CPB_RECEIVE;
1747
1742
1748
typedef struct s_pxe_db_receive {
1743
typedef struct s_pxe_db_receive {
1749
  ///
1744
  ///
1750
  /// Source and destination MAC addresses from media header.
1745
  /// Source and destination MAC addresses from media header.
1751
  ///
1746
  ///
1752
  PXE_MAC_ADDR        SrcAddr;
1747
  PXE_MAC_ADDR          SrcAddr;
1753
  PXE_MAC_ADDR        DestAddr;
1748
  PXE_MAC_ADDR          DestAddr;
1754
1749
1755
  ///
1750
  ///
1756
  /// Length of received frame.  May be larger than receive buffer size.
1751
  /// Length of received frame.  May be larger than receive buffer size.
1757
  /// The receive buffer will not be overwritten.  This is how to tell
1752
  /// The receive buffer will not be overwritten.  This is how to tell
1758
  /// if data was lost because the receive buffer was too small.
1753
  /// if data was lost because the receive buffer was too small.
1759
  ///
1754
  ///
1760
  PXE_UINT32          FrameLen;
1755
  PXE_UINT32            FrameLen;
1761
1756
1762
  ///
1757
  ///
1763
  /// Protocol type from media header.
1758
  /// Protocol type from media header.
1764
  ///
1759
  ///
1765
  PXE_MEDIA_PROTOCOL  Protocol;
1760
  PXE_MEDIA_PROTOCOL    Protocol;
1766
1761
1767
  ///
1762
  ///
1768
  /// Length of media header in received frame.
1763
  /// Length of media header in received frame.
1769
  ///
1764
  ///
1770
  PXE_UINT16          MediaHeaderLen;
1765
  PXE_UINT16            MediaHeaderLen;
1771
1766
1772
  ///
1767
  ///
1773
  /// Type of receive frame.
1768
  /// Type of receive frame.
1774
  ///
1769
  ///
1775
  PXE_FRAME_TYPE      Type;
1770
  PXE_FRAME_TYPE        Type;
1776
1771
1777
  ///
1772
  ///
1778
  /// Reserved, must be zero.
1773
  /// Reserved, must be zero.
1779
  ///
1774
  ///
1780
  PXE_UINT8           reserved[7];
1775
  PXE_UINT8             reserved[7];
1781
1782
} PXE_DB_RECEIVE;
1776
} PXE_DB_RECEIVE;
1783
1777
1784
#pragma pack()
1778
#pragma pack()
(-)b/sys/contrib/edk2/Include/Uefi/UefiSpec.h (-215 / +274 lines)
Lines 5-12 Link Here
5
  If a code construct is defined in the UEFI 2.7 specification it must be included
5
  If a code construct is defined in the UEFI 2.7 specification it must be included
6
  by this include file.
6
  by this include file.
7
7
8
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
8
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
9
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
9
Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
10
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
10
11
11
SPDX-License-Identifier: BSD-2-Clause-Patent
12
SPDX-License-Identifier: BSD-2-Clause-Patent
12
13
Lines 59-89 typedef enum { Link Here
59
//
60
//
60
// Memory cacheability attributes
61
// Memory cacheability attributes
61
//
62
//
62
#define EFI_MEMORY_UC               0x0000000000000001ULL
63
#define EFI_MEMORY_UC   0x0000000000000001ULL
63
#define EFI_MEMORY_WC               0x0000000000000002ULL
64
#define EFI_MEMORY_WC   0x0000000000000002ULL
64
#define EFI_MEMORY_WT               0x0000000000000004ULL
65
#define EFI_MEMORY_WT   0x0000000000000004ULL
65
#define EFI_MEMORY_WB               0x0000000000000008ULL
66
#define EFI_MEMORY_WB   0x0000000000000008ULL
66
#define EFI_MEMORY_UCE              0x0000000000000010ULL
67
#define EFI_MEMORY_UCE  0x0000000000000010ULL
67
//
68
//
68
// Physical memory protection attributes
69
// Physical memory protection attributes
69
//
70
//
70
// Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory
71
// Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory
71
// protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.
72
// protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.
72
//
73
//
73
#define EFI_MEMORY_WP               0x0000000000001000ULL
74
#define EFI_MEMORY_WP  0x0000000000001000ULL
74
#define EFI_MEMORY_RP               0x0000000000002000ULL
75
#define EFI_MEMORY_RP  0x0000000000002000ULL
75
#define EFI_MEMORY_XP               0x0000000000004000ULL
76
#define EFI_MEMORY_XP  0x0000000000004000ULL
76
#define EFI_MEMORY_RO               0x0000000000020000ULL
77
#define EFI_MEMORY_RO  0x0000000000020000ULL
77
//
78
//
78
// Physical memory persistence attribute.
79
// Physical memory persistence attribute.
79
// The memory region supports byte-addressable non-volatility.
80
// The memory region supports byte-addressable non-volatility.
80
//
81
//
81
#define EFI_MEMORY_NV               0x0000000000008000ULL
82
#define EFI_MEMORY_NV  0x0000000000008000ULL
82
//
83
//
83
// The memory region provides higher reliability relative to other memory in the system.
84
// The memory region provides higher reliability relative to other memory in the system.
84
// If all memory has the same reliability, then this bit is not used.
85
// If all memory has the same reliability, then this bit is not used.
85
//
86
//
86
#define EFI_MEMORY_MORE_RELIABLE    0x0000000000010000ULL
87
#define EFI_MEMORY_MORE_RELIABLE  0x0000000000010000ULL
87
88
88
//
89
//
89
// Note: UEFI spec 2.8 and following:
90
// Note: UEFI spec 2.8 and following:
Lines 93-118 typedef enum { Link Here
93
// The SPM attribute serves as a hint to the OS to avoid allocating this
94
// The SPM attribute serves as a hint to the OS to avoid allocating this
94
// memory for core OS data or code that can not be relocated.
95
// memory for core OS data or code that can not be relocated.
95
//
96
//
96
#define EFI_MEMORY_SP               0x0000000000040000ULL
97
#define EFI_MEMORY_SP  0x0000000000040000ULL
97
//
98
//
98
// If this flag is set, the memory region is capable of being
99
// If this flag is set, the memory region is capable of being
99
// protected with the CPU?s memory cryptographic
100
// protected with the CPU's memory cryptographic
100
// capabilities. If this flag is clear, the memory region is not
101
// capabilities. If this flag is clear, the memory region is not
101
// capable of being protected with the CPU?s memory
102
// capable of being protected with the CPU's memory
102
// cryptographic capabilities or the CPU does not support CPU
103
// cryptographic capabilities or the CPU does not support CPU
103
// memory cryptographic capabilities.
104
// memory cryptographic capabilities.
104
//
105
//
105
#define EFI_MEMORY_CPU_CRYPTO       0x0000000000080000ULL
106
#define EFI_MEMORY_CPU_CRYPTO  0x0000000000080000ULL
106
107
107
//
108
//
108
// Runtime memory attribute
109
// Runtime memory attribute
109
//
110
//
110
#define EFI_MEMORY_RUNTIME          0x8000000000000000ULL
111
#define EFI_MEMORY_RUNTIME  0x8000000000000000ULL
112
113
//
114
// If this flag is set, the memory region is
115
// described with additional ISA-specific memory attributes
116
// as specified in EFI_MEMORY_ISA_MASK.
117
//
118
#define EFI_MEMORY_ISA_VALID  0x4000000000000000ULL
119
120
//
121
// Defines the bits reserved for describing optional ISA-specific cacheability
122
// attributes that are not covered by the standard UEFI Memory Attributes cacheability
123
// bits (EFI_MEMORY_UC, EFI_MEMORY_WC, EFI_MEMORY_WT, EFI_MEMORY_WB and EFI_MEMORY_UCE).
124
// See Calling Conventions for further ISA-specific enumeration of these bits.
125
//
126
#define EFI_MEMORY_ISA_MASK  0x0FFFF00000000000ULL
127
128
//
129
// Attributes bitmasks, grouped by type
130
//
131
#define EFI_CACHE_ATTRIBUTE_MASK   (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)
132
#define EFI_MEMORY_ACCESS_MASK     (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO)
133
#define EFI_MEMORY_ATTRIBUTE_MASK  (EFI_MEMORY_ACCESS_MASK | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO)
111
134
112
///
135
///
113
/// Memory descriptor version number.
136
/// Memory descriptor version number.
114
///
137
///
115
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
138
#define EFI_MEMORY_DESCRIPTOR_VERSION  1
116
139
117
///
140
///
118
/// Definition of an EFI memory descriptor.
141
/// Definition of an EFI memory descriptor.
Lines 123-154 typedef struct { Link Here
123
  /// Type EFI_MEMORY_TYPE is defined in the
146
  /// Type EFI_MEMORY_TYPE is defined in the
124
  /// AllocatePages() function description.
147
  /// AllocatePages() function description.
125
  ///
148
  ///
126
  UINT32                Type;
149
  UINT32                  Type;
127
  ///
150
  ///
128
  /// Physical address of the first byte in the memory region. PhysicalStart must be
151
  /// Physical address of the first byte in the memory region. PhysicalStart must be
129
  /// aligned on a 4 KiB boundary, and must not be above 0xfffffffffffff000. Type
152
  /// aligned on a 4 KiB boundary, and must not be above 0xfffffffffffff000. Type
130
  /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function description
153
  /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function description
131
  ///
154
  ///
132
  EFI_PHYSICAL_ADDRESS  PhysicalStart;
155
  EFI_PHYSICAL_ADDRESS    PhysicalStart;
133
  ///
156
  ///
134
  /// Virtual address of the first byte in the memory region.
157
  /// Virtual address of the first byte in the memory region.
135
  /// VirtualStart must be aligned on a 4 KiB boundary,
158
  /// VirtualStart must be aligned on a 4 KiB boundary,
136
  /// and must not be above 0xfffffffffffff000.
159
  /// and must not be above 0xfffffffffffff000.
137
  ///
160
  ///
138
  EFI_VIRTUAL_ADDRESS   VirtualStart;
161
  EFI_VIRTUAL_ADDRESS     VirtualStart;
139
  ///
162
  ///
140
  /// NumberOfPagesNumber of 4 KiB pages in the memory region.
163
  /// NumberOfPagesNumber of 4 KiB pages in the memory region.
141
  /// NumberOfPages must not be 0, and must not be any value
164
  /// NumberOfPages must not be 0, and must not be any value
142
  /// that would represent a memory page with a start address,
165
  /// that would represent a memory page with a start address,
143
  /// either physical or virtual, above 0xfffffffffffff000.
166
  /// either physical or virtual, above 0xfffffffffffff000.
144
  ///
167
  ///
145
  UINT64                NumberOfPages;
168
  UINT64                  NumberOfPages;
146
  ///
169
  ///
147
  /// Attributes of the memory region that describe the bit mask of capabilities
170
  /// Attributes of the memory region that describe the bit mask of capabilities
148
  /// for that memory region, and not necessarily the current settings for that
171
  /// for that memory region, and not necessarily the current settings for that
149
  /// memory region.
172
  /// memory region.
150
  ///
173
  ///
151
  UINT64                Attribute;
174
  UINT64                  Attribute;
152
} EFI_MEMORY_DESCRIPTOR;
175
} EFI_MEMORY_DESCRIPTOR;
153
176
154
/**
177
/**
Lines 297-302 EFI_STATUS Link Here
297
                                map that requires a mapping.
320
                                map that requires a mapping.
298
  @retval EFI_NOT_FOUND         A virtual address was supplied for an address that is not found
321
  @retval EFI_NOT_FOUND         A virtual address was supplied for an address that is not found
299
                                in the memory map.
322
                                in the memory map.
323
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
324
                                The platform should describe this runtime service as unsupported at runtime
325
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
300
326
301
**/
327
**/
302
typedef
328
typedef
Lines 337-344 typedef Link Here
337
EFI_STATUS
363
EFI_STATUS
338
(EFIAPI *EFI_CONNECT_CONTROLLER)(
364
(EFIAPI *EFI_CONNECT_CONTROLLER)(
339
  IN  EFI_HANDLE                    ControllerHandle,
365
  IN  EFI_HANDLE                    ControllerHandle,
340
  IN  EFI_HANDLE                    *DriverImageHandle,   OPTIONAL
366
  IN  EFI_HANDLE                    *DriverImageHandle    OPTIONAL,
341
  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath, OPTIONAL
367
  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath  OPTIONAL,
342
  IN  BOOLEAN                       Recursive
368
  IN  BOOLEAN                       Recursive
343
  );
369
  );
344
370
Lines 370-385 typedef Link Here
370
EFI_STATUS
396
EFI_STATUS
371
(EFIAPI *EFI_DISCONNECT_CONTROLLER)(
397
(EFIAPI *EFI_DISCONNECT_CONTROLLER)(
372
  IN  EFI_HANDLE                     ControllerHandle,
398
  IN  EFI_HANDLE                     ControllerHandle,
373
  IN  EFI_HANDLE                     DriverImageHandle, OPTIONAL
399
  IN  EFI_HANDLE                     DriverImageHandle  OPTIONAL,
374
  IN  EFI_HANDLE                     ChildHandle        OPTIONAL
400
  IN  EFI_HANDLE                     ChildHandle        OPTIONAL
375
  );
401
  );
376
402
377
378
379
//
403
//
380
// ConvertPointer DebugDisposition type.
404
// ConvertPointer DebugDisposition type.
381
//
405
//
382
#define EFI_OPTIONAL_PTR     0x00000001
406
#define EFI_OPTIONAL_PTR  0x00000001
383
407
384
/**
408
/**
385
  Determines the new virtual address that is to be used on subsequent memory accesses.
409
  Determines the new virtual address that is to be used on subsequent memory accesses.
Lines 389-399 EFI_STATUS Link Here
389
                                     for the new virtual address mappings being applied.
413
                                     for the new virtual address mappings being applied.
390
414
391
  @retval EFI_SUCCESS           The pointer pointed to by Address was modified.
415
  @retval EFI_SUCCESS           The pointer pointed to by Address was modified.
392
  @retval EFI_INVALID_PARAMETER 1) Address is NULL.
393
                                2) *Address is NULL and DebugDisposition does
394
                                not have the EFI_OPTIONAL_PTR bit set.
395
  @retval EFI_NOT_FOUND         The pointer pointed to by Address was not found to be part
416
  @retval EFI_NOT_FOUND         The pointer pointed to by Address was not found to be part
396
                                of the current memory map. This is normally fatal.
417
                                of the current memory map. This is normally fatal.
418
  @retval EFI_INVALID_PARAMETER Address is NULL.
419
  @retval EFI_INVALID_PARAMETER *Address is NULL and DebugDisposition does
420
                                not have the EFI_OPTIONAL_PTR bit set.
421
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
422
                                The platform should describe this runtime service as unsupported at runtime
423
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
397
424
398
**/
425
**/
399
typedef
426
typedef
Lines 403-429 EFI_STATUS Link Here
403
  IN OUT VOID                       **Address
430
  IN OUT VOID                       **Address
404
  );
431
  );
405
432
406
407
//
433
//
408
// These types can be ORed together as needed - for example,
434
// These types can be ORed together as needed - for example,
409
// EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
435
// EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or
410
// EVT_NOTIFY_SIGNAL.
436
// EVT_NOTIFY_SIGNAL.
411
//
437
//
412
#define EVT_TIMER                         0x80000000
438
#define EVT_TIMER          0x80000000
413
#define EVT_RUNTIME                       0x40000000
439
#define EVT_RUNTIME        0x40000000
414
#define EVT_NOTIFY_WAIT                   0x00000100
440
#define EVT_NOTIFY_WAIT    0x00000100
415
#define EVT_NOTIFY_SIGNAL                 0x00000200
441
#define EVT_NOTIFY_SIGNAL  0x00000200
416
442
417
#define EVT_SIGNAL_EXIT_BOOT_SERVICES     0x00000201
443
#define EVT_SIGNAL_EXIT_BOOT_SERVICES      0x00000201
418
#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
444
#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE  0x60000202
419
445
420
//
446
//
421
// The event's NotifyContext pointer points to a runtime memory
447
// The event's NotifyContext pointer points to a runtime memory
422
// address.
448
// address.
423
// The event is deprecated in UEFI2.0 and later specifications.
449
// The event is deprecated in UEFI2.0 and later specifications.
424
//
450
//
425
#define EVT_RUNTIME_CONTEXT               0x20000000
451
#define EVT_RUNTIME_CONTEXT  0x20000000
426
427
452
428
/**
453
/**
429
  Invoke a notification event
454
  Invoke a notification event
Lines 461-468 EFI_STATUS Link Here
461
(EFIAPI *EFI_CREATE_EVENT)(
486
(EFIAPI *EFI_CREATE_EVENT)(
462
  IN  UINT32                       Type,
487
  IN  UINT32                       Type,
463
  IN  EFI_TPL                      NotifyTpl,
488
  IN  EFI_TPL                      NotifyTpl,
464
  IN  EFI_EVENT_NOTIFY             NotifyFunction,
489
  IN  EFI_EVENT_NOTIFY             NotifyFunction OPTIONAL,
465
  IN  VOID                         *NotifyContext,
490
  IN  VOID                         *NotifyContext OPTIONAL,
466
  OUT EFI_EVENT                    *Event
491
  OUT EFI_EVENT                    *Event
467
  );
492
  );
468
493
Lines 604-618 EFI_STATUS Link Here
604
  IN EFI_EVENT                Event
629
  IN EFI_EVENT                Event
605
  );
630
  );
606
631
607
608
//
632
//
609
// Task priority level
633
// Task priority level
610
//
634
//
611
#define TPL_APPLICATION       4
635
#define TPL_APPLICATION  4
612
#define TPL_CALLBACK          8
636
#define TPL_CALLBACK     8
613
#define TPL_NOTIFY            16
637
#define TPL_NOTIFY       16
614
#define TPL_HIGH_LEVEL        31
638
#define TPL_HIGH_LEVEL   31
615
616
639
617
/**
640
/**
618
  Raises a task's priority level and returns its previous level.
641
  Raises a task's priority level and returns its previous level.
Lines 662-667 VOID Link Here
662
  @retval EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.
685
  @retval EFI_INVALID_PARAMETER  The DataSize is not too small and Data is NULL.
663
  @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
686
  @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
664
  @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
687
  @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
688
  @retval EFI_UNSUPPORTED        After ExitBootServices() has been called, this return code may be returned
689
                                 if no variable storage is supported. The platform should describe this
690
                                 runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE
691
                                 configuration table.
665
692
666
**/
693
**/
667
typedef
694
typedef
Lines 669-675 EFI_STATUS Link Here
669
(EFIAPI *EFI_GET_VARIABLE)(
696
(EFIAPI *EFI_GET_VARIABLE)(
670
  IN     CHAR16                      *VariableName,
697
  IN     CHAR16                      *VariableName,
671
  IN     EFI_GUID                    *VendorGuid,
698
  IN     EFI_GUID                    *VendorGuid,
672
  OUT    UINT32                      *Attributes,    OPTIONAL
699
  OUT    UINT32                      *Attributes     OPTIONAL,
673
  IN OUT UINTN                       *DataSize,
700
  IN OUT UINTN                       *DataSize,
674
  OUT    VOID                        *Data           OPTIONAL
701
  OUT    VOID                        *Data           OPTIONAL
675
  );
702
  );
Lines 698-703 EFI_STATUS Link Here
698
  @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of
725
  @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of
699
                                the input VariableName buffer.
726
                                the input VariableName buffer.
700
  @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.
727
  @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.
728
  @retval EFI_UNSUPPORTED       After ExitBootServices() has been called, this return code may be returned
729
                                if no variable storage is supported. The platform should describe this
730
                                runtime service as unsupported at runtime via an EFI_RT_PROPERTIES_TABLE
731
                                configuration table.
701
732
702
**/
733
**/
703
typedef
734
typedef
Lines 740-745 EFI_STATUS Link Here
740
                                 but the AuthInfo does NOT pass the validation check carried out by the firmware.
771
                                 but the AuthInfo does NOT pass the validation check carried out by the firmware.
741
772
742
  @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.
773
  @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.
774
  @retval EFI_UNSUPPORTED        This call is not supported by this platform at the time the call is made.
775
                                 The platform should describe this runtime service as unsupported at runtime
776
                                 via an EFI_RT_PROPERTIES_TABLE configuration table.
743
777
744
**/
778
**/
745
typedef
779
typedef
Lines 752-758 EFI_STATUS Link Here
752
  IN  VOID                         *Data
786
  IN  VOID                         *Data
753
  );
787
  );
754
788
755
756
///
789
///
757
/// This provides the capabilities of the
790
/// This provides the capabilities of the
758
/// real time clock device as exposed through the EFI interfaces.
791
/// real time clock device as exposed through the EFI interfaces.
Lines 764-777 typedef struct { Link Here
764
  /// value would be 1 Hz, or 1, to indicate that the device only reports
797
  /// value would be 1 Hz, or 1, to indicate that the device only reports
765
  /// the time to the resolution of 1 second.
798
  /// the time to the resolution of 1 second.
766
  ///
799
  ///
767
  UINT32    Resolution;
800
  UINT32     Resolution;
768
  ///
801
  ///
769
  /// Provides the timekeeping accuracy of the real-time clock in an
802
  /// Provides the timekeeping accuracy of the real-time clock in an
770
  /// error rate of 1E-6 parts per million. For a clock with an accuracy
803
  /// error rate of 1E-6 parts per million. For a clock with an accuracy
771
  /// of 50 parts per million, the value in this field would be
804
  /// of 50 parts per million, the value in this field would be
772
  /// 50,000,000.
805
  /// 50,000,000.
773
  ///
806
  ///
774
  UINT32    Accuracy;
807
  UINT32     Accuracy;
775
  ///
808
  ///
776
  /// A TRUE indicates that a time set operation clears the device's
809
  /// A TRUE indicates that a time set operation clears the device's
777
  /// time below the Resolution reporting level. A FALSE
810
  /// time below the Resolution reporting level. A FALSE
Lines 779-785 typedef struct { Link Here
779
  /// device is not cleared when the time is set. Normal PC-AT CMOS
812
  /// device is not cleared when the time is set. Normal PC-AT CMOS
780
  /// RTC devices set this value to FALSE.
813
  /// RTC devices set this value to FALSE.
781
  ///
814
  ///
782
  BOOLEAN   SetsToZero;
815
  BOOLEAN    SetsToZero;
783
} EFI_TIME_CAPABILITIES;
816
} EFI_TIME_CAPABILITIES;
784
817
785
/**
818
/**
Lines 793-798 typedef struct { Link Here
793
  @retval EFI_SUCCESS           The operation completed successfully.
826
  @retval EFI_SUCCESS           The operation completed successfully.
794
  @retval EFI_INVALID_PARAMETER Time is NULL.
827
  @retval EFI_INVALID_PARAMETER Time is NULL.
795
  @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.
828
  @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.
829
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
830
                                The platform should describe this runtime service as unsupported at runtime
831
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
796
832
797
**/
833
**/
798
typedef
834
typedef
Lines 810-815 EFI_STATUS Link Here
810
  @retval EFI_SUCCESS           The operation completed successfully.
846
  @retval EFI_SUCCESS           The operation completed successfully.
811
  @retval EFI_INVALID_PARAMETER A time field is out of range.
847
  @retval EFI_INVALID_PARAMETER A time field is out of range.
812
  @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.
848
  @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.
849
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
850
                                The platform should describe this runtime service as unsupported at runtime
851
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
813
852
814
**/
853
**/
815
typedef
854
typedef
Lines 830-836 EFI_STATUS Link Here
830
  @retval EFI_INVALID_PARAMETER Pending is NULL.
869
  @retval EFI_INVALID_PARAMETER Pending is NULL.
831
  @retval EFI_INVALID_PARAMETER Time is NULL.
870
  @retval EFI_INVALID_PARAMETER Time is NULL.
832
  @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.
871
  @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.
833
  @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.
872
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
873
                                The platform should describe this runtime service as unsupported at runtime
874
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
834
875
835
**/
876
**/
836
typedef
877
typedef
Lines 852-858 EFI_STATUS Link Here
852
                                Enable is FALSE, then the wakeup alarm was disabled.
893
                                Enable is FALSE, then the wakeup alarm was disabled.
853
  @retval EFI_INVALID_PARAMETER A time field is out of range.
894
  @retval EFI_INVALID_PARAMETER A time field is out of range.
854
  @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.
895
  @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.
855
  @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.
896
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
897
                                The platform should describe this runtime service as unsupported at runtime
898
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
856
899
857
**/
900
**/
858
typedef
901
typedef
Lines 897-903 EFI_STATUS Link Here
897
(EFIAPI *EFI_IMAGE_LOAD)(
940
(EFIAPI *EFI_IMAGE_LOAD)(
898
  IN  BOOLEAN                      BootPolicy,
941
  IN  BOOLEAN                      BootPolicy,
899
  IN  EFI_HANDLE                   ParentImageHandle,
942
  IN  EFI_HANDLE                   ParentImageHandle,
900
  IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath,
943
  IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath   OPTIONAL,
901
  IN  VOID                         *SourceBuffer OPTIONAL,
944
  IN  VOID                         *SourceBuffer OPTIONAL,
902
  IN  UINTN                        SourceSize,
945
  IN  UINTN                        SourceSize,
903
  OUT EFI_HANDLE                   *ImageHandle
946
  OUT EFI_HANDLE                   *ImageHandle
Lines 1074-1079 EFI_STATUS Link Here
1074
  @retval EFI_SUCCESS           The next high monotonic count was returned.
1117
  @retval EFI_SUCCESS           The next high monotonic count was returned.
1075
  @retval EFI_INVALID_PARAMETER HighCount is NULL.
1118
  @retval EFI_INVALID_PARAMETER HighCount is NULL.
1076
  @retval EFI_DEVICE_ERROR      The device is not functioning properly.
1119
  @retval EFI_DEVICE_ERROR      The device is not functioning properly.
1120
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1121
                                The platform should describe this runtime service as unsupported at runtime
1122
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
1077
1123
1078
**/
1124
**/
1079
typedef
1125
typedef
Lines 1292-1303 EFI_STATUS Link Here
1292
  OUT VOID                     **Interface
1338
  OUT VOID                     **Interface
1293
  );
1339
  );
1294
1340
1295
#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
1341
#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL   0x00000001
1296
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
1342
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL         0x00000002
1297
#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
1343
#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL        0x00000004
1298
#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
1344
#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER  0x00000008
1299
#define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
1345
#define EFI_OPEN_PROTOCOL_BY_DRIVER            0x00000010
1300
#define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
1346
#define EFI_OPEN_PROTOCOL_EXCLUSIVE            0x00000020
1301
1347
1302
/**
1348
/**
1303
  Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
1349
  Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the
Lines 1331-1343 EFI_STATUS Link Here
1331
(EFIAPI *EFI_OPEN_PROTOCOL)(
1377
(EFIAPI *EFI_OPEN_PROTOCOL)(
1332
  IN  EFI_HANDLE                Handle,
1378
  IN  EFI_HANDLE                Handle,
1333
  IN  EFI_GUID                  *Protocol,
1379
  IN  EFI_GUID                  *Protocol,
1334
  OUT VOID                      **Interface, OPTIONAL
1380
  OUT VOID                      **Interface  OPTIONAL,
1335
  IN  EFI_HANDLE                AgentHandle,
1381
  IN  EFI_HANDLE                AgentHandle,
1336
  IN  EFI_HANDLE                ControllerHandle,
1382
  IN  EFI_HANDLE                ControllerHandle,
1337
  IN  UINT32                    Attributes
1383
  IN  UINT32                    Attributes
1338
  );
1384
  );
1339
1385
1340
1341
/**
1386
/**
1342
  Closes a protocol on a handle that was opened using OpenProtocol().
1387
  Closes a protocol on a handle that was opened using OpenProtocol().
1343
1388
Lines 1372-1381 EFI_STATUS Link Here
1372
/// EFI Oprn Protocol Information Entry
1417
/// EFI Oprn Protocol Information Entry
1373
///
1418
///
1374
typedef struct {
1419
typedef struct {
1375
  EFI_HANDLE  AgentHandle;
1420
  EFI_HANDLE    AgentHandle;
1376
  EFI_HANDLE  ControllerHandle;
1421
  EFI_HANDLE    ControllerHandle;
1377
  UINT32      Attributes;
1422
  UINT32        Attributes;
1378
  UINT32      OpenCount;
1423
  UINT32        OpenCount;
1379
} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
1424
} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
1380
1425
1381
/**
1426
/**
Lines 1499-1506 typedef Link Here
1499
EFI_STATUS
1544
EFI_STATUS
1500
(EFIAPI *EFI_LOCATE_HANDLE)(
1545
(EFIAPI *EFI_LOCATE_HANDLE)(
1501
  IN     EFI_LOCATE_SEARCH_TYPE   SearchType,
1546
  IN     EFI_LOCATE_SEARCH_TYPE   SearchType,
1502
  IN     EFI_GUID                 *Protocol,    OPTIONAL
1547
  IN     EFI_GUID                 *Protocol     OPTIONAL,
1503
  IN     VOID                     *SearchKey,   OPTIONAL
1548
  IN     VOID                     *SearchKey    OPTIONAL,
1504
  IN OUT UINTN                    *BufferSize,
1549
  IN OUT UINTN                    *BufferSize,
1505
  OUT    EFI_HANDLE               *Buffer
1550
  OUT    EFI_HANDLE               *Buffer
1506
  );
1551
  );
Lines 1572-1579 typedef Link Here
1572
EFI_STATUS
1617
EFI_STATUS
1573
(EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(
1618
(EFIAPI *EFI_LOCATE_HANDLE_BUFFER)(
1574
  IN     EFI_LOCATE_SEARCH_TYPE       SearchType,
1619
  IN     EFI_LOCATE_SEARCH_TYPE       SearchType,
1575
  IN     EFI_GUID                     *Protocol,      OPTIONAL
1620
  IN     EFI_GUID                     *Protocol       OPTIONAL,
1576
  IN     VOID                         *SearchKey,     OPTIONAL
1621
  IN     VOID                         *SearchKey      OPTIONAL,
1577
  OUT    UINTN                        *NoHandles,
1622
  OUT    UINTN                        *NoHandles,
1578
  OUT    EFI_HANDLE                   **Buffer
1623
  OUT    EFI_HANDLE                   **Buffer
1579
  );
1624
  );
Lines 1599-1605 typedef Link Here
1599
EFI_STATUS
1644
EFI_STATUS
1600
(EFIAPI *EFI_LOCATE_PROTOCOL)(
1645
(EFIAPI *EFI_LOCATE_PROTOCOL)(
1601
  IN  EFI_GUID  *Protocol,
1646
  IN  EFI_GUID  *Protocol,
1602
  IN  VOID      *Registration, OPTIONAL
1647
  IN  VOID      *Registration  OPTIONAL,
1603
  OUT VOID      **Interface
1648
  OUT VOID      **Interface
1604
  );
1649
  );
1605
1650
Lines 1610-1629 typedef struct { Link Here
1610
  ///
1655
  ///
1611
  /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
1656
  /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
1612
  ///
1657
  ///
1613
  UINT64                  Length;
1658
  UINT64    Length;
1614
  union {
1659
  union {
1615
    ///
1660
    ///
1616
    /// Physical address of the data block. This member of the union is
1661
    /// Physical address of the data block. This member of the union is
1617
    /// used if Length is not equal to zero.
1662
    /// used if Length is not equal to zero.
1618
    ///
1663
    ///
1619
    EFI_PHYSICAL_ADDRESS  DataBlock;
1664
    EFI_PHYSICAL_ADDRESS    DataBlock;
1620
    ///
1665
    ///
1621
    /// Physical address of another block of
1666
    /// Physical address of another block of
1622
    /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
1667
    /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
1623
    /// member of the union is used if Length is equal to zero. If
1668
    /// member of the union is used if Length is equal to zero. If
1624
    /// ContinuationPointer is zero this entry represents the end of the list.
1669
    /// ContinuationPointer is zero this entry represents the end of the list.
1625
    ///
1670
    ///
1626
    EFI_PHYSICAL_ADDRESS  ContinuationPointer;
1671
    EFI_PHYSICAL_ADDRESS    ContinuationPointer;
1627
  } Union;
1672
  } Union;
1628
} EFI_CAPSULE_BLOCK_DESCRIPTOR;
1673
} EFI_CAPSULE_BLOCK_DESCRIPTOR;
1629
1674
Lines 1634-1656 typedef struct { Link Here
1634
  ///
1679
  ///
1635
  /// A GUID that defines the contents of a capsule.
1680
  /// A GUID that defines the contents of a capsule.
1636
  ///
1681
  ///
1637
  EFI_GUID          CapsuleGuid;
1682
  EFI_GUID    CapsuleGuid;
1638
  ///
1683
  ///
1639
  /// The size of the capsule header. This may be larger than the size of
1684
  /// The size of the capsule header. This may be larger than the size of
1640
  /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
1685
  /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
1641
  /// extended header entries
1686
  /// extended header entries
1642
  ///
1687
  ///
1643
  UINT32            HeaderSize;
1688
  UINT32      HeaderSize;
1644
  ///
1689
  ///
1645
  /// Bit-mapped list describing the capsule attributes. The Flag values
1690
  /// Bit-mapped list describing the capsule attributes. The Flag values
1646
  /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
1691
  /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
1647
  /// of 0x10000 - 0xFFFFFFFF are defined by this specification
1692
  /// of 0x10000 - 0xFFFFFFFF are defined by this specification
1648
  ///
1693
  ///
1649
  UINT32            Flags;
1694
  UINT32      Flags;
1650
  ///
1695
  ///
1651
  /// Size in bytes of the capsule.
1696
  /// Size in bytes of the capsule (including capsule header).
1652
  ///
1697
  ///
1653
  UINT32            CapsuleImageSize;
1698
  UINT32      CapsuleImageSize;
1654
} EFI_CAPSULE_HEADER;
1699
} EFI_CAPSULE_HEADER;
1655
1700
1656
///
1701
///
Lines 1662-1677 typedef struct { Link Here
1662
  ///
1707
  ///
1663
  /// the size of the array of capsules.
1708
  /// the size of the array of capsules.
1664
  ///
1709
  ///
1665
  UINT32   CapsuleArrayNumber;
1710
  UINT32    CapsuleArrayNumber;
1666
  ///
1711
  ///
1667
  /// Point to an array of capsules that contain the same CapsuleGuid value.
1712
  /// Point to an array of capsules that contain the same CapsuleGuid value.
1668
  ///
1713
  ///
1669
  VOID*    CapsulePtr[1];
1714
  VOID      *CapsulePtr[1];
1670
} EFI_CAPSULE_TABLE;
1715
} EFI_CAPSULE_TABLE;
1671
1716
1672
#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET          0x00010000
1717
#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET   0x00010000
1673
#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE         0x00020000
1718
#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE  0x00020000
1674
#define CAPSULE_FLAGS_INITIATE_RESET                0x00040000
1719
#define CAPSULE_FLAGS_INITIATE_RESET         0x00040000
1675
1720
1676
/**
1721
/**
1677
  Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
1722
  Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
Lines 1701-1706 typedef struct { Link Here
1701
                                in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1746
                                in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1702
  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
1747
  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
1703
                                the capsule is compatible with this platform but there are insufficient resources to process.
1748
                                the capsule is compatible with this platform but there are insufficient resources to process.
1749
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1750
                                The platform should describe this runtime service as unsupported at runtime
1751
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
1704
1752
1705
**/
1753
**/
1706
typedef
1754
typedef
Lines 1732-1737 EFI_STATUS Link Here
1732
                                in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1780
                                in runtime. The caller may resubmit the capsule prior to ExitBootServices().
1733
  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
1781
  @retval EFI_OUT_OF_RESOURCES  When ExitBootServices() has not been previously called then this error indicates
1734
                                the capsule is compatible with this platform but there are insufficient resources to process.
1782
                                the capsule is compatible with this platform but there are insufficient resources to process.
1783
  @retval EFI_UNSUPPORTED       This call is not supported by this platform at the time the call is made.
1784
                                The platform should describe this runtime service as unsupported at runtime
1785
                                via an EFI_RT_PROPERTIES_TABLE configuration table.
1735
1786
1736
**/
1787
**/
1737
typedef
1788
typedef
Lines 1814-1863 typedef struct { Link Here
1814
  ///
1865
  ///
1815
  /// The table header for the EFI Runtime Services Table.
1866
  /// The table header for the EFI Runtime Services Table.
1816
  ///
1867
  ///
1817
  EFI_TABLE_HEADER                Hdr;
1868
  EFI_TABLE_HEADER                  Hdr;
1818
1869
1819
  //
1870
  //
1820
  // Time Services
1871
  // Time Services
1821
  //
1872
  //
1822
  EFI_GET_TIME                    GetTime;
1873
  EFI_GET_TIME                      GetTime;
1823
  EFI_SET_TIME                    SetTime;
1874
  EFI_SET_TIME                      SetTime;
1824
  EFI_GET_WAKEUP_TIME             GetWakeupTime;
1875
  EFI_GET_WAKEUP_TIME               GetWakeupTime;
1825
  EFI_SET_WAKEUP_TIME             SetWakeupTime;
1876
  EFI_SET_WAKEUP_TIME               SetWakeupTime;
1826
1877
1827
  //
1878
  //
1828
  // Virtual Memory Services
1879
  // Virtual Memory Services
1829
  //
1880
  //
1830
  EFI_SET_VIRTUAL_ADDRESS_MAP     SetVirtualAddressMap;
1881
  EFI_SET_VIRTUAL_ADDRESS_MAP       SetVirtualAddressMap;
1831
  EFI_CONVERT_POINTER             ConvertPointer;
1882
  EFI_CONVERT_POINTER               ConvertPointer;
1832
1883
1833
  //
1884
  //
1834
  // Variable Services
1885
  // Variable Services
1835
  //
1886
  //
1836
  EFI_GET_VARIABLE                GetVariable;
1887
  EFI_GET_VARIABLE                  GetVariable;
1837
  EFI_GET_NEXT_VARIABLE_NAME      GetNextVariableName;
1888
  EFI_GET_NEXT_VARIABLE_NAME        GetNextVariableName;
1838
  EFI_SET_VARIABLE                SetVariable;
1889
  EFI_SET_VARIABLE                  SetVariable;
1839
1890
1840
  //
1891
  //
1841
  // Miscellaneous Services
1892
  // Miscellaneous Services
1842
  //
1893
  //
1843
  EFI_GET_NEXT_HIGH_MONO_COUNT    GetNextHighMonotonicCount;
1894
  EFI_GET_NEXT_HIGH_MONO_COUNT      GetNextHighMonotonicCount;
1844
  EFI_RESET_SYSTEM                ResetSystem;
1895
  EFI_RESET_SYSTEM                  ResetSystem;
1845
1896
1846
  //
1897
  //
1847
  // UEFI 2.0 Capsule Services
1898
  // UEFI 2.0 Capsule Services
1848
  //
1899
  //
1849
  EFI_UPDATE_CAPSULE              UpdateCapsule;
1900
  EFI_UPDATE_CAPSULE                UpdateCapsule;
1850
  EFI_QUERY_CAPSULE_CAPABILITIES  QueryCapsuleCapabilities;
1901
  EFI_QUERY_CAPSULE_CAPABILITIES    QueryCapsuleCapabilities;
1851
1902
1852
  //
1903
  //
1853
  // Miscellaneous UEFI 2.0 Service
1904
  // Miscellaneous UEFI 2.0 Service
1854
  //
1905
  //
1855
  EFI_QUERY_VARIABLE_INFO         QueryVariableInfo;
1906
  EFI_QUERY_VARIABLE_INFO           QueryVariableInfo;
1856
} EFI_RUNTIME_SERVICES;
1907
} EFI_RUNTIME_SERVICES;
1857
1908
1858
1909
#define EFI_BOOT_SERVICES_SIGNATURE  SIGNATURE_64 ('B','O','O','T','S','E','R','V')
1859
#define EFI_BOOT_SERVICES_SIGNATURE   SIGNATURE_64 ('B','O','O','T','S','E','R','V')
1910
#define EFI_BOOT_SERVICES_REVISION   EFI_SPECIFICATION_VERSION
1860
#define EFI_BOOT_SERVICES_REVISION    EFI_SPECIFICATION_VERSION
1861
1911
1862
///
1912
///
1863
/// EFI Boot Services Table.
1913
/// EFI Boot Services Table.
Lines 1866-1960 typedef struct { Link Here
1866
  ///
1916
  ///
1867
  /// The table header for the EFI Boot Services Table.
1917
  /// The table header for the EFI Boot Services Table.
1868
  ///
1918
  ///
1869
  EFI_TABLE_HEADER                Hdr;
1919
  EFI_TABLE_HEADER                              Hdr;
1870
1920
1871
  //
1921
  //
1872
  // Task Priority Services
1922
  // Task Priority Services
1873
  //
1923
  //
1874
  EFI_RAISE_TPL                   RaiseTPL;
1924
  EFI_RAISE_TPL                                 RaiseTPL;
1875
  EFI_RESTORE_TPL                 RestoreTPL;
1925
  EFI_RESTORE_TPL                               RestoreTPL;
1876
1926
1877
  //
1927
  //
1878
  // Memory Services
1928
  // Memory Services
1879
  //
1929
  //
1880
  EFI_ALLOCATE_PAGES              AllocatePages;
1930
  EFI_ALLOCATE_PAGES                            AllocatePages;
1881
  EFI_FREE_PAGES                  FreePages;
1931
  EFI_FREE_PAGES                                FreePages;
1882
  EFI_GET_MEMORY_MAP              GetMemoryMap;
1932
  EFI_GET_MEMORY_MAP                            GetMemoryMap;
1883
  EFI_ALLOCATE_POOL               AllocatePool;
1933
  EFI_ALLOCATE_POOL                             AllocatePool;
1884
  EFI_FREE_POOL                   FreePool;
1934
  EFI_FREE_POOL                                 FreePool;
1885
1935
1886
  //
1936
  //
1887
  // Event & Timer Services
1937
  // Event & Timer Services
1888
  //
1938
  //
1889
  EFI_CREATE_EVENT                  CreateEvent;
1939
  EFI_CREATE_EVENT                              CreateEvent;
1890
  EFI_SET_TIMER                     SetTimer;
1940
  EFI_SET_TIMER                                 SetTimer;
1891
  EFI_WAIT_FOR_EVENT                WaitForEvent;
1941
  EFI_WAIT_FOR_EVENT                            WaitForEvent;
1892
  EFI_SIGNAL_EVENT                  SignalEvent;
1942
  EFI_SIGNAL_EVENT                              SignalEvent;
1893
  EFI_CLOSE_EVENT                   CloseEvent;
1943
  EFI_CLOSE_EVENT                               CloseEvent;
1894
  EFI_CHECK_EVENT                   CheckEvent;
1944
  EFI_CHECK_EVENT                               CheckEvent;
1895
1945
1896
  //
1946
  //
1897
  // Protocol Handler Services
1947
  // Protocol Handler Services
1898
  //
1948
  //
1899
  EFI_INSTALL_PROTOCOL_INTERFACE    InstallProtocolInterface;
1949
  EFI_INSTALL_PROTOCOL_INTERFACE                InstallProtocolInterface;
1900
  EFI_REINSTALL_PROTOCOL_INTERFACE  ReinstallProtocolInterface;
1950
  EFI_REINSTALL_PROTOCOL_INTERFACE              ReinstallProtocolInterface;
1901
  EFI_UNINSTALL_PROTOCOL_INTERFACE  UninstallProtocolInterface;
1951
  EFI_UNINSTALL_PROTOCOL_INTERFACE              UninstallProtocolInterface;
1902
  EFI_HANDLE_PROTOCOL               HandleProtocol;
1952
  EFI_HANDLE_PROTOCOL                           HandleProtocol;
1903
  VOID                              *Reserved;
1953
  VOID                                          *Reserved;
1904
  EFI_REGISTER_PROTOCOL_NOTIFY      RegisterProtocolNotify;
1954
  EFI_REGISTER_PROTOCOL_NOTIFY                  RegisterProtocolNotify;
1905
  EFI_LOCATE_HANDLE                 LocateHandle;
1955
  EFI_LOCATE_HANDLE                             LocateHandle;
1906
  EFI_LOCATE_DEVICE_PATH            LocateDevicePath;
1956
  EFI_LOCATE_DEVICE_PATH                        LocateDevicePath;
1907
  EFI_INSTALL_CONFIGURATION_TABLE   InstallConfigurationTable;
1957
  EFI_INSTALL_CONFIGURATION_TABLE               InstallConfigurationTable;
1908
1958
1909
  //
1959
  //
1910
  // Image Services
1960
  // Image Services
1911
  //
1961
  //
1912
  EFI_IMAGE_LOAD                    LoadImage;
1962
  EFI_IMAGE_LOAD                                LoadImage;
1913
  EFI_IMAGE_START                   StartImage;
1963
  EFI_IMAGE_START                               StartImage;
1914
  EFI_EXIT                          Exit;
1964
  EFI_EXIT                                      Exit;
1915
  EFI_IMAGE_UNLOAD                  UnloadImage;
1965
  EFI_IMAGE_UNLOAD                              UnloadImage;
1916
  EFI_EXIT_BOOT_SERVICES            ExitBootServices;
1966
  EFI_EXIT_BOOT_SERVICES                        ExitBootServices;
1917
1967
1918
  //
1968
  //
1919
  // Miscellaneous Services
1969
  // Miscellaneous Services
1920
  //
1970
  //
1921
  EFI_GET_NEXT_MONOTONIC_COUNT      GetNextMonotonicCount;
1971
  EFI_GET_NEXT_MONOTONIC_COUNT                  GetNextMonotonicCount;
1922
  EFI_STALL                         Stall;
1972
  EFI_STALL                                     Stall;
1923
  EFI_SET_WATCHDOG_TIMER            SetWatchdogTimer;
1973
  EFI_SET_WATCHDOG_TIMER                        SetWatchdogTimer;
1924
1974
1925
  //
1975
  //
1926
  // DriverSupport Services
1976
  // DriverSupport Services
1927
  //
1977
  //
1928
  EFI_CONNECT_CONTROLLER            ConnectController;
1978
  EFI_CONNECT_CONTROLLER                        ConnectController;
1929
  EFI_DISCONNECT_CONTROLLER         DisconnectController;
1979
  EFI_DISCONNECT_CONTROLLER                     DisconnectController;
1930
1980
1931
  //
1981
  //
1932
  // Open and Close Protocol Services
1982
  // Open and Close Protocol Services
1933
  //
1983
  //
1934
  EFI_OPEN_PROTOCOL                 OpenProtocol;
1984
  EFI_OPEN_PROTOCOL                             OpenProtocol;
1935
  EFI_CLOSE_PROTOCOL                CloseProtocol;
1985
  EFI_CLOSE_PROTOCOL                            CloseProtocol;
1936
  EFI_OPEN_PROTOCOL_INFORMATION     OpenProtocolInformation;
1986
  EFI_OPEN_PROTOCOL_INFORMATION                 OpenProtocolInformation;
1937
1987
1938
  //
1988
  //
1939
  // Library Services
1989
  // Library Services
1940
  //
1990
  //
1941
  EFI_PROTOCOLS_PER_HANDLE          ProtocolsPerHandle;
1991
  EFI_PROTOCOLS_PER_HANDLE                      ProtocolsPerHandle;
1942
  EFI_LOCATE_HANDLE_BUFFER          LocateHandleBuffer;
1992
  EFI_LOCATE_HANDLE_BUFFER                      LocateHandleBuffer;
1943
  EFI_LOCATE_PROTOCOL               LocateProtocol;
1993
  EFI_LOCATE_PROTOCOL                           LocateProtocol;
1944
  EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES    InstallMultipleProtocolInterfaces;
1994
  EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES      InstallMultipleProtocolInterfaces;
1945
  EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES  UninstallMultipleProtocolInterfaces;
1995
  EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES    UninstallMultipleProtocolInterfaces;
1946
1996
1947
  //
1997
  //
1948
  // 32-bit CRC Services
1998
  // 32-bit CRC Services
1949
  //
1999
  //
1950
  EFI_CALCULATE_CRC32               CalculateCrc32;
2000
  EFI_CALCULATE_CRC32                           CalculateCrc32;
1951
2001
1952
  //
2002
  //
1953
  // Miscellaneous Services
2003
  // Miscellaneous Services
1954
  //
2004
  //
1955
  EFI_COPY_MEM                      CopyMem;
2005
  EFI_COPY_MEM                                  CopyMem;
1956
  EFI_SET_MEM                       SetMem;
2006
  EFI_SET_MEM                                   SetMem;
1957
  EFI_CREATE_EVENT_EX               CreateEventEx;
2007
  EFI_CREATE_EVENT_EX                           CreateEventEx;
1958
} EFI_BOOT_SERVICES;
2008
} EFI_BOOT_SERVICES;
1959
2009
1960
///
2010
///
Lines 1965-1975 typedef struct { Link Here
1965
  ///
2015
  ///
1966
  /// The 128-bit GUID value that uniquely identifies the system configuration table.
2016
  /// The 128-bit GUID value that uniquely identifies the system configuration table.
1967
  ///
2017
  ///
1968
  EFI_GUID                          VendorGuid;
2018
  EFI_GUID    VendorGuid;
1969
  ///
2019
  ///
1970
  /// A pointer to the table associated with VendorGuid.
2020
  /// A pointer to the table associated with VendorGuid.
1971
  ///
2021
  ///
1972
  VOID                              *VendorTable;
2022
  VOID        *VendorTable;
1973
} EFI_CONFIGURATION_TABLE;
2023
} EFI_CONFIGURATION_TABLE;
1974
2024
1975
///
2025
///
Lines 1979-2041 typedef struct { Link Here
1979
  ///
2029
  ///
1980
  /// The table header for the EFI System Table.
2030
  /// The table header for the EFI System Table.
1981
  ///
2031
  ///
1982
  EFI_TABLE_HEADER                  Hdr;
2032
  EFI_TABLE_HEADER                   Hdr;
1983
  ///
2033
  ///
1984
  /// A pointer to a null terminated string that identifies the vendor
2034
  /// A pointer to a null terminated string that identifies the vendor
1985
  /// that produces the system firmware for the platform.
2035
  /// that produces the system firmware for the platform.
1986
  ///
2036
  ///
1987
  CHAR16                            *FirmwareVendor;
2037
  CHAR16                             *FirmwareVendor;
1988
  ///
2038
  ///
1989
  /// A firmware vendor specific value that identifies the revision
2039
  /// A firmware vendor specific value that identifies the revision
1990
  /// of the system firmware for the platform.
2040
  /// of the system firmware for the platform.
1991
  ///
2041
  ///
1992
  UINT32                            FirmwareRevision;
2042
  UINT32                             FirmwareRevision;
1993
  ///
2043
  ///
1994
  /// The handle for the active console input device. This handle must support
2044
  /// The handle for the active console input device. This handle must support
1995
  /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
2045
  /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. If
2046
  /// there is no active console, these protocols must still be present.
1996
  ///
2047
  ///
1997
  EFI_HANDLE                        ConsoleInHandle;
2048
  EFI_HANDLE                         ConsoleInHandle;
1998
  ///
2049
  ///
1999
  /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
2050
  /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
2000
  /// associated with ConsoleInHandle.
2051
  /// associated with ConsoleInHandle.
2001
  ///
2052
  ///
2002
  EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *ConIn;
2053
  EFI_SIMPLE_TEXT_INPUT_PROTOCOL     *ConIn;
2003
  ///
2054
  ///
2004
  /// The handle for the active console output device.
2055
  /// The handle for the active console output device. This handle must support the
2056
  /// EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. If there is no active console, these protocols
2057
  /// must still be present.
2005
  ///
2058
  ///
2006
  EFI_HANDLE                        ConsoleOutHandle;
2059
  EFI_HANDLE                         ConsoleOutHandle;
2007
  ///
2060
  ///
2008
  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
2061
  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
2009
  /// that is associated with ConsoleOutHandle.
2062
  /// that is associated with ConsoleOutHandle.
2010
  ///
2063
  ///
2011
  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *ConOut;
2064
  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *ConOut;
2012
  ///
2065
  ///
2013
  /// The handle for the active standard error console device.
2066
  /// The handle for the active standard error console device.
2014
  /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
2067
  /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. If there
2068
  /// is no active console, this protocol must still be present.
2015
  ///
2069
  ///
2016
  EFI_HANDLE                        StandardErrorHandle;
2070
  EFI_HANDLE                         StandardErrorHandle;
2017
  ///
2071
  ///
2018
  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
2072
  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
2019
  /// that is associated with StandardErrorHandle.
2073
  /// that is associated with StandardErrorHandle.
2020
  ///
2074
  ///
2021
  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *StdErr;
2075
  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL    *StdErr;
2022
  ///
2076
  ///
2023
  /// A pointer to the EFI Runtime Services Table.
2077
  /// A pointer to the EFI Runtime Services Table.
2024
  ///
2078
  ///
2025
  EFI_RUNTIME_SERVICES              *RuntimeServices;
2079
  EFI_RUNTIME_SERVICES               *RuntimeServices;
2026
  ///
2080
  ///
2027
  /// A pointer to the EFI Boot Services Table.
2081
  /// A pointer to the EFI Boot Services Table.
2028
  ///
2082
  ///
2029
  EFI_BOOT_SERVICES                 *BootServices;
2083
  EFI_BOOT_SERVICES                  *BootServices;
2030
  ///
2084
  ///
2031
  /// The number of system configuration tables in the buffer ConfigurationTable.
2085
  /// The number of system configuration tables in the buffer ConfigurationTable.
2032
  ///
2086
  ///
2033
  UINTN                             NumberOfTableEntries;
2087
  UINTN                              NumberOfTableEntries;
2034
  ///
2088
  ///
2035
  /// A pointer to the system configuration tables.
2089
  /// A pointer to the system configuration tables.
2036
  /// The number of entries in the table is NumberOfTableEntries.
2090
  /// The number of entries in the table is NumberOfTableEntries.
2037
  ///
2091
  ///
2038
  EFI_CONFIGURATION_TABLE           *ConfigurationTable;
2092
  EFI_CONFIGURATION_TABLE            *ConfigurationTable;
2039
} EFI_SYSTEM_TABLE;
2093
} EFI_SYSTEM_TABLE;
2040
2094
2041
/**
2095
/**
Lines 2070-2082 typedef struct _EFI_LOAD_OPTION { Link Here
2070
  /// The attributes for this load option entry. All unused bits must be zero
2124
  /// The attributes for this load option entry. All unused bits must be zero
2071
  /// and are reserved by the UEFI specification for future growth.
2125
  /// and are reserved by the UEFI specification for future growth.
2072
  ///
2126
  ///
2073
  UINT32                           Attributes;
2127
  UINT32    Attributes;
2074
  ///
2128
  ///
2075
  /// Length in bytes of the FilePathList. OptionalData starts at offset
2129
  /// Length in bytes of the FilePathList. OptionalData starts at offset
2076
  /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
2130
  /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength
2077
  /// of the EFI_LOAD_OPTION descriptor.
2131
  /// of the EFI_LOAD_OPTION descriptor.
2078
  ///
2132
  ///
2079
  UINT16                           FilePathListLength;
2133
  UINT16    FilePathListLength;
2080
  ///
2134
  ///
2081
  /// The user readable description for the load option.
2135
  /// The user readable description for the load option.
2082
  /// This field ends with a Null character.
2136
  /// This field ends with a Null character.
Lines 2108-2125 typedef struct _EFI_LOAD_OPTION { Link Here
2108
//
2162
//
2109
// EFI Load Options Attributes
2163
// EFI Load Options Attributes
2110
//
2164
//
2111
#define LOAD_OPTION_ACTIVE              0x00000001
2165
#define LOAD_OPTION_ACTIVE           0x00000001
2112
#define LOAD_OPTION_FORCE_RECONNECT     0x00000002
2166
#define LOAD_OPTION_FORCE_RECONNECT  0x00000002
2113
#define LOAD_OPTION_HIDDEN              0x00000008
2167
#define LOAD_OPTION_HIDDEN           0x00000008
2114
#define LOAD_OPTION_CATEGORY            0x00001F00
2168
#define LOAD_OPTION_CATEGORY         0x00001F00
2115
2169
2116
#define LOAD_OPTION_CATEGORY_BOOT       0x00000000
2170
#define LOAD_OPTION_CATEGORY_BOOT  0x00000000
2117
#define LOAD_OPTION_CATEGORY_APP        0x00000100
2171
#define LOAD_OPTION_CATEGORY_APP   0x00000100
2118
2172
2119
#define EFI_BOOT_OPTION_SUPPORT_KEY     0x00000001
2173
#define EFI_BOOT_OPTION_SUPPORT_KEY      0x00000001
2120
#define EFI_BOOT_OPTION_SUPPORT_APP     0x00000002
2174
#define EFI_BOOT_OPTION_SUPPORT_APP      0x00000002
2121
#define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010
2175
#define EFI_BOOT_OPTION_SUPPORT_SYSPREP  0x00000010
2122
#define EFI_BOOT_OPTION_SUPPORT_COUNT   0x00000300
2176
#define EFI_BOOT_OPTION_SUPPORT_COUNT    0x00000300
2123
2177
2124
///
2178
///
2125
/// EFI Boot Key Data
2179
/// EFI Boot Key Data
Lines 2129-2168 typedef union { Link Here
2129
    ///
2183
    ///
2130
    /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
2184
    /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
2131
    ///
2185
    ///
2132
    UINT32  Revision        : 8;
2186
    UINT32    Revision       : 8;
2133
    ///
2187
    ///
2134
    /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
2188
    /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
2135
    ///
2189
    ///
2136
    UINT32  ShiftPressed    : 1;
2190
    UINT32    ShiftPressed   : 1;
2137
    ///
2191
    ///
2138
    /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
2192
    /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
2139
    ///
2193
    ///
2140
    UINT32  ControlPressed  : 1;
2194
    UINT32    ControlPressed : 1;
2141
    ///
2195
    ///
2142
    /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
2196
    /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
2143
    ///
2197
    ///
2144
    UINT32  AltPressed      : 1;
2198
    UINT32    AltPressed     : 1;
2145
    ///
2199
    ///
2146
    /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
2200
    /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
2147
    ///
2201
    ///
2148
    UINT32  LogoPressed     : 1;
2202
    UINT32    LogoPressed    : 1;
2149
    ///
2203
    ///
2150
    /// The Menu key must be pressed (1) or must not be pressed (0).
2204
    /// The Menu key must be pressed (1) or must not be pressed (0).
2151
    ///
2205
    ///
2152
    UINT32  MenuPressed     : 1;
2206
    UINT32    MenuPressed    : 1;
2153
    ///
2207
    ///
2154
    /// The SysReq key must be pressed (1) or must not be pressed (0).
2208
    /// The SysReq key must be pressed (1) or must not be pressed (0).
2155
    ///
2209
    ///
2156
    UINT32  SysReqPressed    : 1;
2210
    UINT32    SysReqPressed  : 1;
2157
    UINT32  Reserved        : 16;
2211
    UINT32    Reserved       : 16;
2158
    ///
2212
    ///
2159
    /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
2213
    /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
2160
    /// zero, then only the shift state is considered. If more than one, then the boot option will
2214
    /// zero, then only the shift state is considered. If more than one, then the boot option will
2161
    /// only be launched if all of the specified keys are pressed with the same shift state.
2215
    /// only be launched if all of the specified keys are pressed with the same shift state.
2162
    ///
2216
    ///
2163
    UINT32  InputKeyCount   : 2;
2217
    UINT32    InputKeyCount  : 2;
2164
  } Options;
2218
  } Options;
2165
  UINT32  PackedValue;
2219
  UINT32    PackedValue;
2166
} EFI_BOOT_KEY_DATA;
2220
} EFI_BOOT_KEY_DATA;
2167
2221
2168
///
2222
///
Lines 2173-2228 typedef struct { Link Here
2173
  ///
2227
  ///
2174
  /// Specifies options about how the key will be processed.
2228
  /// Specifies options about how the key will be processed.
2175
  ///
2229
  ///
2176
  EFI_BOOT_KEY_DATA  KeyData;
2230
  EFI_BOOT_KEY_DATA    KeyData;
2177
  ///
2231
  ///
2178
  /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
2232
  /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
2179
  /// which BootOption refers. If the CRC-32s do not match this value, then this key
2233
  /// which BootOption refers. If the CRC-32s do not match this value, then this key
2180
  /// option is ignored.
2234
  /// option is ignored.
2181
  ///
2235
  ///
2182
  UINT32             BootOptionCrc;
2236
  UINT32               BootOptionCrc;
2183
  ///
2237
  ///
2184
  /// The Boot#### option which will be invoked if this key is pressed and the boot option
2238
  /// The Boot#### option which will be invoked if this key is pressed and the boot option
2185
  /// is active (LOAD_OPTION_ACTIVE is set).
2239
  /// is active (LOAD_OPTION_ACTIVE is set).
2186
  ///
2240
  ///
2187
  UINT16             BootOption;
2241
  UINT16               BootOption;
2188
  ///
2242
  ///
2189
  /// The key codes to compare against those returned by the
2243
  /// The key codes to compare against those returned by the
2190
  /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
2244
  /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
2191
  /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
2245
  /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
2192
  ///
2246
  ///
2193
  //EFI_INPUT_KEY      Keys[];
2247
  // EFI_INPUT_KEY      Keys[];
2194
} EFI_KEY_OPTION;
2248
} EFI_KEY_OPTION;
2195
#pragma pack()
2249
#pragma pack()
2196
2250
2197
//
2251
//
2198
// EFI File location to boot from on removable media devices
2252
// EFI File location to boot from on removable media devices
2199
//
2253
//
2200
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"
2254
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32         L"\\EFI\\BOOT\\BOOTIA32.EFI"
2201
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"
2255
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64         L"\\EFI\\BOOT\\BOOTIA64.EFI"
2202
#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"
2256
#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64          L"\\EFI\\BOOT\\BOOTX64.EFI"
2203
#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"
2257
#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM          L"\\EFI\\BOOT\\BOOTARM.EFI"
2204
#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
2258
#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64      L"\\EFI\\BOOT\\BOOTAA64.EFI"
2205
#define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64 L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
2259
#define EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64      L"\\EFI\\BOOT\\BOOTRISCV64.EFI"
2206
2260
#define EFI_REMOVABLE_MEDIA_FILE_NAME_LOONGARCH64  L"\\EFI\\BOOT\\BOOTLOONGARCH64.EFI"
2207
#if   defined (MDE_CPU_IA32)
2261
2208
  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
2262
#if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)
2209
#elif defined (MDE_CPU_X64)
2263
  #if   defined (MDE_CPU_IA32)
2210
  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_X64
2264
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
2211
#elif defined (MDE_CPU_EBC)
2265
  #elif defined (MDE_CPU_X64)
2212
#elif defined (MDE_CPU_ARM)
2266
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_X64
2213
  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
2267
  #elif defined (MDE_CPU_EBC)
2214
#elif defined (MDE_CPU_AARCH64)
2268
  #elif defined (MDE_CPU_ARM)
2215
  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
2269
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
2216
#elif defined (MDE_CPU_RISCV64)
2270
  #elif defined (MDE_CPU_AARCH64)
2217
  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
2271
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
2218
#else
2272
  #elif defined (MDE_CPU_RISCV64)
2219
  #error Unknown Processor Type
2273
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_RISCV64
2274
  #elif defined (MDE_CPU_LOONGARCH64)
2275
#define EFI_REMOVABLE_MEDIA_FILE_NAME  EFI_REMOVABLE_MEDIA_FILE_NAME_LOONGARCH64
2276
  #else
2277
    #error Unknown Processor Type
2278
  #endif
2220
#endif
2279
#endif
2221
2280
2222
//
2281
//
2223
// The directory within the active EFI System Partition defined for delivery of capsule to firmware
2282
// The directory within the active EFI System Partition defined for delivery of capsule to firmware
2224
//
2283
//
2225
#define EFI_CAPSULE_FILE_DIRECTORY            L"\\EFI\\UpdateCapsule\\"
2284
#define EFI_CAPSULE_FILE_DIRECTORY  L"\\EFI\\UpdateCapsule\\"
2226
2285
2227
#include <Uefi/UefiPxe.h>
2286
#include <Uefi/UefiPxe.h>
2228
#include <Uefi/UefiGpt.h>
2287
#include <Uefi/UefiGpt.h>
(-)b/sys/contrib/edk2/MdePkg.dec (-13 / +192 lines)
Lines 4-12 Link Here
4
# It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
4
# It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
5
# EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
5
# EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
6
#
6
#
7
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
7
# Copyright (c) 2007 - 2024, Intel Corporation. All rights reserved.<BR>
8
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
8
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
9
# (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>
9
# (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP<BR>
10
# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
11
# Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>
12
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
13
# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
10
#
14
#
11
# SPDX-License-Identifier: BSD-2-Clause-Patent
15
# SPDX-License-Identifier: BSD-2-Clause-Patent
12
#
16
#
Lines 23-28 Link Here
23
27
24
[Includes]
28
[Includes]
25
  Include
29
  Include
30
  Test/UnitTest/Include
31
  Test/Mock/Include
32
  Library/MipiSysTLib/mipisyst/library/include
26
33
27
[Includes.IA32]
34
[Includes.IA32]
28
  Include/Ia32
35
  Include/Ia32
Lines 42-47 Link Here
42
[Includes.RISCV64]
49
[Includes.RISCV64]
43
  Include/RiscV64
50
  Include/RiscV64
44
51
52
[Includes.LOONGARCH64]
53
  Include/LoongArch64
54
45
[LibraryClasses]
55
[LibraryClasses]
46
  ##  @libraryclass  Provides most usb APIs to support the Hid requests defined in Usb Hid 1.1 spec
56
  ##  @libraryclass  Provides most usb APIs to support the Hid requests defined in Usb Hid 1.1 spec
47
  #                  and the standard requests defined in Usb 1.1 spec.
57
  #                  and the standard requests defined in Usb 1.1 spec.
Lines 251-256 Link Here
251
  #
261
  #
252
  UnitTestLib|Include/Library/UnitTestLib.h
262
  UnitTestLib|Include/Library/UnitTestLib.h
253
263
264
  ## @libraryclass Provides service to get the manufacturer given JEP106 bytes.
265
  JedecJep106Lib|Include/Library/JedecJep106Lib.h
266
267
  ## @libraryclass Extension to BaseLib for host based unit tests that allows a
268
  #                subset of BaseLib services to be hooked for emulation.
269
  #
270
  UnitTestHostBaseLib|Test/UnitTest/Include/Library/UnitTestHostBaseLib.h
271
272
  ##  @libraryclass  This library provides an interface to request non-MMRAM pages to be mapped
273
  #                  or unblocked from inside MM environment.
274
  #
275
  MmUnblockMemoryLib|Include/Library/MmUnblockMemoryLib.h
276
277
  ##  @libraryclass  This library provides interfances to filter and trace port IO/MMIO/MSR access.
278
  #
279
  #
280
  RegisterFilterLib|Include/Library/RegisterFilterLib.h
281
282
  ##  @libraryclass  This library provides interfances to probe ConfidentialComputing guest type.
283
  #
284
  #
285
  CcProbeLib|Include/Library/CcProbeLib.h
286
287
  ## @libraryclass  Provides function for SMM CPU Rendezvous Library.
288
  SmmCpuRendezvousLib|Include/Library/SmmCpuRendezvousLib.h
289
290
  ##  @libraryclass  Provides services to generate Entropy using a TRNG.
291
  #
292
  ArmTrngLib|Include/Library/ArmTrngLib.h
293
294
  ##  @libraryclass  Provides APIs for third-party library libfdt.
295
  #
296
  FdtLib|Include/Library/FdtLib.h
297
298
  ##  @libraryclass  Provides general mipi sys-T services.
299
  #
300
  MipiSysTLib|Include/Library/MipiSysTLib.h
301
302
  ##  @libraryclass  Provides API to output Trace Hub debug message.
303
  #
304
  TraceHubDebugSysTLib|Include/Library/TraceHubDebugSysTLib.h
305
306
[LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
307
  ##  @libraryclass  Provides services to generate random number.
308
  #
309
  RngLib|Include/Library/RngLib.h
310
254
[LibraryClasses.IA32, LibraryClasses.X64]
311
[LibraryClasses.IA32, LibraryClasses.X64]
255
  ##  @libraryclass  Abstracts both S/W SMI generation and detection.
312
  ##  @libraryclass  Abstracts both S/W SMI generation and detection.
256
  ##
313
  ##
Lines 272-284 Link Here
272
  #
329
  #
273
  SmmPeriodicSmiLib|Include/Library/SmmPeriodicSmiLib.h
330
  SmmPeriodicSmiLib|Include/Library/SmmPeriodicSmiLib.h
274
331
275
  ##  @libraryclass  Provides services to generate random number.
276
  #
277
  RngLib|Include/Library/RngLib.h
278
279
  ##  @libraryclass  Provides services to log the SMI handler registration.
332
  ##  @libraryclass  Provides services to log the SMI handler registration.
280
  SmiHandlerProfileLib|Include/Library/SmiHandlerProfileLib.h
333
  SmiHandlerProfileLib|Include/Library/SmiHandlerProfileLib.h
281
334
335
  ##  @libraryclass  Provides function to support TDX processing.
336
  TdxLib|Include/Library/TdxLib.h
337
338
[LibraryClasses.RISCV64]
339
  ##  @libraryclass  Provides function to make ecalls to SBI
340
  BaseRiscVSbiLib|Include/Library/BaseRiscVSbiLib.h
341
282
[Guids]
342
[Guids]
283
  #
343
  #
284
  # GUID defined in UEFI2.1/UEFI2.0/EFI1.1
344
  # GUID defined in UEFI2.1/UEFI2.0/EFI1.1
Lines 376-386 Link Here
376
  ## Include/Guid/EventGroup.h
436
  ## Include/Guid/EventGroup.h
377
  gEfiEventReadyToBootGuid       = { 0x7CE88FB3, 0x4BD7, 0x4679, { 0x87, 0xA8, 0xA8, 0xD8, 0xDE, 0xE5, 0x0D, 0x2B }}
437
  gEfiEventReadyToBootGuid       = { 0x7CE88FB3, 0x4BD7, 0x4679, { 0x87, 0xA8, 0xA8, 0xD8, 0xDE, 0xE5, 0x0D, 0x2B }}
378
438
439
  ## Include/Guid/EventGroup.h
440
  gEfiEventAfterReadyToBootGuid  = { 0x3a2a00ad, 0x98b9, 0x4cdf, { 0xa4, 0x78, 0x70, 0x27, 0x77, 0xf1, 0xc1, 0x0b }}
441
379
  ## Include/Guid/EventGroup.h
442
  ## Include/Guid/EventGroup.h
380
  gEfiEventMemoryMapChangeGuid   = { 0x78BEE926, 0x692F, 0x48FD, { 0x9E, 0xDB, 0x01, 0x42, 0x2E, 0xF0, 0xD7, 0xAB }}
443
  gEfiEventMemoryMapChangeGuid   = { 0x78BEE926, 0x692F, 0x48FD, { 0x9E, 0xDB, 0x01, 0x42, 0x2E, 0xF0, 0xD7, 0xAB }}
381
444
382
  ## Include/Guid/EventGroup.h
445
  ## Include/Guid/EventGroup.h
383
  gEfiEventVirtualAddressChangeGuid = { 0x13FA7698, 0xC831, 0x49C7, { 0x87, 0xEA, 0x8F, 0x43, 0xFC, 0xC2, 0x51, 0x96 }}
446
  gEfiEventVirtualAddressChangeGuid   = { 0x13FA7698, 0xC831, 0x49C7, { 0x87, 0xEA, 0x8F, 0x43, 0xFC, 0xC2, 0x51, 0x96 }}
447
448
  ## Include/Guid/EventGroup.h
449
  gEfiEventBeforeExitBootServicesGuid = { 0x8BE0E274, 0x3970, 0x4B44, { 0x80, 0xC5, 0x1A, 0xB9, 0x50, 0x2F, 0x3B, 0xFC }}
384
450
385
  ## Include/Guid/EventGroup.h
451
  ## Include/Guid/EventGroup.h
386
  gEfiEventExitBootServicesGuid  = { 0x27ABF055, 0xB1B8, 0x4C26, { 0x80, 0x48, 0x74, 0x8F, 0x37, 0xBA, 0xA2, 0xDF }}
452
  gEfiEventExitBootServicesGuid  = { 0x27ABF055, 0xB1B8, 0x4C26, { 0x80, 0x48, 0x74, 0x8F, 0x37, 0xBA, 0xA2, 0xDF }}
Lines 577-582 Link Here
577
  gEfiRngAlgorithmX9313DesGuid       = { 0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 }}
643
  gEfiRngAlgorithmX9313DesGuid       = { 0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 }}
578
  gEfiRngAlgorithmX931AesGuid        = { 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 }}
644
  gEfiRngAlgorithmX931AesGuid        = { 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 }}
579
  gEfiRngAlgorithmRaw                = { 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 }}
645
  gEfiRngAlgorithmRaw                = { 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 }}
646
  gEfiRngAlgorithmArmRndr            = { 0x43d2fde3, 0x9d4e, 0x4d79, {0x02, 0x96, 0xa8, 0x9b, 0xca, 0x78, 0x08, 0x41 }}
580
647
581
  ## Include/Protocol/AdapterInformation.h
648
  ## Include/Protocol/AdapterInformation.h
582
  gEfiAdapterInfoMediaStateGuid       = { 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 }}
649
  gEfiAdapterInfoMediaStateGuid       = { 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 }}
Lines 663-675 Link Here
663
  gEfiJsonCapsuleIdGuid            = { 0x67d6f4cd, 0xd6b8, 0x4573, { 0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }}
730
  gEfiJsonCapsuleIdGuid            = { 0x67d6f4cd, 0xd6b8, 0x4573, { 0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }}
664
731
665
  ## Include/Guid/HiiPlatformSetupFormset.h
732
  ## Include/Guid/HiiPlatformSetupFormset.h
666
  gEfiHiiResetStyleFormsetGuid     = { 0x790217bd, 0xbecf, 0x485b, { 0x91, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }}
733
  gEfiHiiRestStyleFormsetGuid      = { 0x790217bd, 0xbecf, 0x485b, { 0x91, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }}
667
734
668
  # GUIDs defined in UEFI2.8a
735
  # GUIDs defined in UEFI2.8a
669
  #
736
  #
670
  ## Include/Guid/RtPropertiesTable.h
737
  ## Include/Guid/RtPropertiesTable.h
671
  gEfiRtPropertiesTableGuid      = { 0xeb66918a, 0x7eef, 0x402a, { 0x84, 0x2e, 0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9 }}
738
  gEfiRtPropertiesTableGuid      = { 0xeb66918a, 0x7eef, 0x402a, { 0x84, 0x2e, 0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9 }}
672
739
740
  ## Include/Protocol/SerilaIo.h
741
  gEfiSerialTerminalDeviceTypeGuid = { 0x6AD9A60F, 0x5815, 0x4C7C, { 0x8A, 0x10, 0x50, 0x53, 0xD2, 0xBF, 0x7A, 0x1B }}
742
743
  # GUIDs defined in UEFI2.10
744
  #
745
  ## GUID used to specify section with devdb content
746
  ## Include/Guid/DeviceAuthentication.h
747
  gEfiDeviceSignatureDatabaseGuid  = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a, 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }}
748
673
  #
749
  #
674
  # GUID defined in PI1.0
750
  # GUID defined in PI1.0
675
  #
751
  #
Lines 798-803 Link Here
798
  #
874
  #
799
  gTianoCustomDecompressGuid     = { 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 }}
875
  gTianoCustomDecompressGuid     = { 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 }}
800
876
877
  #
878
  # GUID used to provide initrd to linux via LoadFile2 protocol
879
  #
880
  gLinuxEfiInitrdMediaGuid       = {0x5568e427, 0x68fc, 0x4f3d, {0xac, 0x74, 0xca, 0x55, 0x52, 0x31, 0xcc, 0x68}}
881
882
  ## Include/Protocol/CcMeasurement.h
883
  gEfiCcFinalEventsTableGuid     = { 0xdd4a4648, 0x2de7, 0x4665, { 0x96, 0x4d, 0x21, 0xd9, 0xef, 0x5f, 0xb4, 0x46 }}
884
801
[Guids.IA32, Guids.X64]
885
[Guids.IA32, Guids.X64]
802
  ## Include/Guid/Cper.h
886
  ## Include/Guid/Cper.h
803
  gEfiIa32X64ErrorTypeCacheCheckGuid = { 0xA55701F5, 0xE3EF, 0x43de, { 0xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }}
887
  gEfiIa32X64ErrorTypeCacheCheckGuid = { 0xA55701F5, 0xE3EF, 0x43de, { 0xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }}
Lines 963-968 Link Here
963
  ## Include/Ppi/MmControl.h
1047
  ## Include/Ppi/MmControl.h
964
  gEfiPeiMmControlPpiGuid         =  { 0x61c68702, 0x4d7e, 0x4f43, { 0x8d, 0xef, 0xa7, 0x43, 0x5, 0xce, 0x74, 0xc5 }}
1048
  gEfiPeiMmControlPpiGuid         =  { 0x61c68702, 0x4d7e, 0x4f43, { 0x8d, 0xef, 0xa7, 0x43, 0x5, 0xce, 0x74, 0xc5 }}
965
1049
1050
  ## Include/Ppi/MmConfiguration.h
1051
  gEfiPeiMmConfigurationPpi       =  { 0xc109319, 0xc149, 0x450e, { 0xa3, 0xe3, 0xb9, 0xba, 0xdd, 0x9d, 0xc3, 0xa4 } }
1052
1053
  ## Include/Ppi/MmCommunication.h
1054
  gEfiPeiMmCommunicationPpiGuid   =  { 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } }
1055
966
  #
1056
  #
967
  # PPIs defined in PI 1.7.
1057
  # PPIs defined in PI 1.7.
968
  #
1058
  #
Lines 974-985 Link Here
974
  gEfiPeiDelayedDispatchPpiGuid  = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }}
1064
  gEfiPeiDelayedDispatchPpiGuid  = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }}
975
1065
976
[Protocols]
1066
[Protocols]
1067
  ## Include/Protocol/MemoryAccept.h
1068
  gEdkiiMemoryAcceptProtocolGuid = { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }}
1069
977
  ## Include/Protocol/Pcd.h
1070
  ## Include/Protocol/Pcd.h
978
  gPcdProtocolGuid               = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }}
1071
  gPcdProtocolGuid               = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }}
979
1072
980
  ## Include/Protocol/PcdInfo.h
1073
  ## Include/Protocol/PcdInfo.h
981
  gGetPcdInfoProtocolGuid        = { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }
1074
  gGetPcdInfoProtocolGuid        = { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }
982
1075
1076
  ## Include/Protocol/CcMeasurement.h
1077
  gEfiCcMeasurementProtocolGuid  = { 0x96751a3d, 0x72f4, 0x41a6, { 0xa7, 0x94, 0xed, 0x5d, 0x0e, 0x67, 0xae, 0x6b }}
1078
983
  #
1079
  #
984
  # Protocols defined in PI1.0.
1080
  # Protocols defined in PI1.0.
985
  #
1081
  #
Lines 1839-1844 Link Here
1839
  ## Include/Protocol/NvdimmLabel.h
1935
  ## Include/Protocol/NvdimmLabel.h
1840
  gEfiNvdimmLabelProtocolGuid               = { 0xd40b6b80, 0x97d5, 0x4282, { 0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 }}
1936
  gEfiNvdimmLabelProtocolGuid               = { 0xd40b6b80, 0x97d5, 0x4282, { 0xbb, 0x1d, 0x22, 0x3a, 0x16, 0x91, 0x80, 0x58 }}
1841
1937
1938
  #
1939
  # Protocols defined in UEFI2.8
1940
  #
1941
  ## Include/Protocol/RestEx.h
1942
  gEfiRestExProtocolGuid               = { 0x55648b91, 0xe7d, 0x40a3, { 0xa9, 0xb3, 0xa8, 0x15, 0xd7, 0xea, 0xdf, 0x97 }}
1943
  gEfiRestExServiceBindingProtocolGuid = { 0x456bbe01, 0x99d0, 0x45ea, { 0xbb, 0x5f, 0x16, 0xd8, 0x4b, 0xed, 0xc5, 0x59 }}
1944
1945
  ## Include/Protocol/RestJsonStructure.h
1946
  gEfiRestJsonStructureProtocolGuid  = { 0xa9a048f6, 0x48a0, 0x4714, {0xb7, 0xda, 0xa9, 0xad,0x87, 0xd4, 0xda, 0xc9 }}
1947
1948
  ## Include/Protocol/RedfishDiscover.h
1949
  gEfiRedfishDiscoverProtocolGuid      = { 0x5db12509, 0x4550, 0x4347, { 0x96, 0xb3, 0x73, 0xc0, 0xff, 0x6e, 0x86, 0x9f }}
1950
1951
  ## Include/Protocol/MemoryAttribute.h
1952
  gEfiMemoryAttributeProtocolGuid = { 0xf4560cf6, 0x40ec, 0x4b4a, { 0xa1, 0x92, 0xbf, 0x1d, 0x57, 0xd0, 0xb1, 0x89 }}
1953
1842
  #
1954
  #
1843
  # Protocols defined in Shell2.0
1955
  # Protocols defined in Shell2.0
1844
  #
1956
  #
Lines 2107-2112 Link Here
2107
  #  BIT20 - Global Coherency Database changes message.<BR>
2219
  #  BIT20 - Global Coherency Database changes message.<BR>
2108
  #  BIT21 - Memory range cachability changes message.<BR>
2220
  #  BIT21 - Memory range cachability changes message.<BR>
2109
  #  BIT22 - Detailed debug message.<BR>
2221
  #  BIT22 - Detailed debug message.<BR>
2222
  #  BIT23 - Manageability debug message.<BR>
2110
  #  BIT31 - Error message.<BR>
2223
  #  BIT31 - Error message.<BR>
2111
  # @Prompt Fixed Debug Message Print Level.
2224
  # @Prompt Fixed Debug Message Print Level.
2112
  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0xFFFFFFFF|UINT32|0x30001016
2225
  gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0xFFFFFFFF|UINT32|0x30001016
Lines 2191-2196 Link Here
2191
  #  BIT20 - Global Coherency Database changes message.<BR>
2304
  #  BIT20 - Global Coherency Database changes message.<BR>
2192
  #  BIT21 - Memory range cachability changes message.<BR>
2305
  #  BIT21 - Memory range cachability changes message.<BR>
2193
  #  BIT22 - Detailed debug message.<BR>
2306
  #  BIT22 - Detailed debug message.<BR>
2307
  #  BIT23 - Manageability messages.<BR>
2194
  #  BIT31 - Error message.<BR>
2308
  #  BIT31 - Error message.<BR>
2195
  # @Prompt Debug Message Print Level.
2309
  # @Prompt Debug Message Print Level.
2196
  # @Expression  0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel & 0x7F84AA00) == 0
2310
  # @Expression  0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel & 0x7F84AA00) == 0
Lines 2233-2242 Link Here
2233
  # @ValidList  0x80000001 | 8, 16, 32
2347
  # @ValidList  0x80000001 | 8, 16, 32
2234
  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth|8|UINT8|0x0000002d
2348
  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth|8|UINT8|0x0000002d
2235
2349
2236
  ## This value is used to configure X86 Processor FSB clock.
2237
  # @Prompt FSB Clock.
2238
  gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c
2239
2240
  ## The maximum printable number of characters. UefLib functions: AsciiPrint(), AsciiErrorPrint(),
2350
  ## The maximum printable number of characters. UefLib functions: AsciiPrint(), AsciiErrorPrint(),
2241
  #  PrintXY(), AsciiPrintXY(), Print(), ErrorPrint() base on this PCD value to print characters.
2351
  #  PrintXY(), AsciiPrintXY(), Print(), ErrorPrint() base on this PCD value to print characters.
2242
  # @Prompt Maximum Printable Number of Characters.
2352
  # @Prompt Maximum Printable Number of Characters.
Lines 2260-2270 Link Here
2260
  # @Prompt Memory Address of GuidedExtractHandler Table.
2370
  # @Prompt Memory Address of GuidedExtractHandler Table.
2261
  gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|UINT64|0x30001015
2371
  gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000000|UINT64|0x30001015
2262
2372
2373
  ## This value is the IPMI KCS Interface I/O base address used to transmit IPMI commands.
2374
  #  The value of 0xca2 is the default I/O base address defined in IPMI specification.
2375
  # @Prompt IPMI KCS Interface I/O Base Address
2376
  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00000031
2377
2378
  ## This is SMBus slave address for the SSIF to the BMC.
2379
  #  The recommended value defined by IPMI specification is 0x20 (section 12.12).
2380
  # @Prompt IPMI SSIF SMBus slave address
2381
  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr|0x20|UINT8|0x00000032
2382
2383
  ## This is the maximum number of IPMI SSIF request retries.
2384
  #  The IPMI specification specified min value is 5 (section 12.17).
2385
  # @Prompt Number of IPMI SSIF request retries.
2386
  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryCount|0x05|UINT8|0x00000033
2387
2388
  ## This is the required interval for each IPMI request retry.
2389
  #  The IPMI specification specified a time range of 60ms to 250ms (section 12.17).
2390
  #  The default setting is min.
2391
  # @Prompt Time between IPMI SSIF request retries.
2392
  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifRequestRetryIntervalMicrosecond|60000|UINT32|0x00000034
2393
2394
  ## This value is the maximum retries of an IPMI SSIF response
2395
  #  The default value is the same as the Linux Kernel ipmi_ssif driver.
2396
  # @Prompt Number of IPMI SSIF response retries.
2397
  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryCount|250|UINT8|0x00000035
2398
2399
  ## This is the required interval for each IPMI response retry.
2400
  #  The IPMI specification specified min value is 60ms (section 12.17).
2401
  # @Prompt Time-out for a response, internal
2402
  gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond|60000|UINT32|0x00000036
2403
2404
[PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
2405
  ## GUID identifying the Rng algorithm implemented by CPU instruction.
2406
  # @Prompt CPU Rng algorithm's GUID.
2407
  gEfiMdePkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm|{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}|VOID*|0x00000037
2408
2409
[PcdsFixedAtBuild.RISCV64, PcdsPatchableInModule.RISCV64]
2410
  #
2411
  # Configurability to override RISC-V CPU Features
2412
  # BIT 0 = Cache Management Operations. This bit is relevant only if
2413
  # previous stage has feature enabled and user wants to disable it.
2414
  # BIT 1 = Supervisor Time Compare (Sstc). This bit is relevant only if
2415
  # previous stage has feature enabled and user wants to disable it.
2416
  #
2417
  gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride|0xFFFFFFFFFFFFFFFF|UINT64|0x69
2418
2263
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
2419
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
2264
  ## This value is used to set the base address of PCI express hierarchy.
2420
  ## This value is used to set the base address of PCI express hierarchy.
2265
  # @Prompt PCI Express Base Address.
2421
  # @Prompt PCI Express Base Address.
2266
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64|0x0000000a
2422
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000|UINT64|0x0000000a
2267
2423
2424
  ## This value is used to set the base address of PCI MMIO window that provides I/O access.
2425
  # @Prompt PCI I/O Memory Map Window Base Address.
2426
  gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000040
2427
2428
  ## This value is used for the 32-bit PCI memory map I/O base address translation.
2429
  # @Prompt 32-bit PCI Memory Map I/O Base Address translation.
2430
  gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000041
2431
2432
  ## This value is used for the 64-bit PCI memory map I/O base address translation.
2433
  # @Prompt 64-bit PCI Memory Map I/O Base Address translation.
2434
  gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000042
2435
2436
  ## This value is used to set the size of PCI express hierarchy. The default is 256 MB.
2437
  # @Prompt PCI Express Base Size.
2438
  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000|UINT64|0x0000000f
2439
2268
  ## Default current ISO 639-2 language: English & French.
2440
  ## Default current ISO 639-2 language: English & French.
2269
  # @Prompt Default Value of LangCodes Variable.
2441
  # @Prompt Default Value of LangCodes Variable.
2270
  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfraengfra"|VOID*|0x0000001c
2442
  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfraengfra"|VOID*|0x0000001c
Lines 2336-2340 Link Here
2336
  # @Prompt Boot Timeout (s)
2508
  # @Prompt Boot Timeout (s)
2337
  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0x0000002c
2509
  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0x0000002c
2338
2510
2511
  ## This value is used to configure X86 Processor FSB clock.
2512
  # @Prompt FSB Clock.
2513
  gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c
2514
2515
  ## This dynamic PCD indicates the memory encryption attribute of the guest.
2516
  # @Prompt Memory encryption attribute
2517
  gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0x0000002e
2518
2339
[UserExtensions.TianoCore."ExtraFiles"]
2519
[UserExtensions.TianoCore."ExtraFiles"]
2340
  MdePkgExtra.uni
2520
  MdePkgExtra.uni
2341
- 

Return to bug 283037