summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/syscall_task.C9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/syscall_task.C b/src/lib/syscall_task.C
index d07ea3f19..405e4f202 100644
--- a/src/lib/syscall_task.C
+++ b/src/lib/syscall_task.C
@@ -1,6 +1,7 @@
#include <sys/task.h>
#include <sys/syscall.h>
#include <kernel/task.H>
+#include <kernel/taskmgr.H>
using namespace Systemcalls;
@@ -23,5 +24,11 @@ void task_end()
tid_t task_gettid()
{
- return (tid_t)_syscall0(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.
+
+ return TaskManager::getCurrentTask()->tid;
+ //return (tid_t)_syscall0(TASK_GETTID);
}
OpenPOWER on IntegriCloud