From 7f4d628d6285195e19c692485d21928c85088b45 Mon Sep 17 00:00:00 2001 From: mmason Date: Wed, 25 Jul 2007 18:35:30 +0000 Subject: Fixes for PR4836. --- tapset/task.stp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tapset/task.stp') diff --git a/tapset/task.stp b/tapset/task.stp index 2f183838..1a7699d0 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -109,9 +109,19 @@ function task_nice:long (task:long) %{ /* pure */ // Return the scheduled cpu for the given task -function task_cpu:long (task:long) %{ /* pure */ +function task_cpu:long (task:long) +%( kernel_v >= "2.6.23" %? +%{ /* pure */ + struct task_struct *t = (struct task_struct *)(long)THIS->task; + struct thread_info *ti = kread(&(t->stack)); + THIS->__retvalue = kread(&(ti->cpu)); + CATCH_DEREF_FAULT(); +%} +%: +%{ /* pure */ struct task_struct *t = (struct task_struct *)(long)THIS->task; struct thread_info *ti = kread(&(t->thread_info)); THIS->__retvalue = kread(&(ti->cpu)); CATCH_DEREF_FAULT(); %} +%) -- cgit