summaryrefslogtreecommitdiffstats
path: root/PrmPkg/Include/Prm.h
blob: 0e3ccfffa333b81300449624c0e7610f78287f01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** @file

  Common Platform Runtime Mechanism (PRM) definitions.

  Copyright (c) Microsoft Corporation
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef PRM_H_
#define PRM_H_

#include <Uefi.h>
#include <PrmContextBuffer.h>

#if defined(_MSC_VER)
  #define PRM_EXPORT_API                          __declspec(dllexport)
#else
  #define PRM_EXPORT_API
#endif

#define PRM_HANDLER_NAME_MAXIMUM_LENGTH           128

#define PRM_STRING_(x)                            #x
#define PRM_STRING(x)                             PRM_STRING_(x)

/**
  A Platform Runtime Mechanism (PRM) handler function.

  @param[in]  ParameterBuffer             A pointer to a buffer with arbitrary data that is allocated and populated
                                          by the PRM handler caller.
  @param[in]  ContextBuffer               A pointer to a buffer with arbitrary data that is allocated in the firmware
                                          boot environment.

  @retval EFI_STATUS              The PRM handler executed successfully.
  @retval Others                  An error occurred in the PRM handler.

**/
typedef
EFI_STATUS
(EFIAPI PRM_HANDLER) (
  IN VOID                 *ParameterBuffer  OPTIONAL,
  IN PRM_CONTEXT_BUFFER   *ContextBuffer  OPTIONAL
  );

#endif