1 | /** @file -- VarCheckPolicyMmiCommon.h
|
---|
2 | This header contains communication definitions that are shared between DXE
|
---|
3 | and the MM component of VarCheckPolicy.
|
---|
4 |
|
---|
5 | Copyright (c) Microsoft Corporation.
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 | **/
|
---|
8 |
|
---|
9 | #ifndef _VAR_CHECK_POLICY_MMI_COMMON_H_
|
---|
10 | #define _VAR_CHECK_POLICY_MMI_COMMON_H_
|
---|
11 |
|
---|
12 | #define VAR_CHECK_POLICY_COMM_SIG SIGNATURE_32('V', 'C', 'P', 'C')
|
---|
13 | #define VAR_CHECK_POLICY_COMM_REVISION 1
|
---|
14 |
|
---|
15 | #pragma pack(push, 1)
|
---|
16 |
|
---|
17 | typedef struct _VAR_CHECK_POLICY_COMM_HEADER {
|
---|
18 | UINT32 Signature;
|
---|
19 | UINT32 Revision;
|
---|
20 | UINT32 Command;
|
---|
21 | EFI_STATUS Result;
|
---|
22 | } VAR_CHECK_POLICY_COMM_HEADER;
|
---|
23 |
|
---|
24 | typedef struct _VAR_CHECK_POLICY_COMM_IS_ENABLED_PARAMS {
|
---|
25 | BOOLEAN State;
|
---|
26 | } VAR_CHECK_POLICY_COMM_IS_ENABLED_PARAMS;
|
---|
27 |
|
---|
28 | typedef struct _VAR_CHECK_POLICY_COMM_DUMP_PARAMS {
|
---|
29 | UINT32 PageRequested;
|
---|
30 | UINT32 TotalSize;
|
---|
31 | UINT32 PageSize;
|
---|
32 | BOOLEAN HasMore;
|
---|
33 | } VAR_CHECK_POLICY_COMM_DUMP_PARAMS;
|
---|
34 |
|
---|
35 | #pragma pack(pop)
|
---|
36 |
|
---|
37 | // Make sure that we will hold at least the headers.
|
---|
38 | #define VAR_CHECK_POLICY_MM_COMM_BUFFER_SIZE MAX((OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data) + sizeof (VAR_CHECK_POLICY_COMM_HEADER) + EFI_PAGES_TO_SIZE(1)), EFI_PAGES_TO_SIZE(4))
|
---|
39 | #define VAR_CHECK_POLICY_MM_DUMP_BUFFER_SIZE (VAR_CHECK_POLICY_MM_COMM_BUFFER_SIZE - \
|
---|
40 | (OFFSET_OF(EFI_MM_COMMUNICATE_HEADER, Data) + \
|
---|
41 | sizeof(VAR_CHECK_POLICY_COMM_HEADER) + \
|
---|
42 | sizeof(VAR_CHECK_POLICY_COMM_DUMP_PARAMS)))
|
---|
43 | STATIC_ASSERT (
|
---|
44 | VAR_CHECK_POLICY_MM_DUMP_BUFFER_SIZE < VAR_CHECK_POLICY_MM_COMM_BUFFER_SIZE,
|
---|
45 | "an integer underflow may have occurred calculating VAR_CHECK_POLICY_MM_DUMP_BUFFER_SIZE"
|
---|
46 | );
|
---|
47 |
|
---|
48 | #define VAR_CHECK_POLICY_COMMAND_DISABLE 0x0001
|
---|
49 | #define VAR_CHECK_POLICY_COMMAND_IS_ENABLED 0x0002
|
---|
50 | #define VAR_CHECK_POLICY_COMMAND_REGISTER 0x0003
|
---|
51 | #define VAR_CHECK_POLICY_COMMAND_DUMP 0x0004
|
---|
52 | #define VAR_CHECK_POLICY_COMMAND_LOCK 0x0005
|
---|
53 |
|
---|
54 | #endif // _VAR_CHECK_POLICY_MMI_COMMON_H_
|
---|