svn commit: r347889 - head/sys/compat/linuxkpi/common/src
Johannes Lundberg
johalun at FreeBSD.org
Thu May 16 19:32:12 UTC 2019
Author: johalun
Date: Thu May 16 19:32:11 2019
New Revision: 347889
URL: https://svnweb.freebsd.org/changeset/base/347889
Log:
LinuxKPI: Fix build on powerpc/sparc.
Use cmpset instead of testandset in tasklet lock code.
Reviewed by: hps
Approved by: imp (mentor), hps
Obtained from: hps
MFC after: 1 week
Modified:
head/sys/compat/linuxkpi/common/src/linux_tasklet.c
Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 19:10:48 2019 (r347888)
+++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 19:32:11 2019 (r347889)
@@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$");
#define TASKLET_ST_GET(ts) \
READ_ONCE(*(volatile u_int *)&(ts)->tasklet_state)
-#define TASKLET_ST_TESTANDSET(ts, new) \
- atomic_testandset_int((volatile u_int *)&(ts)->tasklet_state, new)
-
struct tasklet_worker {
struct mtx mtx;
TAILQ_HEAD(tasklet_list, tasklet_struct) head;
@@ -234,7 +231,7 @@ int
tasklet_trylock(struct tasklet_struct *ts)
{
- return (!TASKLET_ST_TESTANDSET(ts, TASKLET_ST_BUSY));
+ return (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_BUSY));
}
void
More information about the svn-src-head
mailing list