Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Apr 2017 14:43:29 +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: r316609 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201704071443.v37EhTQT097015@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Apr  7 14:43:28 2017
New Revision: 316609
URL: https://svnweb.freebsd.org/changeset/base/316609

Log:
  Create the LinuxKPI current task structure on the fly if it doesn't
  exist when the current macro is used.
  
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/sched.h

Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/sched.h	Fri Apr  7 14:30:51 2017	(r316608)
+++ head/sys/compat/linuxkpi/common/include/linux/sched.h	Fri Apr  7 14:43:28 2017	(r316609)
@@ -74,7 +74,11 @@ struct task_struct {
 	struct completion exited;
 };
 
-#define	current		((struct task_struct *)curthread->td_lkpi_task)
+#define	current	({ \
+	struct thread *__td = curthread; \
+	linux_set_current(__td); \
+	((struct task_struct *)__td->td_lkpi_task); \
+})
 
 #define	task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid
 #define	task_pid(task)		((task)->pid)



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