]>
Commit | Line | Data |
---|---|---|
1c27f926 MK |
1 | /** @file\r |
2 | Definitions for CPU S3 data.\r | |
3 | \r | |
9cc45009 | 4 | Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>\r |
1c27f926 MK |
5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT 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 | 21 | typedef enum {\r |
1c27f926 MK |
22 | Msr,\r |
23 | ControlRegister,\r | |
24 | MemoryMapped,\r | |
25 | CacheControl\r | |
26 | } REGISTER_TYPE;\r | |
27 | \r | |
28 | //\r | |
29 | // Element of register table entry\r | |
30 | //\r | |
31 | typedef struct {\r | |
30b7a50b JF |
32 | REGISTER_TYPE RegisterType; // offset 0 - 3\r |
33 | UINT32 Index; // offset 4 - 7\r | |
34 | UINT8 ValidBitStart; // offset 8\r | |
35 | UINT8 ValidBitLength; // offset 9\r | |
36 | UINT16 Reserved; // offset 10 - 11\r | |
37 | UINT32 HighIndex; // offset 12-15, only valid for MemoryMapped\r | |
38 | UINT64 Value; // offset 16-23\r | |
1c27f926 MK |
39 | } CPU_REGISTER_TABLE_ENTRY;\r |
40 | \r | |
41 | //\r | |
42 | // Register table definition, including current table length,\r | |
43 | // allocated size of this table, and pointer to the list of table entries.\r | |
44 | //\r | |
45 | typedef struct {\r | |
af381fda MK |
46 | //\r |
47 | // The number of valid entries in the RegisterTableEntry buffer\r | |
48 | //\r | |
49 | UINT32 TableLength;\r | |
50 | UINT32 NumberBeforeReset;\r | |
51 | //\r | |
52 | // The size, in bytes, of the RegisterTableEntry buffer\r | |
53 | //\r | |
54 | UINT32 AllocatedSize;\r | |
55 | //\r | |
56 | // The initial APIC ID of the CPU this register table applies to\r | |
57 | //\r | |
58 | UINT32 InitialApicId;\r | |
59 | //\r | |
9cc45009 | 60 | // Physical address of CPU_REGISTER_TABLE_ENTRY structures. This buffer must be\r |
af381fda MK |
61 | // allocated below 4GB from memory of type EfiACPIMemoryNVS.\r |
62 | //\r | |
9cc45009 | 63 | EFI_PHYSICAL_ADDRESS RegisterTableEntry;\r |
1c27f926 MK |
64 | } CPU_REGISTER_TABLE;\r |
65 | \r | |
af381fda MK |
66 | //\r |
67 | // Data structure that is required for ACPI S3 resume. This structure must be\r | |
68 | // allocated below 4GB from memory of type EfiACPIMemoryNVS. The PCD\r | |
69 | // PcdCpuS3DataAddress must be set to the physical address where this structure\r | |
70 | // is allocated\r | |
71 | //\r | |
1c27f926 | 72 | typedef struct {\r |
af381fda MK |
73 | //\r |
74 | // Physical address of 4KB buffer allocated below 1MB from memory of type\r | |
75 | // EfiReservedMemoryType. The buffer is not required to be initialized, but\r | |
76 | // it is recommended that the buffer be zero-filled. This buffer is used to\r | |
77 | // wake APs during an ACPI S3 resume.\r | |
78 | //\r | |
1c27f926 | 79 | EFI_PHYSICAL_ADDRESS StartupVector;\r |
af381fda MK |
80 | //\r |
81 | // Physical address of structure of type IA32_DESCRIPTOR. This structure must\r | |
82 | // be allocated below 4GB from memory of type EfiACPIMemoryNVS. The\r | |
83 | // IA32_DESCRIPTOR structure provides the base address and length of a GDT\r | |
84 | // The buffer for GDT must also be allocated below 4GB from memory of type\r | |
85 | // EfiACPIMemoryNVS. The GDT must be filled in with the GDT contents that are\r | |
86 | // used during an ACPI S3 resume. This is typically the contents of the GDT\r | |
87 | // used by the boot processor when the platform is booted.\r | |
88 | //\r | |
1c27f926 | 89 | EFI_PHYSICAL_ADDRESS GdtrProfile;\r |
af381fda MK |
90 | //\r |
91 | // Physical address of structure of type IA32_DESCRIPTOR. This structure must\r | |
92 | // be allocated below 4GB from memory of type EfiACPIMemoryNVS. The\r | |
93 | // IA32_DESCRIPTOR structure provides the base address and length of an IDT.\r | |
94 | // The buffer for IDT must also be allocated below 4GB from memory of type\r | |
95 | // EfiACPIMemoryNVS. The IDT must be filled in with the IDT contents that are\r | |
96 | // used during an ACPI S3 resume. This is typically the contents of the IDT\r | |
97 | // used by the boot processor when the platform is booted.\r | |
98 | //\r | |
1c27f926 | 99 | EFI_PHYSICAL_ADDRESS IdtrProfile;\r |
af381fda MK |
100 | //\r |
101 | // Physical address of a buffer that is used as stacks during ACPI S3 resume.\r | |
102 | // The total size of this buffer, in bytes, is NumberOfCpus * StackSize. This\r | |
103 | // structure must be allocated below 4GB from memory of type EfiACPIMemoryNVS.\r | |
104 | //\r | |
1c27f926 | 105 | EFI_PHYSICAL_ADDRESS StackAddress;\r |
af381fda MK |
106 | //\r |
107 | // The size, in bytes, of the stack provided to each CPU during ACPI S3 resume.\r | |
108 | //\r | |
1c27f926 | 109 | UINT32 StackSize;\r |
af381fda MK |
110 | //\r |
111 | // The number of CPUs. If a platform does not support hot plug CPUs, then\r | |
112 | // this is the number of CPUs detected when the platform is booted, regardless\r | |
113 | // of being enabled or disabled. If a platform does support hot plug CPUs,\r | |
114 | // then this is the maximum number of CPUs that the platform supports.\r | |
115 | //\r | |
1c27f926 | 116 | UINT32 NumberOfCpus;\r |
af381fda MK |
117 | //\r |
118 | // Physical address of structure of type MTRR_SETTINGS that contains a copy\r | |
119 | // of the MTRR settings that are compatible with the MTRR settings used by\r | |
120 | // the boot processor when the platform was booted. These MTRR settings are\r | |
121 | // used during an ACPI S3 resume. This structure must be allocated below 4GB\r | |
122 | // from memory of type EfiACPIMemoryNVS.\r | |
123 | //\r | |
1c27f926 MK |
124 | EFI_PHYSICAL_ADDRESS MtrrTable;\r |
125 | //\r | |
af381fda MK |
126 | // Physical address of an array of CPU_REGISTER_TABLE structures, with\r |
127 | // NumberOfCpus entries. This array must be allocated below 4GB from memory\r | |
128 | // of type EfiACPIMemoryNVS. If a register table is not required, then the\r | |
129 | // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r | |
130 | // If TableLength is > 0, then elements of RegisterTableEntry are used to\r | |
131 | // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r | |
132 | // before SMBASE relocation is performed.\r | |
1c27f926 MK |
133 | //\r |
134 | EFI_PHYSICAL_ADDRESS PreSmmInitRegisterTable;\r | |
135 | //\r | |
af381fda MK |
136 | // Physical address of an array of CPU_REGISTER_TABLE structures, with\r |
137 | // NumberOfCpus entries. This array must be allocated below 4GB from memory\r | |
138 | // of type EfiACPIMemoryNVS. If a register table is not required, then the\r | |
139 | // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r | |
140 | // If TableLength is > 0, then elements of RegisterTableEntry are used to\r | |
141 | // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r | |
142 | // after SMBASE relocation is performed.\r | |
1c27f926 MK |
143 | //\r |
144 | EFI_PHYSICAL_ADDRESS RegisterTable;\r | |
af381fda MK |
145 | //\r |
146 | // Physical address of a buffer that contains the machine check handler that\r | |
147 | // is used during an ACPI S3 Resume. This buffer must be allocated below 4GB\r | |
148 | // from memory of type EfiACPIMemoryNVS. In order for this machine check\r | |
149 | // handler to be active on an AP during an ACPI S3 resume, the machine check\r | |
150 | // vector in the IDT provided by IdtrProfile must be initialized to transfer\r | |
151 | // control to this physical address.\r | |
152 | //\r | |
1c27f926 | 153 | EFI_PHYSICAL_ADDRESS ApMachineCheckHandlerBase;\r |
af381fda MK |
154 | //\r |
155 | // The size, in bytes, of the machine check handler that is used during an\r | |
156 | // ACPI S3 Resume. If this field is 0, then a machine check handler is not\r | |
157 | // provided.\r | |
158 | //\r | |
1c27f926 MK |
159 | UINT32 ApMachineCheckHandlerSize;\r |
160 | } ACPI_CPU_DATA;\r | |
161 | \r | |
162 | #endif\r |