hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
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
47
48
49
50
51
52
53
54
55
56
57
/** @file
 
  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _CPUSMM_H_
#define _CPUSMM_H_
#ifdef __cplusplus
extern "C" {
#endif
 
#define CPUSMM_GUID { 0x90d93e09, 0x4e91, 0x4b3d, { 0x8c, 0x77, 0xc8, 0x2f, 0xf1, 0xe, 0x3c, 0x81 }}
#define CPUSMM_SETUP_NAME             L"CpuSmm"
 
#pragma pack(1)
typedef struct {
  UINT8     CpuSmmMsrSaveStateEnable;
  UINT8     CpuSmmCodeAccessCheckEnable;
  UINT8     CpuSmmUseDelayIndication;
  UINT8     CpuSmmUseBlockIndication;
  UINT8     CpuSmmUseSmmEnableIndication;
  UINT8     CpuSmmProcTraceEnable;
} CPU_SMM;
#pragma pack()
 
#ifndef OFFSET_OF
#ifdef __GNUC__
#if __GNUC__ >= 4
#define OFFSET_OF(TYPE, Field) ((UINTN) __builtin_offsetof(TYPE, Field))
#endif
#endif
#endif
 
#ifndef OFFSET_OF
#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
#endif
 
#define VERIFY_OFFSET(TYPE, Field, Offset) extern UINT8 _VerifyOffset##TYPE##Field[(OFFSET_OF(TYPE, Field) == Offset) / (OFFSET_OF(TYPE, Field) == Offset)]
 
//
// If TpmSupport/MorStae isn't in this offset, build failure (0 size array or divided by 0) will be generated.
// Platform DSC file maps the two field to HII PCD so the offset value is critical.
//
VERIFY_OFFSET (CPU_SMM, CpuSmmMsrSaveStateEnable, 0x0);
VERIFY_OFFSET (CPU_SMM, CpuSmmCodeAccessCheckEnable, 0x1);
VERIFY_OFFSET (CPU_SMM, CpuSmmUseDelayIndication, 0x2);
VERIFY_OFFSET (CPU_SMM, CpuSmmUseBlockIndication, 0x3);
VERIFY_OFFSET (CPU_SMM, CpuSmmUseSmmEnableIndication, 0x4);
VERIFY_OFFSET (CPU_SMM, CpuSmmProcTraceEnable, 0x5);
 
/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif