Author: hselasky
Date: Mon Oct 26 09:34:43 2015
New Revision: 289993
URL: https://svnweb.freebsd.org/changeset/base/289993

Log:
  Build fix for MIPS.
  
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/include/linux/sched.h

Modified: head/sys/ofed/include/linux/sched.h
==============================================================================
--- head/sys/ofed/include/linux/sched.h Mon Oct 26 07:19:03 2015        
(r289992)
+++ head/sys/ofed/include/linux/sched.h Mon Oct 26 09:34:43 2015        
(r289993)
@@ -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))
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to