From owner-svn-src-head@freebsd.org Sat May 20 17:32:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88379D75F37; Sat, 20 May 2017 17:32:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D10F1443; Sat, 20 May 2017 17:32:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHW2oB029068; Sat, 20 May 2017 17:32:02 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHW1Pc029064; Sat, 20 May 2017 17:32:01 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705201732.v4KHW1Pc029064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 20 May 2017 17:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318582 - in head/lib: libc/gen libc/include libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2017 17:32:03 -0000 Author: vangyzen Date: Sat May 20 17:32:01 2017 New Revision: 318582 URL: https://svnweb.freebsd.org/changeset/base/318582 Log: Remove old spinlock_debug code from libc This no longer seems useful. Remove it. This was prompted by a "cast discards volatile qualifier" warning in libthr when WARNS=6. Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10832 Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/_spinlock_stub.c head/lib/libc/include/spinlock.h head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_spinlock.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat May 20 17:30:48 2017 (r318581) +++ head/lib/libc/gen/Symbol.map Sat May 20 17:32:01 2017 (r318582) @@ -485,7 +485,6 @@ FBSDprivate_1.0 { _pthread_sigmask; _pthread_testcancel; _spinlock; - _spinlock_debug; _spinunlock; _rtld_addr_phdr; _rtld_atfork_pre; Modified: head/lib/libc/gen/_spinlock_stub.c ============================================================================== --- head/lib/libc/gen/_spinlock_stub.c Sat May 20 17:30:48 2017 (r318581) +++ head/lib/libc/gen/_spinlock_stub.c Sat May 20 17:32:01 2017 (r318582) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); long _atomic_lock_stub(volatile long *); void _spinlock_stub(spinlock_t *); void _spinunlock_stub(spinlock_t *); -void _spinlock_debug_stub(spinlock_t *, char *, int); __weak_reference(_atomic_lock_stub, _atomic_lock); @@ -48,7 +47,6 @@ _atomic_lock_stub(volatile long *lck __u return (0L); } -__weak_reference(_spinlock, _spinlock_debug); #pragma weak _spinlock void _spinlock(spinlock_t *lck) Modified: head/lib/libc/include/spinlock.h ============================================================================== --- head/lib/libc/include/spinlock.h Sat May 20 17:30:48 2017 (r318581) +++ head/lib/libc/include/spinlock.h Sat May 20 17:32:01 2017 (r318582) @@ -41,21 +41,17 @@ * Lock structure with room for debugging information. */ struct _spinlock { - volatile long access_lock; - volatile long lock_owner; - volatile char *fname; - volatile int lineno; + long spare1; + long spare2; + void *thr_extra; + int spare3; }; typedef struct _spinlock spinlock_t; #define _SPINLOCK_INITIALIZER { 0, 0, 0, 0 } #define _SPINUNLOCK(_lck) _spinunlock(_lck); -#ifdef _LOCK_DEBUG -#define _SPINLOCK(_lck) _spinlock_debug(_lck, __FILE__, __LINE__) -#else #define _SPINLOCK(_lck) _spinlock(_lck) -#endif /* * Thread function prototype definitions: @@ -64,7 +60,6 @@ __BEGIN_DECLS long _atomic_lock(volatile long *); void _spinlock(spinlock_t *); void _spinunlock(spinlock_t *); -void _spinlock_debug(spinlock_t *, char *, int); __END_DECLS #endif /* _SPINLOCK_H_ */ Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sat May 20 17:30:48 2017 (r318581) +++ head/lib/libthr/thread/thr_init.c Sat May 20 17:32:01 2017 (r318582) @@ -173,7 +173,6 @@ STATIC_LIB_REQUIRE(_sigtimedwait); STATIC_LIB_REQUIRE(_sigwait); STATIC_LIB_REQUIRE(_sigwaitinfo); STATIC_LIB_REQUIRE(_spinlock); -STATIC_LIB_REQUIRE(_spinlock_debug); STATIC_LIB_REQUIRE(_spinunlock); STATIC_LIB_REQUIRE(_thread_init_hack); Modified: head/lib/libthr/thread/thr_spinlock.c ============================================================================== --- head/lib/libthr/thread/thr_spinlock.c Sat May 20 17:30:48 2017 (r318581) +++ head/lib/libthr/thread/thr_spinlock.c Sat May 20 17:32:01 2017 (r318582) @@ -65,7 +65,7 @@ __thr_spinunlock(spinlock_t *lck) { struct spinlock_extra *_extra; - _extra = (struct spinlock_extra *)lck->fname; + _extra = lck->thr_extra; THR_UMUTEX_UNLOCK(_get_curthread(), &_extra->lock); } @@ -78,9 +78,9 @@ __thr_spinlock(spinlock_t *lck) PANIC("Spinlock called when not threaded."); if (!initialized) PANIC("Spinlocks not initialized."); - if (lck->fname == NULL) + if (lck->thr_extra == NULL) init_spinlock(lck); - _extra = (struct spinlock_extra *)lck->fname; + _extra = lck->thr_extra; THR_UMUTEX_LOCK(_get_curthread(), &_extra->lock); } @@ -90,14 +90,14 @@ init_spinlock(spinlock_t *lck) struct pthread *curthread = _get_curthread(); THR_UMUTEX_LOCK(curthread, &spinlock_static_lock); - if ((lck->fname == NULL) && (spinlock_count < MAX_SPINLOCKS)) { - lck->fname = (char *)&extra[spinlock_count]; + if ((lck->thr_extra == NULL) && (spinlock_count < MAX_SPINLOCKS)) { + lck->thr_extra = &extra[spinlock_count]; _thr_umutex_init(&extra[spinlock_count].lock); extra[spinlock_count].owner = lck; spinlock_count++; } THR_UMUTEX_UNLOCK(curthread, &spinlock_static_lock); - if (lck->fname == NULL) + if (lck->thr_extra == NULL) PANIC("Warning: exceeded max spinlocks"); }