4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "CpuCommonFeatures.h"
12 Detects if Pending Break feature supported on current processor.
14 @param[in] ProcessorNumber The index of the CPU executing this function.
15 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
16 structure for the CPU executing this function.
17 @param[in] ConfigData A pointer to the configuration buffer returned
18 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
19 CPU_FEATURE_GET_CONFIG_DATA was not provided in
22 @retval TRUE Pending Break feature is supported.
23 @retval FALSE Pending Break feature is not supported.
25 @note This service could be called by BSP/APs.
30 IN UINTN ProcessorNumber
,
31 IN REGISTER_CPU_FEATURE_INFORMATION
*CpuInfo
,
32 IN VOID
*ConfigData OPTIONAL
35 if (IS_ATOM_PROCESSOR (CpuInfo
->DisplayFamily
, CpuInfo
->DisplayModel
) ||
36 IS_CORE2_PROCESSOR (CpuInfo
->DisplayFamily
, CpuInfo
->DisplayModel
) ||
37 IS_CORE_PROCESSOR (CpuInfo
->DisplayFamily
, CpuInfo
->DisplayModel
) ||
38 IS_PENTIUM_4_PROCESSOR (CpuInfo
->DisplayFamily
, CpuInfo
->DisplayModel
) ||
39 IS_PENTIUM_M_PROCESSOR (CpuInfo
->DisplayFamily
, CpuInfo
->DisplayModel
)) {
40 return (CpuInfo
->CpuIdVersionInfoEdx
.Bits
.PBE
== 1);
46 Initializes Pending Break feature to specific state.
48 @param[in] ProcessorNumber The index of the CPU executing this function.
49 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
50 structure for the CPU executing this function.
51 @param[in] ConfigData A pointer to the configuration buffer returned
52 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
53 CPU_FEATURE_GET_CONFIG_DATA was not provided in
55 @param[in] State If TRUE, then the Pending Break feature must be enabled.
56 If FALSE, then the Pending Break feature must be disabled.
58 @retval RETURN_SUCCESS Pending Break feature is initialized.
60 @note This service could be called by BSP only.
64 PendingBreakInitialize (
65 IN UINTN ProcessorNumber
,
66 IN REGISTER_CPU_FEATURE_INFORMATION
*CpuInfo
,
67 IN VOID
*ConfigData
, OPTIONAL
72 // The scope of the MSR_ATOM_IA32_MISC_ENABLE is core for below processor type, only program
73 // MSR_ATOM_IA32_MISC_ENABLE for thread 0 in each core.
75 // Support function has check the processer type for this feature, no need to check again
78 if (CpuInfo
->ProcessorInfo
.Location
.Thread
!= 0) {
79 return RETURN_SUCCESS
;
83 // ATOM, CORE2, CORE, PENTIUM_4 and IS_PENTIUM_M_PROCESSOR have the same MSR index,
84 // Simply use MSR_ATOM_IA32_MISC_ENABLE here
86 CPU_REGISTER_TABLE_WRITE_FIELD (
89 MSR_ATOM_IA32_MISC_ENABLE
,
90 MSR_ATOM_IA32_MISC_ENABLE_REGISTER
,
94 return RETURN_SUCCESS
;