summaryrefslogtreecommitdiffstats
path: root/src/lib/syscall_task.C
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/lib/syscall_task.C
parentce785ea353070d14462e3c3395bf89d47c896461 (diff)
downloadtalos-hostboot-2c2101232adf2b134cf408f05f00a21dc5b8b0f3.tar.gz
talos-hostboot-2c2101232adf2b134cf408f05f00a21dc5b8b0f3.zip
SMT support.
Diffstat (limited to 'src/lib/syscall_task.C')
-rw-r--r--src/lib/syscall_task.C8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/syscall_task.C b/src/lib/syscall_task.C
index d637b45af..a6b575b5e 100644
--- a/src/lib/syscall_task.C
+++ b/src/lib/syscall_task.C
@@ -2,6 +2,7 @@
#include <sys/syscall.h>
#include <kernel/task.H>
#include <kernel/taskmgr.H>
+#include <kernel/cpu.H>
using namespace Systemcalls;
@@ -32,3 +33,10 @@ tid_t task_gettid()
return task->tid;
//return (tid_t)_syscall0(TASK_GETTID);
}
+
+cpuid_t task_getcpuid()
+{
+ register task_t* task;
+ asm volatile("addi %0, 13, 0" : "=r"(task));
+ return task->cpu->cpu;
+}
OpenPOWER on IntegriCloud