From owner-svn-src-head@freebsd.org Mon Jun 8 17:40:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 999643369D4; Mon, 8 Jun 2020 17:40:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ggWr3cfzz46xp; Mon, 8 Jun 2020 17:40:40 +0000 (UTC) (envelope-from glebius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778E127E69; Mon, 8 Jun 2020 17:40:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 058Hee7l039984; Mon, 8 Jun 2020 17:40:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 058Heemo039980; Mon, 8 Jun 2020 17:40:40 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202006081740.058Heemo039980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 8 Jun 2020 17:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361931 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361931 X-SVN-Commit-Repository: base 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.33 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: Mon, 08 Jun 2020 17:40:40 -0000 Author: glebius Date: Mon Jun 8 17:40:39 2020 New Revision: 361931 URL: https://svnweb.freebsd.org/changeset/base/361931 Log: Move MPASS() macros to systm.h. They are widely used all over the kernel and aren't contained only to the locking code. Reviewed by: kib, mjg Differential Revision: https://reviews.freebsd.org/D23656 Modified: head/sys/sys/lock.h head/sys/sys/systm.h Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Mon Jun 8 16:11:44 2020 (r361930) +++ head/sys/sys/lock.h Mon Jun 8 17:40:39 2020 (r361931) @@ -162,16 +162,6 @@ struct lock_class { #define lock_initialized(lo) ((lo)->lo_flags & LO_INITIALIZED) -/* - * Helpful macros for quickly coming up with assertions with informative - * panic messages. - */ -#define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) -#define MPASS2(ex, what) MPASS4(ex, what, __FILE__, __LINE__) -#define MPASS3(ex, file, line) MPASS4(ex, #ex, file, line) -#define MPASS4(ex, what, file, line) \ - KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) - extern struct lock_class lock_class_mtx_sleep; extern struct lock_class lock_class_mtx_spin; extern struct lock_class lock_class_sx; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Jun 8 16:11:44 2020 (r361930) +++ head/sys/sys/systm.h Mon Jun 8 17:40:39 2020 (r361931) @@ -142,6 +142,16 @@ void kassert_panic(const char *fmt, ...) __printflike #endif /* + * Helpful macros for quickly coming up with assertions with informative + * panic messages. + */ +#define MPASS(ex) MPASS4(ex, #ex, __FILE__, __LINE__) +#define MPASS2(ex, what) MPASS4(ex, what, __FILE__, __LINE__) +#define MPASS3(ex, file, line) MPASS4(ex, #ex, file, line) +#define MPASS4(ex, what, file, line) \ + KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line)) + +/* * Assert that a pointer can be loaded from memory atomically. * * This assertion enforces stronger alignment than necessary. For example,