diff options
author | Stephane Eranian <eranian@hpl.hp.com> | 2006-09-21 13:35:44 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-09-26 14:39:38 -0400 |
commit | dd562c05410e13e878a3ee0deb8ac06db2e132c7 (patch) | |
tree | b99f2e8c4aae70a17a8caf7e3f72926c4dcdd7a4 /arch/ia64 | |
parent | fd32cb3a9c9f9399421408e8734cd8a6d9d1a09f (diff) |
[IA64] Add interface so modules can discover whether multithreading is on.
Add is_multithreading_enabled() to check whether multi-threading
is enabled independently of which cpu is currently online
Signed-off-by: stephane eranian <eranian@hpl.hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 6203ed4ec8cf..f7d7f5668144 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -879,3 +879,27 @@ identify_siblings(struct cpuinfo_ia64 *c) | |||
879 | c->core_id = info.log1_cid; | 879 | c->core_id = info.log1_cid; |
880 | c->thread_id = info.log1_tid; | 880 | c->thread_id = info.log1_tid; |
881 | } | 881 | } |
882 | |||
883 | /* | ||
884 | * returns non zero, if multi-threading is enabled | ||
885 | * on at least one physical package. Due to hotplug cpu | ||
886 | * and (maxcpus=), all threads may not necessarily be enabled | ||
887 | * even though the processor supports multi-threading. | ||
888 | */ | ||
889 | int is_multithreading_enabled(void) | ||
890 | { | ||
891 | int i, j; | ||
892 | |||
893 | for_each_present_cpu(i) { | ||
894 | for_each_present_cpu(j) { | ||
895 | if (j == i) | ||
896 | continue; | ||
897 | if ((cpu_data(j)->socket_id == cpu_data(i)->socket_id)) { | ||
898 | if (cpu_data(j)->core_id == cpu_data(i)->core_id) | ||
899 | return 1; | ||
900 | } | ||
901 | } | ||
902 | } | ||
903 | return 0; | ||
904 | } | ||
905 | EXPORT_SYMBOL_GPL(is_multithreading_enabled); | ||