summaryrefslogtreecommitdiffstats
path: root/src/lib/syscall_task.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/syscall_task.C')
-rw-r--r--src/lib/syscall_task.C10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/syscall_task.C b/src/lib/syscall_task.C
index a29a9a94c..d637b45af 100644
--- a/src/lib/syscall_task.C
+++ b/src/lib/syscall_task.C
@@ -24,11 +24,11 @@ void task_end()
tid_t task_gettid()
{
- // Even though we have a syscall for GETTID, we can implement this as a
- // direct access to SPRG3. On processor that do not support unprivilaged
- // access to this SPR, we implement it as an emulated instruction in the
- // exception handler.
+ // Even though we have a syscall for GETTID, we also have the task in
+ // GRP13.
- return TaskManager::getCurrentTask()->tid;
+ register task_t* task;
+ asm volatile("addi %0, 13, 0" : "=r"(task));
+ return task->tid;
//return (tid_t)_syscall0(TASK_GETTID);
}
OpenPOWER on IntegriCloud