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
))
41 return (CpuInfo
->CpuIdVersionInfoEdx
.Bits
.PBE
== 1);
48 Initializes Pending Break feature to specific state.
50 @param[in] ProcessorNumber The index of the CPU executing this function.
51 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
52 structure for the CPU executing this function.
53 @param[in] ConfigData A pointer to the configuration buffer returned
54 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
55 CPU_FEATURE_GET_CONFIG_DATA was not provided in
57 @param[in] State If TRUE, then the Pending Break feature must be enabled.
58 If FALSE, then the Pending Break feature must be disabled.
60 @retval RETURN_SUCCESS Pending Break feature is initialized.
62 @note This service could be called by BSP only.
66 PendingBreakInitialize (
67 IN UINTN ProcessorNumber
,
68 IN REGISTER_CPU_FEATURE_INFORMATION
*CpuInfo
,
69 IN VOID
*ConfigData OPTIONAL
,
74 // The scope of the MSR_ATOM_IA32_MISC_ENABLE is core for below processor type, only program
75 // MSR_ATOM_IA32_MISC_ENABLE for thread 0 in each core.
77 // Support function has check the processer type for this feature, no need to check again
80 if (CpuInfo
->ProcessorInfo
.Location
.Thread
!= 0) {
81 return RETURN_SUCCESS
;
85 // ATOM, CORE2, CORE, PENTIUM_4 and IS_PENTIUM_M_PROCESSOR have the same MSR index,
86 // Simply use MSR_ATOM_IA32_MISC_ENABLE here
88 CPU_REGISTER_TABLE_WRITE_FIELD (
91 MSR_ATOM_IA32_MISC_ENABLE
,
92 MSR_ATOM_IA32_MISC_ENABLE_REGISTER
,
96 return RETURN_SUCCESS
;