Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2017 14:04:01 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324803 - head/sys/kern
Message-ID:  <201710201404.v9KE417j078439@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Oct 20 14:04:01 2017
New Revision: 324803
URL: https://svnweb.freebsd.org/changeset/base/324803

Log:
  mtx: fix up UP build after r324778
  
  Reported by:	Michael Butler

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Fri Oct 20 11:07:51 2017	(r324802)
+++ head/sys/kern/kern_mutex.c	Fri Oct 20 14:04:01 2017	(r324803)
@@ -289,7 +289,9 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts,
     int line)
 {
 	struct mtx *m;
+#ifdef SMP
 	uintptr_t tid, v;
+#endif
 
 	m = mtxlock2mtx(c);
 
@@ -306,6 +308,7 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts,
 	opts &= ~MTX_RECURSE;
 	WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE,
 	    file, line, NULL);
+#ifdef SMP
 	spinlock_enter();
 	tid = (uintptr_t)curthread;
 	v = MTX_UNOWNED;
@@ -314,6 +317,9 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts,
 	else
 		LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire,
 		    m, 0, 0, file, line);
+#else
+	__mtx_lock_spin(m, curthread, opts, file, line);
+#endif
 	LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file,
 	    line);
 	WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);



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