aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/sched.h
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2017-04-07 14:43:28 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2017-04-07 14:43:28 +0000
commit22cbd6ef2ec01e233e4cc310bdee9d1a43993737 (patch)
treef0f11ac177d5040c6c2611eaba61dcc163598ecd /sys/compat/linuxkpi/common/include/linux/sched.h
parent16e77e0036149e4eff2cf7cb4165165f05ce86f0 (diff)
downloadsrc-22cbd6ef2ec01e233e4cc310bdee9d1a43993737.tar.gz
src-22cbd6ef2ec01e233e4cc310bdee9d1a43993737.zip
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
Notes
Notes: svn path=/head/; revision=316609
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/sched.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sched.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index c3de79414c10..4de6f9e28238 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -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)