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