2 This file declares the SMM CPU Save State protocol, which provides the processor
3 save-state information for IA-32 and Itanium processors.
5 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is defined in Framework of EFI SMM Core Interface Spec
13 #ifndef _SMM_CPU_SAVE_STATE_H_
14 #define _SMM_CPU_SAVE_STATE_H_
16 #define EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID \
18 0x21f302ad, 0x6e94, 0x471b, {0x84, 0xbc, 0xb1, 0x48, 0x0, 0x40, 0x3a, 0x1d} \
21 typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL EFI_SMM_CPU_SAVE_STATE_PROTOCOL
;
23 #define EFI_SMM_MIN_REV_ID_x64 0x30006
28 /// CPU save-state strcuture for IA32 and X64.
30 /// This struct declaration does not exctly match the Framework SMM CIS 0.91 because the
31 /// union in the Framework SMM CIS 0.91 contains an unnamed union member that causes build
32 /// breaks on many compilers with high warning levels. Instead, the UINT8 Reserved[0x200]
33 /// field has been moved into EFI_SMM_CPU_STATE32. This maintains binary compatibility for
34 /// the layout and also maintains source comaptibility for access of all fields in this
37 /// This struct declaration does not exctly match the Framework SMM CIS 0.91 because
38 /// the Framework SMM CIS 0.91 uses ASM_XXX for base types in this structure. These
39 /// have been changed to use the base types defined in the UEFI Specification.
42 UINT8 Reserved
[0x200];
43 UINT8 Reserved1
[0xf8]; // fe00h
44 UINT32 SMBASE
; // fef8h
45 UINT32 SMMRevId
; // fefch
46 UINT16 IORestart
; // ff00h
47 UINT16 AutoHALTRestart
; // ff02h
48 UINT32 IEDBASE
; // ff04h
49 UINT8 Reserved2
[0x98]; // ff08h
50 UINT32 IOMemAddr
; // ffa0h
51 UINT32 IOMisc
; // ffa4h
74 } EFI_SMM_CPU_STATE32
;
77 /// This struct declaration does not exctly match the Framework SMM CIS 0.91 because
78 /// the Framework SMM CIS 0.91 uses ASM_XXX for base types in this structure. These
79 /// have been changed to use the base types defined in the UEFI Specification.
82 UINT8 Reserved1
[0x1d0]; // fc00h
83 UINT32 GdtBaseHiDword
; // fdd0h
84 UINT32 LdtBaseHiDword
; // fdd4h
85 UINT32 IdtBaseHiDword
; // fdd8h
86 UINT8 Reserved2
[0xc]; // fddch
87 UINT64 IO_EIP
; // fde8h
88 UINT8 Reserved3
[0x50]; // fdf0h
90 UINT8 Reserved4
[0x48]; // fe44h
91 UINT32 GdtBaseLoDword
; // fe8ch
92 UINT32 GdtLimit
; // fe90h
93 UINT32 IdtBaseLoDword
; // fe94h
94 UINT32 IdtLimit
; // fe98h
95 UINT32 LdtBaseLoDword
; // fe9ch
96 UINT32 LdtLimit
; // fea0h
97 UINT32 LdtInfo
; // fea4h
98 UINT8 Reserved5
[0x50]; // fea8h
99 UINT32 SMBASE
; // fef8h
100 UINT32 SMMRevId
; // fefch
101 UINT16 AutoHALTRestart
; // ff00h
102 UINT16 IORestart
; // ff02h
103 UINT32 IEDBASE
; // ff04h
104 UINT8 Reserved6
[0x14]; // ff08h
105 UINT64 _R15
; // ff1ch
113 UINT64 _RAX
; // ff5ch
121 UINT64 IOMemAddr
; // ff9ch
122 UINT32 IOMisc
; // ffa4h
129 UINT32 _LDTR
; // ffc0h
131 UINT64 _DR7
; // ffc8h
133 UINT64 _RIP
; // ffd8h
134 UINT64 IA32_EFER
; // ffe0h
135 UINT64 _RFLAGS
; // ffe8h
136 UINT64 _CR3
; // fff0h
137 UINT64 _CR0
; // fff8h
138 } EFI_SMM_CPU_STATE64
;
141 /// Union of CPU save-state strcutures for IA32 and X64.
143 /// This union declaration does not exctly match the Framework SMM CIS 0.91 because the
144 /// union in the Framework SMM CIS 0.91 contains an unnamed union member that causes build
145 /// breaks on many compilers with high warning levels. Instead, the UINT8 Reserved[0x200]
146 /// field has been moved into EFI_SMM_CPU_STATE32. This maintains binary compatibility for
147 /// the layout and also maintains source comaptibility for access of all fields in this
151 EFI_SMM_CPU_STATE32 x86
;
152 EFI_SMM_CPU_STATE64 x64
;
158 /// Provides a programatic means to access SMM save state.
160 struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL
{
162 /// Reference to a list of save states.
164 EFI_SMM_CPU_STATE
**CpuSaveState
;
167 extern EFI_GUID gEfiSmmCpuSaveStateProtocolGuid
;