2 Definitions to install Multiple Processor PPI.
4 Copyright (c) 2015, 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
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.
15 #ifndef _CPU_MP_PEI_H_
16 #define _CPU_MP_PEI_H_
20 #include <Ppi/SecPlatformInformation.h>
21 #include <Ppi/SecPlatformInformation2.h>
23 #include <Register/LocalApic.h>
25 #include <Library/BaseLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/HobLib.h>
29 #include <Library/LocalApicLib.h>
30 #include <Library/MtrrLib.h>
31 #include <Library/PcdLib.h>
32 #include <Library/PeimEntryPoint.h>
33 #include <Library/PeiServicesLib.h>
34 #include <Library/ReportStatusCodeLib.h>
35 #include <Library/SynchronizationLib.h>
36 #include <Library/TimerLib.h>
37 #include <Library/UefiCpuLib.h>
39 #include "Microcode.h"
51 // AP reset code information
54 UINT8
*RendezvousFunnelAddress
;
55 UINTN PModeEntryOffset
;
56 UINTN LModeEntryOffset
;
57 UINTN RendezvousFunnelSize
;
58 } MP_ASSEMBLY_ADDRESS_MAP
;
60 typedef struct _PEI_CPU_MP_DATA PEI_CPU_MP_DATA
;
76 UINT32 DefaultSize
: 1;
77 UINT32 Granularity
: 1;
84 // MP CPU exchange information for AP reset code
91 IA32_DESCRIPTOR GdtrProfile
;
92 IA32_DESCRIPTOR IdtrProfile
;
95 UINTN NumApsExecuting
;
98 PEI_CPU_MP_DATA
*PeiCpuMpData
;
99 } MP_CPU_EXCHANGE_INFO
;
105 EFI_HEALTH_FLAGS Health
;
111 // PEI CPU MP Data save in memory
113 struct _PEI_CPU_MP_DATA
{
117 UINTN CpuApStackSize
;
118 MP_ASSEMBLY_ADDRESS_MAP AddressMap
;
121 UINTN BackupBufferSize
;
123 UINTN ApFunctionArgument
;
124 volatile UINT32 FinishedCount
;
126 MTRR_SETTINGS MtrrTable
;
127 PEI_CPU_DATA
*CpuData
;
128 volatile MP_CPU_EXCHANGE_INFO
*MpCpuExchangeInfo
;
132 Assembly code to get starting address and size of the rendezvous entry for APs.
133 Information for fixing a jump instruction in the code is also returned.
135 @param AddressMap Output buffer for address map information.
140 OUT MP_ASSEMBLY_ADDRESS_MAP
*AddressMap
144 Assembly code to load GDT table and update segment accordingly.
146 @param Gdtr Pointer to GDT descriptor
151 IN IA32_DESCRIPTOR
*Gdtr
156 Get CPU MP Data pointer from the Guided HOB.
158 @return Pointer to Pointer to PEI CPU MP Data
166 Collects BIST data from PPI.
168 This function collects BIST data from Sec Platform Information2 PPI
169 or SEC Platform Information PPI.
171 @param PeiServices Pointer to PEI Services Table
172 @param PeiCpuMpData Pointer to PEI CPU MP Data
176 CollectBistDataFromPpi (
177 IN CONST EFI_PEI_SERVICES
**PeiServices
,
178 IN PEI_CPU_MP_DATA
*PeiCpuMpData
182 Implementation of the PlatformInformation2 service in EFI_SEC_PLATFORM_INFORMATION2_PPI.
184 @param PeiServices The pointer to the PEI Services Table.
185 @param StructureSize The pointer to the variable describing size of the input buffer.
186 @param PlatformInformationRecord2 The pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD2.
188 @retval EFI_SUCCESS The data was successfully returned.
189 @retval EFI_BUFFER_TOO_SMALL The buffer was too small. The current buffer size needed to
190 hold the record is returned in StructureSize.
195 SecPlatformInformation2 (
196 IN CONST EFI_PEI_SERVICES
**PeiServices
,
197 IN OUT UINT64
*StructureSize
,
198 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2
*PlatformInformationRecord2