diff options
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/skylake/cpu.c | 11 | ||||
-rw-r--r-- | src/soc/intel/skylake/include/soc/cpu.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index f92635da77..e9bb29f7a6 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -435,6 +435,17 @@ static int adjust_apic_id(int index, int apic_id) return index; } +/* Check whether the current CPU is the sibling hyperthread. */ +int is_secondary_thread(void) +{ + int apic_id; + apic_id = lapicid(); + + if (!ht_disabled && (apic_id & 1)) + return 1; + return 0; +} + static void per_cpu_smm_trigger(void) { /* Relocate the SMM handler. */ diff --git a/src/soc/intel/skylake/include/soc/cpu.h b/src/soc/intel/skylake/include/soc/cpu.h index 35a30819b2..33fb2f1b3a 100644 --- a/src/soc/intel/skylake/include/soc/cpu.h +++ b/src/soc/intel/skylake/include/soc/cpu.h @@ -67,5 +67,6 @@ int cpu_config_tdp_levels(void); u32 cpu_family_model(void); u32 cpu_stepping(void); int cpu_is_ult(void); +int is_secondary_thread(void); #endif |