aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/intel/common/hyperthreading.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-08-05 13:43:35 +0200
committerAngel Pons <th3fanbus@gmail.com>2020-08-06 22:33:02 +0000
commit0e0273a015f57e244015c80f0fa37192f1e569f3 (patch)
tree373e54a66e7623bf602a58466764b4b3418c12dd /src/cpu/intel/common/hyperthreading.c
parent3d813cbede650a89a519d5896652328e4ecf88c6 (diff)
cpu/intel/common: Add `intel_ht_supported` function
Change-Id: I90c0378c4042dec39c8c86c1d2339a5cbcfe78e3 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44210 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/cpu/intel/common/hyperthreading.c')
-rw-r--r--src/cpu/intel/common/hyperthreading.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cpu/intel/common/hyperthreading.c b/src/cpu/intel/common/hyperthreading.c
index d68614974f..fce7576673 100644
--- a/src/cpu/intel/common/hyperthreading.c
+++ b/src/cpu/intel/common/hyperthreading.c
@@ -3,6 +3,13 @@
#include <cpu/x86/lapic.h>
#include <cpu/intel/common/common.h>
#include <arch/cpu.h>
+#include <types.h>
+
+bool intel_ht_supported(void)
+{
+ /* Is HyperThreading supported? */
+ return !!(cpuid_edx(1) & CPUID_FEAURE_HTT);
+}
/*
* Return true if running thread does not have the smallest lapic ID
@@ -13,8 +20,7 @@ bool intel_ht_sibling(void)
struct cpuid_result result;
unsigned int core_ids, apic_ids, threads;
- /* Is Hyper-Threading supported */
- if (!(cpuid_edx(1) & CPUID_FEAURE_HTT))
+ if (!intel_ht_supported())
return false;
apic_ids = 1;