From nobody Wed Jul 06 12:33:50 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1D21F1D100FC; Wed, 6 Jul 2022 12:33:51 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LdJqz02lgz3tLB; Wed, 6 Jul 2022 12:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657110831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dng5Wg7H1QqZHXYz5uhJOU70ybS7F1dX9V3mSz2PVnw=; b=RquSafjgnfMJ5j41gzl+GhFzQbPYrJQi/lzwwGgzGhVOyfJ52M5HsPWzCn0Y5TlbfLSO0l Pt6+4QabWo/nyFlbmpCBLG7KMB3TBClpVN05NflNlpLsah/+D0TPo8N9aRMmsO6kvVeMap zRL2FPliSFxxVK3/zLmV1B/k52fhPHnXhfdEfc9vDf9O4zFibVpYySC2YaU5kyP4jm41+x VkEM2QLGaWCeRj2Pj9mvbRuTIhCBkk/6RvYewvnp8KbF3CKXXDxwUqyZXhXdbkzZid/Cqx XhdkrTQpcj/UUtyjnN0iZEgFBa/vUTPurEn4e+3ACxq0IaVuJ7qHL9vlmI7Ymw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9CE51A45D; Wed, 6 Jul 2022 12:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 266CXo8A017873; Wed, 6 Jul 2022 12:33:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 266CXo6J017872; Wed, 6 Jul 2022 12:33:50 GMT (envelope-from git) Date: Wed, 6 Jul 2022 12:33:50 GMT Message-Id: <202207061233.266CXo6J017872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8ddf0f738c5f - stable/13 - Add MPASSERT() and MPPASS() macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ddf0f738c5f0b3477059b2c3897478ce7462476 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657110831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dng5Wg7H1QqZHXYz5uhJOU70ybS7F1dX9V3mSz2PVnw=; b=OwwHZZUP5uNcrDbuM4fEHFWXd4YtRdpVS/VpvBaP4b+snjRGrVXR0/j8w6XLDfehGAnox6 gL8pIaPoZldcl0hOgceteGLv1KO8R1DRFtHZcx7SvDhClUJjtaU0aUXnwWDIAoGimSQsbl 69EZf7hYHc60v3V+Fachb3jbDU7SIS5ypqytWvvls1RiENbj110O4ZNc+Ywoq9dYSlXLBq 2cPi9PTGTi0szelhovSP9FU1YqXhUtYbff+4aYaNewAM/Omu3halsdnmD1nwlNHaNMA23A y+WZr1AUyMCmCB6uW0JTf6FhLTF088PawjGFQhQs4Gof4BgiqO2x6OgtiD4khw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657110831; a=rsa-sha256; cv=none; b=PDTS8eUum5IPlhzoG2MiapQQ2C+nsVyq5AEiSbCSru9UtxuBVrkEv/aWGi2bq5Ba2Xe51m pH0Imxr3ejrv2uWo+sf9gjqBqf/2nccK/abk+JfP3J4eQYTD/J3inTDuvWYHEhR6p1dwz5 CIbFWVl99HvGFi3ox7UZHuwJ5goLT+iuEwzOdZlLX8tPTnuntzkH5hMwVKaSfFSUpwgKHb nBpBwu0/X5qutCDTtcu/8fo/7ZDs3DeTfr8R4wPCLxsdNDCzBDXQm6zA/3Dg490Nd+Bg0R wb73cxLhii0njceMfJ5tM8Yy035B1+Jk9v04geqkrRYwy+hczZuIO8ytDe2rlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ddf0f738c5f0b3477059b2c3897478ce7462476 commit 8ddf0f738c5f0b3477059b2c3897478ce7462476 Author: Konstantin Belousov AuthorDate: 2022-06-29 11:37:04 +0000 Commit: Konstantin Belousov CommitDate: 2022-07-06 12:33:30 +0000 Add MPASSERT() and MPPASS() macros (cherry picked from commit 61ae7a355ce787aecd84dc35a047f458a5b5b1fb) --- sys/sys/kassert.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index bb6847dc404f..d7c1a21385f9 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -46,19 +46,35 @@ extern bool panicked; kassert_panic msg; \ } \ } while (0) +#define MPASSERT(exp, mp, msg) do { \ + if (__predict_false(!(exp))) { \ + printf("MPASSERT mp %p failed: %s not true at %s:%d (%s)\n",\ + (mp), #exp, __FILE__, __LINE__, __func__); \ + kassert_panic msg; \ + } \ +} while (0) #define VNPASS(exp, vp) do { \ const char *_exp = #exp; \ VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ _exp, __FILE__, __LINE__, __func__)); \ } while (0) +#define MPPASS(exp, mp) do { \ + const char *_exp = #exp; \ + MPASSERT(exp, mp, ("condition %s not met at %s:%d (%s)", \ + _exp, __FILE__, __LINE__, __func__)); \ +} while (0) #define __assert_unreachable() \ panic("executing segment marked as unreachable at %s:%d (%s)\n", \ __FILE__, __LINE__, __func__) #else /* INVARIANTS */ #define VNASSERT(exp, vp, msg) do { \ } while (0) +#define MPASSERT(exp, mp, msg) do { \ +} while (0) #define VNPASS(exp, vp) do { \ } while (0) +#define MPPASS(exp, mp) do { \ +} while (0) #define __assert_unreachable() __unreachable() #endif /* INVARIANTS */