2 CPU Register Table Library definitions.
4 Copyright (c) 2017, 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 _REGISTER_CPU_FEATURES_H_
16 #define _REGISTER_CPU_FEATURES_H_
18 #include <Library/BaseLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PcdLib.h>
21 #include <Library/RegisterCpuFeaturesLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/MemoryAllocationLib.h>
24 #include <Library/SynchronizationLib.h>
25 #include <Library/IoLib.h>
27 #include <AcpiCpuData.h>
29 #define CPU_FEATURE_ENTRY_SIGNATURE SIGNATURE_32 ('C', 'F', 'E', 'S')
31 #define CPU_FEATURE_NAME_SIZE 128
34 REGISTER_CPU_FEATURE_INFORMATION CpuInfo
;
35 UINT8
*FeaturesSupportedMask
;
37 } CPU_FEATURES_INIT_ORDER
;
44 CPU_FEATURE_GET_CONFIG_DATA GetConfigDataFunc
;
45 CPU_FEATURE_SUPPORT SupportFunc
;
46 CPU_FEATURE_INITIALIZE InitializeFunc
;
47 UINT8
*BeforeFeatureBitMask
;
48 UINT8
*AfterFeatureBitMask
;
58 SPIN_LOCK MemoryMappedLock
;
59 LIST_ENTRY FeatureList
;
61 CPU_FEATURES_INIT_ORDER
*InitOrder
;
63 UINT8
*CapabilityPcds
;
64 UINT8
*ConfigurationPcds
;
67 CPU_REGISTER_TABLE
*RegisterTable
;
68 CPU_REGISTER_TABLE
*PreSmmRegisterTable
;
72 #define CPU_FEATURE_ENTRY_FROM_LINK(a) \
77 CPU_FEATURE_ENTRY_SIGNATURE \
81 Worker function to get CPU_FEATURES_DATA pointer.
83 @return Pointer to CPU_FEATURES_DATA.
91 Enlarges CPU register table for each processor.
93 @param[in, out] RegisterTable Pointer processor's CPU register table
96 EnlargeRegisterTable (
97 IN OUT CPU_REGISTER_TABLE
*RegisterTable
101 Allocates ACPI NVS memory to save ACPI_CPU_DATA.
103 @return Pointer to allocated ACPI_CPU_DATA.
106 AllocateAcpiCpuData (
111 Worker function to return processor index.
113 @return The processor index.
121 Gets detailed MP-related information on the requested processor at the
122 instant this call is made.
124 @param[in] ProcessorNumber The handle number of processor.
125 @param[out] ProcessorInfoBuffer A pointer to the buffer where information for
126 the requested processor is deposited.
128 @return Status of MpServices->GetProcessorInfo().
131 GetProcessorInformation (
132 IN UINTN ProcessorNumber
,
133 OUT EFI_PROCESSOR_INFORMATION
*ProcessorInfoBuffer
137 Worker function to execute a caller provided function on all enabled APs.
139 @param[in] Procedure A pointer to the function to be run on
140 enabled APs of the system.
144 IN EFI_AP_PROCEDURE Procedure
148 Worker function to retrieve the number of logical processor in the platform.
150 @param[out] NumberOfCpus Pointer to the total number of logical
151 processors in the system, including the BSP
153 @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical
154 processors that exist in system, including
158 GetNumberOfProcessor (
159 OUT UINTN
*NumberOfCpus
,
160 OUT UINTN
*NumberOfEnabledProcessors
164 Worker function to switch the requested AP to be the BSP from that point onward.
166 @param[in] ProcessorNumber The handle number of AP that is to become the new BSP.
170 IN UINTN ProcessorNumber
174 Function that uses DEBUG() macros to display the contents of a a CPU feature bit mask.
176 @param[in] FeatureMask A pointer to the CPU feature bit mask.
180 IN UINT8
*FeatureMask
184 Dump CPU feature name or CPU feature bit mask.
186 @param[in] CpuFeature Pointer to CPU_FEATURES_ENTRY
190 IN CPU_FEATURES_ENTRY
*CpuFeature