summaryrefslogtreecommitdiffstats
path: root/src/lib/syscall_misc.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/syscall_misc.C')
-rw-r--r--src/lib/syscall_misc.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/syscall_misc.C b/src/lib/syscall_misc.C
index 26ecc9bfe..ac9070a40 100644
--- a/src/lib/syscall_misc.C
+++ b/src/lib/syscall_misc.C
@@ -43,3 +43,25 @@ uint8_t cpu_dd_level()
return reinterpret_cast<uint64_t>(_syscall0(MISC_CPUDDLEVEL));
}
+size_t cpu_thread_count()
+{
+ size_t threads = 0;
+ ProcessorCoreType core_type = cpu_core_type();
+ switch(core_type)
+ {
+ case CORE_POWER7:
+ case CORE_POWER7_PLUS:
+ threads = 4;
+ break;
+
+ case CORE_POWER8_SALERNO:
+ case CORE_POWER8_VENICE:
+ threads = 8;
+ break;
+
+ default:
+ break;
+ }
+ return threads;
+}
+
OpenPOWER on IntegriCloud