aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/sched.h
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2017-11-11 11:01:50 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2017-11-11 11:01:50 +0000
commitef9257491d1ed6fba2c844fef0ff2ece22245cdd (patch)
tree2ed133fab8493a207fa3edf0c44c24deb23f3904 /sys/compat/linuxkpi/common/include/linux/sched.h
parente0390735d311a75a62388f31de7152cfe066ee76 (diff)
downloadsrc-ef9257491d1ed6fba2c844fef0ff2ece22245cdd.tar.gz
src-ef9257491d1ed6fba2c844fef0ff2ece22245cdd.zip
Remove release and acquire semantics when accessing the "state" field of the
LinuxKPI task struct. Change type of "state" variable from "int" to "atomic_t" to simplify code and avoid unneccessary casting. MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=325708
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/sched.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sched.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index 1742430f430b..9d5bca717b4d 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -67,7 +67,7 @@ struct task_struct {
void *task_data;
int task_ret;
atomic_t usage;
- int state;
+ atomic_t state;
atomic_t kthread_flags;
pid_t pid; /* BSD thread ID */
const char *comm;
@@ -92,9 +92,8 @@ struct task_struct {
#define put_pid(x) do { } while (0)
#define current_euid() (curthread->td_ucred->cr_uid)
-#define set_task_state(task, x) \
- atomic_store_rel_int((volatile int *)&task->state, (x))
-#define __set_task_state(task, x) (task->state = (x))
+#define set_task_state(task, x) atomic_set(&(task)->state, (x))
+#define __set_task_state(task, x) ((task)->state.counter = (x))
#define set_current_state(x) set_task_state(current, x)
#define __set_current_state(x) __set_task_state(current, x)