Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2015 09:34:43 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289993 - head/sys/ofed/include/linux
Message-ID:  <201510260934.t9Q9YhFW010536@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510260934.t9Q9YhFW010536>