1 | /** @file
|
---|
2 |
|
---|
3 | Definition for the Platform Runtime Mechanism (PRM) ACPI table (PRMT).
|
---|
4 |
|
---|
5 | Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
|
---|
6 | Copyright (c) Microsoft Corporation
|
---|
7 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
8 |
|
---|
9 | **/
|
---|
10 |
|
---|
11 | #ifndef PRMT_ACPI_TABLE_H_
|
---|
12 | #define PRMT_ACPI_TABLE_H_
|
---|
13 |
|
---|
14 | #include <Base.h>
|
---|
15 | #include <IndustryStandard/Acpi10.h>
|
---|
16 |
|
---|
17 | #define PRM_TABLE_SIGNATURE SIGNATURE_32 ('P', 'R', 'M', 'T')
|
---|
18 |
|
---|
19 | #define PRM_TABLE_REVISION 0x0
|
---|
20 | #define PRM_MODULE_INFORMATION_STRUCT_REVISION 0x00
|
---|
21 | #define PRM_HANDLER_INFORMATION_STRUCT_REVISION 0x00
|
---|
22 |
|
---|
23 | #pragma pack(push, 1)
|
---|
24 |
|
---|
25 | //
|
---|
26 | // Platform Runtime Mechanism (PRM) ACPI Table (PRMT) structures
|
---|
27 | //
|
---|
28 | typedef struct {
|
---|
29 | UINT16 StructureRevision; ///< Revision of this structure
|
---|
30 | UINT16 StructureLength; ///< Length in bytes of this structure
|
---|
31 | GUID Identifier; ///< GUID of the PRM handler for this structure
|
---|
32 | UINT64 PhysicalAddress; ///< Physical address of this PRM handler
|
---|
33 | UINT64 StaticDataBuffer; ///< Physical address of the static data buffer for
|
---|
34 | ///< this PRM handler (PRM_DATA_BUFFER *)
|
---|
35 | UINT64 AcpiParameterBuffer; ///< Physical address of the parameter buffer
|
---|
36 | ///< for this PRM handler (PRM_DATA_BUFFER *)
|
---|
37 | ///< that is only used in the case of _DSM invocation.
|
---|
38 | ///< If _DSM invocation is not used, this value is
|
---|
39 | ///< ignored.
|
---|
40 | } PRM_HANDLER_INFORMATION_STRUCT;
|
---|
41 |
|
---|
42 | typedef struct {
|
---|
43 | UINT16 StructureRevision; ///< Revision of this structure
|
---|
44 | UINT16 StructureLength; ///< Length in bytes of this structure including the
|
---|
45 | ///< variable length PRM Handler Info array
|
---|
46 | GUID Identifier; ///< GUID of the PRM module for this structure
|
---|
47 | UINT16 MajorRevision; ///< PRM module major revision
|
---|
48 | UINT16 MinorRevision; ///< PRM module minor revision
|
---|
49 | UINT16 HandlerCount; ///< Number of entries in the Handler Info array
|
---|
50 | UINT32 HandlerInfoOffset; ///< Offset in bytes from the beginning of this
|
---|
51 | ///< structure to the Handler Info array
|
---|
52 | UINT64 RuntimeMmioRanges; ///< Physical address of the PRM MMIO Ranges
|
---|
53 | ///< structure (PRM_MODULE_RUNTIME_MMIO_RANGES *)
|
---|
54 | PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure[1];
|
---|
55 | } PRM_MODULE_INFORMATION_STRUCT;
|
---|
56 |
|
---|
57 | typedef struct {
|
---|
58 | EFI_ACPI_DESCRIPTION_HEADER Header; ///< Standard ACPI description header
|
---|
59 | GUID PrmPlatformGuid; ///< A GUID that uniquely identifies this platform.
|
---|
60 | ///< Used to check for compatibility in PRM module
|
---|
61 | ///< runtime updates.
|
---|
62 | UINT32 PrmModuleInfoOffset; ///< Offset in bytes from the beginning of this
|
---|
63 | ///< structure to the PRM Module Info array
|
---|
64 | UINT32 PrmModuleInfoCount; ///< Number of entries in the PRM Module Info array
|
---|
65 | PRM_MODULE_INFORMATION_STRUCT PrmModuleInfoStructure[1];
|
---|
66 | } PRM_ACPI_DESCRIPTION_TABLE;
|
---|
67 |
|
---|
68 | #pragma pack(pop)
|
---|
69 |
|
---|
70 | //
|
---|
71 | // Helper macros to build PRM Information structures
|
---|
72 | //
|
---|
73 | // Todo: Revisit whether to use; currently both macros are not used
|
---|
74 | //
|
---|
75 | #define PRM_MODULE_INFORMATION_STRUCTURE(ModuleGuid, ModuleRevision, HandlerCount, PrmHanderInfoStructureArray) { \
|
---|
76 | { \
|
---|
77 | PRM_MODULE_INFORMATION_STRUCT_REVISION, /* UINT16 StructureRevision; */ \
|
---|
78 | (OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoStructure) + (HandlerCount * sizeof (PRM_HANDLER_INFORMATION_STRUCT))) /* UINT16 StructureLength; */ \
|
---|
79 | ModuleGuid, /* GUID ModuleGuid; */ \
|
---|
80 | ModuleRevision, /* UINT16 ModuleRevision */ \
|
---|
81 | HandlerCount, /* UINT16 HandlerCount */ \
|
---|
82 | OFFSET_OF (PRM_MODULE_INFORMATION_STRUCT, HandlerInfoOffset), /* UINT32 HandlerInfoOffset */ \
|
---|
83 | PrmHanderInfoStructureArray /* PRM_HANDLER_INFORMATION_STRUCT HandlerInfoStructure */ \
|
---|
84 | } \
|
---|
85 | }
|
---|
86 |
|
---|
87 | #define PRM_HANDLER_INFORMATION_STRUCTURE(HandlerGuid, PhysicalAddress) { \
|
---|
88 | { \
|
---|
89 | PRM_HANDLER_INFORMATION_STRUCT_REVISION, /* UINT16 StructureRevision; */ \
|
---|
90 | sizeof (PRM_HANDLER_INFORMATION_STRUCT), /* UINT16 StructureLength; */ \
|
---|
91 | HandlerGuid, /* GUID HandlerGuid; */ \
|
---|
92 | PhysicalAddress, /* UINT64 PhysicalAddress */ \
|
---|
93 | } \
|
---|
94 | }
|
---|
95 |
|
---|
96 | #endif // _PRMT_ACPI_TABLE_H_
|
---|