]>
Commit | Line | Data |
---|---|---|
1c27f926 MK |
1 | /** @file\r |
2 | Definitions for CPU S3 data.\r | |
3 | \r | |
6af76adb | 4 | Copyright (c) 2013 - 2020, Intel Corporation. All rights reserved.<BR>\r |
0acd8697 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1c27f926 MK |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _ACPI_CPU_DATA_H_\r | |
10 | #define _ACPI_CPU_DATA_H_\r | |
11 | \r | |
12 | //\r | |
13 | // Register types in register table\r | |
14 | //\r | |
af381fda | 15 | typedef enum {\r |
1c27f926 MK |
16 | Msr,\r |
17 | ControlRegister,\r | |
18 | MemoryMapped,\r | |
d5aa2078 ED |
19 | CacheControl,\r |
20 | \r | |
21 | //\r | |
22 | // Semaphore type used to control the execute sequence of the Msr.\r | |
23 | // It will be insert between two Msr which has execute dependence.\r | |
24 | //\r | |
25 | Semaphore,\r | |
26 | InvalidReg\r | |
1c27f926 MK |
27 | } REGISTER_TYPE;\r |
28 | \r | |
d5aa2078 ED |
29 | //\r |
30 | // Describe the dependency type for different features.\r | |
31 | // The value set to CPU_REGISTER_TABLE_ENTRY.Value when the REGISTER_TYPE is Semaphore.\r | |
32 | //\r | |
33 | typedef enum {\r | |
34 | NoneDepType,\r | |
35 | ThreadDepType,\r | |
36 | CoreDepType,\r | |
37 | PackageDepType,\r | |
38 | InvalidDepType\r | |
39 | } CPU_FEATURE_DEPENDENCE_TYPE;\r | |
40 | \r | |
41 | //\r | |
42 | // CPU information.\r | |
43 | //\r | |
44 | typedef struct {\r | |
45 | //\r | |
46 | // Record the package count in this CPU.\r | |
47 | //\r | |
48 | UINT32 PackageCount;\r | |
49 | //\r | |
50 | // Record the max core count in this CPU.\r | |
51 | // Different packages may have different core count, this value\r | |
52 | // save the max core count in all the packages.\r | |
53 | //\r | |
54 | UINT32 MaxCoreCount;\r | |
55 | //\r | |
56 | // Record the max thread count in this CPU.\r | |
57 | // Different cores may have different thread count, this value\r | |
58 | // save the max thread count in all the cores.\r | |
59 | //\r | |
60 | UINT32 MaxThreadCount;\r | |
61 | //\r | |
62 | // This field points to an array.\r | |
6af76adb | 63 | // This array saves thread count (type UINT32) of each package.\r |
d5aa2078 ED |
64 | // The array has PackageCount elements.\r |
65 | //\r | |
66 | // If the platform does not support MSR setting at S3 resume, and\r | |
67 | // therefore it doesn't need the dependency semaphores, it should set\r | |
68 | // this field to 0.\r | |
69 | //\r | |
6af76adb RN |
70 | EFI_PHYSICAL_ADDRESS ThreadCountPerPackage;\r |
71 | //\r | |
72 | // This field points to an array.\r | |
73 | // This array saves thread count (type UINT8) of each core.\r | |
74 | // The array has PackageCount * MaxCoreCount elements.\r | |
75 | //\r | |
76 | // If the platform does not support MSR setting at S3 resume, and\r | |
77 | // therefore it doesn't need the dependency semaphores, it should set\r | |
78 | // this field to 0.\r | |
79 | //\r | |
80 | EFI_PHYSICAL_ADDRESS ThreadCountPerCore;\r | |
d5aa2078 ED |
81 | } CPU_STATUS_INFORMATION;\r |
82 | \r | |
1c27f926 MK |
83 | //\r |
84 | // Element of register table entry\r | |
85 | //\r | |
86 | typedef struct {\r | |
30b7a50b JF |
87 | REGISTER_TYPE RegisterType; // offset 0 - 3\r |
88 | UINT32 Index; // offset 4 - 7\r | |
89 | UINT8 ValidBitStart; // offset 8\r | |
90 | UINT8 ValidBitLength; // offset 9\r | |
35c2809b ED |
91 | BOOLEAN TestThenWrite; // offset 10\r |
92 | UINT8 Reserved1; // offset 11\r | |
30b7a50b JF |
93 | UINT32 HighIndex; // offset 12-15, only valid for MemoryMapped\r |
94 | UINT64 Value; // offset 16-23\r | |
1c27f926 MK |
95 | } CPU_REGISTER_TABLE_ENTRY;\r |
96 | \r | |
97 | //\r | |
98 | // Register table definition, including current table length,\r | |
99 | // allocated size of this table, and pointer to the list of table entries.\r | |
100 | //\r | |
101 | typedef struct {\r | |
af381fda MK |
102 | //\r |
103 | // The number of valid entries in the RegisterTableEntry buffer\r | |
104 | //\r | |
105 | UINT32 TableLength;\r | |
106 | UINT32 NumberBeforeReset;\r | |
107 | //\r | |
108 | // The size, in bytes, of the RegisterTableEntry buffer\r | |
109 | //\r | |
110 | UINT32 AllocatedSize;\r | |
111 | //\r | |
112 | // The initial APIC ID of the CPU this register table applies to\r | |
113 | //\r | |
114 | UINT32 InitialApicId;\r | |
115 | //\r | |
fcd92f16 | 116 | // Physical address of CPU_REGISTER_TABLE_ENTRY structures.\r |
af381fda | 117 | //\r |
9cc45009 | 118 | EFI_PHYSICAL_ADDRESS RegisterTableEntry;\r |
1c27f926 MK |
119 | } CPU_REGISTER_TABLE;\r |
120 | \r | |
af381fda | 121 | //\r |
fcd92f16 | 122 | // Data structure that is required for ACPI S3 resume. The PCD\r |
af381fda MK |
123 | // PcdCpuS3DataAddress must be set to the physical address where this structure\r |
124 | // is allocated\r | |
125 | //\r | |
1c27f926 | 126 | typedef struct {\r |
af381fda MK |
127 | //\r |
128 | // Physical address of 4KB buffer allocated below 1MB from memory of type\r | |
129 | // EfiReservedMemoryType. The buffer is not required to be initialized, but\r | |
130 | // it is recommended that the buffer be zero-filled. This buffer is used to\r | |
131 | // wake APs during an ACPI S3 resume.\r | |
132 | //\r | |
1c27f926 | 133 | EFI_PHYSICAL_ADDRESS StartupVector;\r |
af381fda | 134 | //\r |
fcd92f16 | 135 | // Physical address of structure of type IA32_DESCRIPTOR. The\r |
af381fda | 136 | // IA32_DESCRIPTOR structure provides the base address and length of a GDT\r |
fcd92f16 | 137 | // The GDT must be filled in with the GDT contents that are\r |
af381fda MK |
138 | // used during an ACPI S3 resume. This is typically the contents of the GDT\r |
139 | // used by the boot processor when the platform is booted.\r | |
140 | //\r | |
1c27f926 | 141 | EFI_PHYSICAL_ADDRESS GdtrProfile;\r |
af381fda | 142 | //\r |
fcd92f16 | 143 | // Physical address of structure of type IA32_DESCRIPTOR. The\r |
af381fda | 144 | // IA32_DESCRIPTOR structure provides the base address and length of an IDT.\r |
fcd92f16 | 145 | // The IDT must be filled in with the IDT contents that are\r |
af381fda MK |
146 | // used during an ACPI S3 resume. This is typically the contents of the IDT\r |
147 | // used by the boot processor when the platform is booted.\r | |
148 | //\r | |
1c27f926 | 149 | EFI_PHYSICAL_ADDRESS IdtrProfile;\r |
af381fda MK |
150 | //\r |
151 | // Physical address of a buffer that is used as stacks during ACPI S3 resume.\r | |
152 | // The total size of this buffer, in bytes, is NumberOfCpus * StackSize. This\r | |
fcd92f16 | 153 | // structure must be allocated from memory of type EfiACPIMemoryNVS.\r |
af381fda | 154 | //\r |
1c27f926 | 155 | EFI_PHYSICAL_ADDRESS StackAddress;\r |
af381fda MK |
156 | //\r |
157 | // The size, in bytes, of the stack provided to each CPU during ACPI S3 resume.\r | |
158 | //\r | |
1c27f926 | 159 | UINT32 StackSize;\r |
af381fda MK |
160 | //\r |
161 | // The number of CPUs. If a platform does not support hot plug CPUs, then\r | |
162 | // this is the number of CPUs detected when the platform is booted, regardless\r | |
163 | // of being enabled or disabled. If a platform does support hot plug CPUs,\r | |
164 | // then this is the maximum number of CPUs that the platform supports.\r | |
165 | //\r | |
1c27f926 | 166 | UINT32 NumberOfCpus;\r |
af381fda MK |
167 | //\r |
168 | // Physical address of structure of type MTRR_SETTINGS that contains a copy\r | |
169 | // of the MTRR settings that are compatible with the MTRR settings used by\r | |
170 | // the boot processor when the platform was booted. These MTRR settings are\r | |
fcd92f16 | 171 | // used during an ACPI S3 resume.\r |
af381fda | 172 | //\r |
1c27f926 MK |
173 | EFI_PHYSICAL_ADDRESS MtrrTable;\r |
174 | //\r | |
af381fda | 175 | // Physical address of an array of CPU_REGISTER_TABLE structures, with\r |
fcd92f16 | 176 | // NumberOfCpus entries. If a register table is not required, then the\r |
af381fda MK |
177 | // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r |
178 | // If TableLength is > 0, then elements of RegisterTableEntry are used to\r | |
179 | // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r | |
180 | // before SMBASE relocation is performed.\r | |
1487c13c LE |
181 | // If a register table is not required for any one of the CPUs, then\r |
182 | // PreSmmInitRegisterTable may be set to 0.\r | |
1c27f926 MK |
183 | //\r |
184 | EFI_PHYSICAL_ADDRESS PreSmmInitRegisterTable;\r | |
185 | //\r | |
af381fda | 186 | // Physical address of an array of CPU_REGISTER_TABLE structures, with\r |
fcd92f16 | 187 | // NumberOfCpus entries. If a register table is not required, then the\r |
af381fda MK |
188 | // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r |
189 | // If TableLength is > 0, then elements of RegisterTableEntry are used to\r | |
190 | // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r | |
191 | // after SMBASE relocation is performed.\r | |
1487c13c LE |
192 | // If a register table is not required for any one of the CPUs, then\r |
193 | // RegisterTable may be set to 0.\r | |
1c27f926 MK |
194 | //\r |
195 | EFI_PHYSICAL_ADDRESS RegisterTable;\r | |
af381fda MK |
196 | //\r |
197 | // Physical address of a buffer that contains the machine check handler that\r | |
fcd92f16 | 198 | // is used during an ACPI S3 Resume. In order for this machine check\r |
af381fda MK |
199 | // handler to be active on an AP during an ACPI S3 resume, the machine check\r |
200 | // vector in the IDT provided by IdtrProfile must be initialized to transfer\r | |
201 | // control to this physical address.\r | |
202 | //\r | |
1c27f926 | 203 | EFI_PHYSICAL_ADDRESS ApMachineCheckHandlerBase;\r |
af381fda MK |
204 | //\r |
205 | // The size, in bytes, of the machine check handler that is used during an\r | |
206 | // ACPI S3 Resume. If this field is 0, then a machine check handler is not\r | |
207 | // provided.\r | |
208 | //\r | |
1c27f926 | 209 | UINT32 ApMachineCheckHandlerSize;\r |
d5aa2078 ED |
210 | //\r |
211 | // CPU information which is required when set the register table.\r | |
212 | //\r | |
213 | CPU_STATUS_INFORMATION CpuStatus;\r | |
214 | //\r | |
215 | // Location info for each AP.\r | |
216 | // It points to an array which saves all APs location info.\r | |
217 | // The array count is the AP count in this CPU.\r | |
218 | //\r | |
219 | // If the platform does not support MSR setting at S3 resume, and\r | |
220 | // therefore it doesn't need the dependency semaphores, it should set\r | |
221 | // this field to 0.\r | |
222 | //\r | |
223 | EFI_PHYSICAL_ADDRESS ApLocation;\r | |
1c27f926 MK |
224 | } ACPI_CPU_DATA;\r |
225 | \r | |
226 | #endif\r |