summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-06-22 16:41:25 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-06-22 16:41:25 -0500
commit261aa2b9b790868a16a6cee0f19c73221ddc81d5 (patch)
tree324a74523aa6596705ae2021c494e6acd2ddbb89 /src/lib
parent02b38895c3af9ce6aae9bc02ef2930fabefff628 (diff)
downloadtalos-hostboot-261aa2b9b790868a16a6cee0f19c73221ddc81d5.tar.gz
talos-hostboot-261aa2b9b790868a16a6cee0f19c73221ddc81d5.zip
Program exception handling and emulated instruction for mfsprg3.
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