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
;
64 UINT8
*ConfigurationPcd
;
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 Worker function to return processor index.
93 @return The processor index.
101 Gets detailed MP-related information on the requested processor at the
102 instant this call is made.
104 @param[in] ProcessorNumber The handle number of processor.
105 @param[out] ProcessorInfoBuffer A pointer to the buffer where information for
106 the requested processor is deposited.
108 @return Status of MpServices->GetProcessorInfo().
111 GetProcessorInformation (
112 IN UINTN ProcessorNumber
,
113 OUT EFI_PROCESSOR_INFORMATION
*ProcessorInfoBuffer
117 Worker function to execute a caller provided function on all enabled APs.
119 @param[in] Procedure A pointer to the function to be run on
120 enabled APs of the system.
124 IN EFI_AP_PROCEDURE Procedure
128 Worker function to retrieve the number of logical processor in the platform.
130 @param[out] NumberOfCpus Pointer to the total number of logical
131 processors in the system, including the BSP
133 @param[out] NumberOfEnabledProcessors Pointer to the number of enabled logical
134 processors that exist in system, including
138 GetNumberOfProcessor (
139 OUT UINTN
*NumberOfCpus
,
140 OUT UINTN
*NumberOfEnabledProcessors
144 Worker function to switch the requested AP to be the BSP from that point onward.
146 @param[in] ProcessorNumber The handle number of AP that is to become the new BSP.
150 IN UINTN ProcessorNumber
154 Function that uses DEBUG() macros to display the contents of a a CPU feature bit mask.
156 @param[in] FeatureMask A pointer to the CPU feature bit mask.
160 IN UINT8
*FeatureMask
164 Dump CPU feature name or CPU feature bit mask.
166 @param[in] CpuFeature Pointer to CPU_FEATURES_ENTRY
170 IN CPU_FEATURES_ENTRY
*CpuFeature