summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-10-26 09:34:43 +0000
committerhselasky <hselasky@FreeBSD.org>2015-10-26 09:34:43 +0000
commite0346e7915c13121b2522656d87e4e6b15cd9010 (patch)
tree51ea5e85c2ba14321e6bc0c9e0aec35102a202c3 /sys/ofed
parent4bfb2bd97471c49ee6e4d58f3a9785bc33b68f43 (diff)
downloadFreeBSD-src-e0346e7915c13121b2522656d87e4e6b15cd9010.zip
FreeBSD-src-e0346e7915c13121b2522656d87e4e6b15cd9010.tar.gz
Build fix for MIPS.
Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/include/linux/sched.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/ofed/include/linux/sched.h b/sys/ofed/include/linux/sched.h
index 1228868..c2d66d7 100644
--- a/sys/ofed/include/linux/sched.h
+++ b/sys/ofed/include/linux/sched.h
@@ -64,9 +64,12 @@ struct task_struct {
int should_stop;
};
-#define current ((struct task_struct *)curthread->td_retval[1])
-#define task_struct_get(x) (struct task_struct *)(x)->td_retval[1]
-#define task_struct_set(x, y) (x)->td_retval[1] = (register_t)(y)
+#define current task_struct_get(curthread)
+#define task_struct_get(x) ((struct task_struct *)(uintptr_t)(x)->td_retval[1])
+#define task_struct_set(x, y) (x)->td_retval[1] = (uintptr_t)(y)
+
+/* ensure the task_struct pointer fits into the td_retval[1] field */
+CTASSERT(sizeof(((struct thread *)0)->td_retval[1]) >= sizeof(uintptr_t));
#define set_current_state(x) \
atomic_store_rel_int((volatile int *)&current->state, (x))
OpenPOWER on IntegriCloud