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