]> git.proxmox.com Git - mirror_edk2.git/blob - PrmPkg/Include/PrmModule.h
PrmPkg: Publish PRM operation region to support PRM ACPI _DSM invocation
[mirror_edk2.git] / PrmPkg / Include / PrmModule.h
1 /** @file
2
3 Common definitions needed for Platform Runtime Mechanism (PRM) modules.
4
5 Copyright (c) Microsoft Corporation
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef PRM_MODULE_H_
11 #define PRM_MODULE_H_
12
13 #include <Prm.h>
14 #include <PrmContextBuffer.h>
15 #include <PrmDataBuffer.h>
16 #include <PrmExportDescriptor.h>
17 #include <PrmMmio.h>
18 #include <PrmModuleUpdate.h>
19 #include <PrmOsServices.h>
20
21 /**
22 Macro that provides a condensed form of a PRM Handler.
23
24 This macro can be used to define a PRM Handler that uses the standard PRM Handle
25 signature. It is simply provided for convenience.
26
27 **/
28 #define PRM_HANDLER_EXPORT(Name) \
29 STATIC_ASSERT (sizeof (PRM_STRING_(Name)) <= PRM_HANDLER_NAME_MAXIMUM_LENGTH, "The PRM handler exceeds the maximum allowed size of 128."); \
30 \
31 /** \
32 A Platform Runtime Mechanism (PRM) handler. \
33 \
34 @param[in] ParameterBuffer A pointer to the PRM handler parameter buffer \
35 @param[in] ContextBUffer A pointer to the PRM handler context buffer \
36 \
37 @retval EFI_STATUS The PRM handler executed successfully. \
38 @retval Others An error occurred in the PRM handler. \
39 \
40 **/ \
41 EFI_STATUS \
42 PRM_EXPORT_API \
43 EFIAPI \
44 Name ( \
45 IN VOID *ParameterBuffer, \
46 IN PRM_CONTEXT_BUFFER *ContextBuffer \
47 ) \
48
49 /**
50 A macro that declares the PRM Module Update Lock Descriptor for a PRM Module.
51
52 This macro is intended to be used once in a PRM Module so the module update lock descriptor is
53 exported for the module.
54
55 **/
56 #define PRM_MODULE_UPDATE_LOCK_EXPORT \
57 PRM_EXPORT_API PRM_MODULE_UPDATE_LOCK_DESCRIPTOR PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_NAME = { \
58 PRM_MODULE_UPDATE_LOCK_DESCRIPTOR_SIGNATURE, \
59 PRM_MODULE_UPDATE_LOCK_REVISION, \
60 { 0 } \
61 } \
62
63 //
64 // A PRM module is required to export the PRM Module Update Lock
65 //
66 PRM_MODULE_UPDATE_LOCK_EXPORT;
67
68 #endif