summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/cpu.H
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-07-07 17:24:25 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-07-07 17:24:25 -0500
commit2c2101232adf2b134cf408f05f00a21dc5b8b0f3 (patch)
treea9710129f768bce446b05cab9dac44c9846bb39b /src/include/kernel/cpu.H
parentce785ea353070d14462e3c3395bf89d47c896461 (diff)
downloadtalos-hostboot-2c2101232adf2b134cf408f05f00a21dc5b8b0f3.tar.gz
talos-hostboot-2c2101232adf2b134cf408f05f00a21dc5b8b0f3.zip
SMT support.
Diffstat (limited to 'src/include/kernel/cpu.H')
-rw-r--r--src/include/kernel/cpu.H11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/kernel/cpu.H b/src/include/kernel/cpu.H
index 2e5a489d9..81b43a57c 100644
--- a/src/include/kernel/cpu.H
+++ b/src/include/kernel/cpu.H
@@ -2,6 +2,10 @@
#define __KERNEL_CPU_H
#include <kernel/types.h>
+#include <kernel/ppcarch.H>
+
+// Thread ID support only, Power7 (4 threads).
+#define KERNEL_MAX_SUPPORTED_CPUS 4
class Scheduler;
@@ -11,6 +15,13 @@ struct cpu_t
cpuid_t cpu;
Scheduler* scheduler;
+ task_t* idle_task;
};
+__attribute__((always_inline))
+inline uint64_t getCpuId()
+{
+ return ppc_getPIR() & (KERNEL_MAX_SUPPORTED_CPUS - 1);
+}
+
#endif
OpenPOWER on IntegriCloud