TianoCore EDK2 master
Loading...
Searching...
No Matches
PrmExportDescriptor.h
Go to the documentation of this file.
1
10#ifndef PRM_EXPORT_DESCRIPTOR_H_
11#define PRM_EXPORT_DESCRIPTOR_H_
12
13#include <Prm.h>
14
15#define PRM_MODULE_EXPORT_DESCRIPTOR_NAME PrmModuleExportDescriptor
16#define PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE SIGNATURE_64 ('P', 'R', 'M', '_', 'M', 'E', 'D', 'T')
17#define PRM_MODULE_EXPORT_REVISION 0x0
18
19//
20// Platform Runtime Mechanism (PRM) Export Descriptor Structures
21//
22#pragma pack(push, 1)
23
24typedef struct {
25 GUID PrmHandlerGuid;
26 CHAR8 PrmHandlerName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];
28
29typedef struct {
30 UINT64 Signature;
31 UINT16 Revision;
32 UINT16 NumberPrmHandlers;
33 GUID PlatformGuid;
34 GUID ModuleGuid;
36
37typedef struct {
39 PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT PrmHandlerExportDescriptors[1];
41
42#pragma pack(pop)
43
44#if defined (_MSC_VER)
45#define PRM_PACKED_STRUCT(definition) \
46 __pragma(pack(push, 1)) typedef struct definition __pragma(pack(pop))
47#elif defined (__GNUC__) || defined (__clang__)
48#define PRM_PACKED_STRUCT(definition) \
49 typedef struct __attribute__((packed)) definition
50#endif
51
64#define PRM_HANDLER_EXPORT_ENTRY(Guid, Name) \
65 { \
66 Guid, \
67 PRM_STRING_(Name) \
68 } \
69
70
77#define VA_ARG_COUNT(...) (sizeof((PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT[]){__VA_ARGS__})/sizeof(PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT))
78
90#define PRM_MODULE_EXPORT(...) \
91 PRM_PACKED_STRUCT( \
92 { \
93 PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER Header; \
94 PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT PrmHandlerExportDescriptors[VA_ARG_COUNT(__VA_ARGS__)]; \
95 } PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_ \
96 ); \
97 \
98 PRM_EXPORT_API PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_ PRM_MODULE_EXPORT_DESCRIPTOR_NAME = { \
99 { \
100 PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE, \
101 PRM_MODULE_EXPORT_REVISION, \
102 VA_ARG_COUNT(__VA_ARGS__), \
103 EDKII_DSC_PLATFORM_GUID, \
104 EFI_CALLER_ID_GUID \
105 }, \
106 { __VA_ARGS__ } \
107 } \
108
109#endif
Definition: Base.h:213