]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/SmmCpuSaveState.h
Clarify @pram b in Base.h. Accepted and edited in Qing Huang changes for @retval...
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmCpuSaveState.h
CommitLineData
d7659786 1/** @file\r
2 This file declares the SMM CPU Save State protocol, which provides the processor\r
3 save-state information for IA-32 and Itanium processors.\r
4\r
5 Copyright (c) 2010, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 @par Revision Reference:\r
15 This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
16 Version 0.91.\r
17**/\r
18\r
19#ifndef _SMM_CPU_SAVE_STATE_H_\r
20#define _SMM_CPU_SAVE_STATE_H_\r
21\r
22#define EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID \\r
23 { \\r
24 0x21f302ad, 0x6e94, 0x471b, {0x84, 0xbc, 0xb1, 0x48, 0x0, 0x40, 0x3a, 0x1d} \\r
25 }\r
26\r
27typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL EFI_SMM_CPU_SAVE_STATE_PROTOCOL;\r
28\r
29#define EFI_SMM_MIN_REV_ID_x64 0x30006\r
30\r
31#pragma pack (1)\r
32\r
33/// \r
34/// CPU save-state strcuture for IA32 and X64.\r
35///\r
36/// This struct declaration does not exctly match the Framework SMM CIS 0.91 because the\r
37/// union in the Framework SMM CIS 0.91 contains an unnamed union member that causes build\r
38/// breaks on many compilers with high warning levels. Instead, the UINT8 Reserved[0x200] \r
39/// field has been moved into EFI_SMM_CPU_STATE32. This maintains binary compatibility for\r
40/// the layout and also maintains source comaptibility for access of all fields in this\r
41/// union.\r
42///\r
43/// This struct declaration does not exctly match the Framework SMM CIS 0.91 because \r
44/// The Framework SMM CIS 0.91 uses ASM_XXX for base types in this structure. These\r
45/// have been changed to use the base types defined in the UEFI Specification. \r
46///\r
47typedef struct {\r
48 UINT8 Reserved[0x200];\r
49 UINT8 Reserved1[0xf8]; // fe00h\r
50 UINT32 SMBASE; // fef8h\r
51 UINT32 SMMRevId; // fefch\r
52 UINT16 IORestart; // ff00h\r
53 UINT16 AutoHALTRestart; // ff02h\r
54 UINT32 IEDBASE; // ff04h\r
55 UINT8 Reserved2[0x98]; // ff08h\r
56 UINT32 IOMemAddr; // ffa0h\r
57 UINT32 IOMisc; // ffa4h\r
58 UINT32 _ES;\r
59 UINT32 _CS;\r
60 UINT32 _SS;\r
61 UINT32 _DS;\r
62 UINT32 _FS;\r
63 UINT32 _GS;\r
64 UINT32 _LDTBase;\r
65 UINT32 _TR;\r
66 UINT32 _DR7;\r
67 UINT32 _DR6;\r
68 UINT32 _EAX;\r
69 UINT32 _ECX;\r
70 UINT32 _EDX;\r
71 UINT32 _EBX;\r
72 UINT32 _ESP;\r
73 UINT32 _EBP;\r
74 UINT32 _ESI;\r
75 UINT32 _EDI;\r
76 UINT32 _EIP;\r
77 UINT32 _EFLAGS;\r
78 UINT32 _CR3;\r
79 UINT32 _CR0;\r
80} EFI_SMM_CPU_STATE32;\r
81\r
82///\r
83/// This struct declaration does not exctly match the Framework SMM CIS 0.91 because \r
84/// The Framework SMM CIS 0.91 uses ASM_XXX for base types in this structure. These\r
85/// have been changed to use the base types defined in the UEFI Specification. \r
86///\r
87typedef struct {\r
88 UINT8 Reserved1[0x1d0]; // fc00h\r
89 UINT32 GdtBaseHiDword; // fdd0h\r
90 UINT32 LdtBaseHiDword; // fdd4h\r
91 UINT32 IdtBaseHiDword; // fdd8h\r
92 UINT8 Reserved2[0xc]; // fddch\r
93 UINT64 IO_EIP; // fde8h\r
94 UINT8 Reserved3[0x50]; // fdf0h\r
95 UINT32 _CR4; // fe40h\r
96 UINT8 Reserved4[0x48]; // fe44h\r
97 UINT32 GdtBaseLoDword; // fe8ch\r
98 UINT32 GdtLimit; // fe90h\r
99 UINT32 IdtBaseLoDword; // fe94h\r
100 UINT32 IdtLimit; // fe98h\r
101 UINT32 LdtBaseLoDword; // fe9ch\r
102 UINT32 LdtLimit; // fea0h\r
103 UINT32 LdtInfo; // fea4h\r
104 UINT8 Reserved5[0x50]; // fea8h\r
105 UINT32 SMBASE; // fef8h\r
106 UINT32 SMMRevId; // fefch\r
107 UINT16 AutoHALTRestart; // ff00h\r
108 UINT16 IORestart; // ff02h\r
109 UINT32 IEDBASE; // ff04h\r
110 UINT8 Reserved6[0x14]; // ff08h\r
111 UINT64 _R15; // ff1ch\r
112 UINT64 _R14;\r
113 UINT64 _R13;\r
114 UINT64 _R12;\r
115 UINT64 _R11;\r
116 UINT64 _R10;\r
117 UINT64 _R9;\r
118 UINT64 _R8;\r
119 UINT64 _RAX; // ff5ch\r
120 UINT64 _RCX;\r
121 UINT64 _RDX;\r
122 UINT64 _RBX;\r
123 UINT64 _RSP;\r
124 UINT64 _RBP;\r
125 UINT64 _RSI;\r
126 UINT64 _RDI;\r
127 UINT64 IOMemAddr; // ff9ch\r
128 UINT32 IOMisc; // ffa4h\r
129 UINT32 _ES; // ffa8h\r
130 UINT32 _CS;\r
131 UINT32 _SS;\r
132 UINT32 _DS;\r
133 UINT32 _FS;\r
134 UINT32 _GS;\r
135 UINT32 _LDTR; // ffc0h\r
136 UINT32 _TR;\r
137 UINT64 _DR7; // ffc8h\r
138 UINT64 _DR6;\r
139 UINT64 _RIP; // ffd8h\r
140 UINT64 IA32_EFER; // ffe0h\r
141 UINT64 _RFLAGS; // ffe8h\r
142 UINT64 _CR3; // fff0h\r
143 UINT64 _CR0; // fff8h\r
144} EFI_SMM_CPU_STATE64;\r
145\r
146///\r
147/// Union of CPU save-state strcutures for IA32 and X64.\r
148///\r
149/// This union declaration does not exctly match the Framework SMM CIS 0.91 because the\r
150/// union in the Framework SMM CIS 0.91 contains an unnamed union member that causes build\r
151/// breaks on many compilers with high warning levels. Instead, the UINT8 Reserved[0x200] \r
152/// field has been moved into EFI_SMM_CPU_STATE32. This maintains binary compatibility for\r
153/// the layout and also maintains source comaptibility for access of all fields in this\r
154/// union.\r
155///\r
156typedef union {\r
157 EFI_SMM_CPU_STATE32 x86;\r
158 EFI_SMM_CPU_STATE64 x64;\r
159} EFI_SMM_CPU_STATE;\r
160\r
161#pragma pack ()\r
162\r
163///\r
164/// Provides a programatic means to access SMM save state.\r
165///\r
166struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL {\r
167 ///\r
168 /// Reference to a list of save states\r
169 ///\r
170 EFI_SMM_CPU_STATE **CpuSaveState;\r
171};\r
172\r
173extern EFI_GUID gEfiSmmCpuSaveStateProtocolGuid;\r
174\r
175#endif\r