Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 19:32:11 +0000 (UTC)
From:      Johannes Lundberg <johalun@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r347889 - head/sys/compat/linuxkpi/common/src
Message-ID:  <201905161932.x4GJWBYo077721@repo.freebsd.org>

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



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