3 Definitions for the Platform Runtime Mechanism (PRM) export descriptor structures.
5 Copyright (c) Microsoft Corporation
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef PRM_EXPORT_DESCRIPTOR_H_
11 #define PRM_EXPORT_DESCRIPTOR_H_
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
20 // Platform Runtime Mechanism (PRM) Export Descriptor Structures
26 CHAR8 PrmHandlerName
[PRM_HANDLER_NAME_MAXIMUM_LENGTH
];
27 } PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT
;
32 UINT16 NumberPrmHandlers
;
34 PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT PrmHandlerExportDescriptors
[3];
35 } PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT
;
40 A macro that declares a PRM Handler Export Descriptor for a PRM Handler.
42 This macro is intended to be used once per PRM Handler to describe the handler when the
43 module description is defined. It should be provided as an argument to PRM_MODULE_EXPORT.
45 @param Guid The GUID of the PRM Handler being exported.
47 @param Name The name of the PRM Handler being exported. This string should exactly
48 match the function name.
51 #define PRM_HANDLER_EXPORT_ENTRY(Guid, Name) \
58 A macro that returns the count of the number of variable-length arguments given.
60 @param VariableArgumentList A variable argument list of elements that will be included
61 in the return value of the list count.
63 #define VA_ARG_COUNT(...) (sizeof((PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT[]){__VA_ARGS__})/sizeof(PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT))
66 A macro that declares the PRM Module Export Descriptor for a PRM Module.
68 This macro is intended to be used once in a PRM Module after all of the PRM Handler definitions
69 to describe the PRM Handlers being exported in the module.
71 @param PrmHandlerExportEntries A variable argument list of PRM_HANDLER_EXPORT_ENTRY values.
72 This list should include all PRM Handlers being exported by
76 #define PRM_MODULE_EXPORT(...) \
77 PRM_EXPORT_API PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT PRM_MODULE_EXPORT_DESCRIPTOR_NAME = { \
79 PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE, \
80 PRM_MODULE_EXPORT_REVISION, \
81 VA_ARG_COUNT(__VA_ARGS__), \