From nobody Mon Jan 29 19:03:10 2024 X-Original-To: dev-commits-src-all@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 4TNyPB3N0Sz59Df4; Mon, 29 Jan 2024 19:03:10 +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 4TNyPB29fxz40S1; Mon, 29 Jan 2024 19:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554990; 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=bkWjXQDdafi9NfUJrN2iyxUvgHiKdbLNtMQtX0YgVis=; b=SlIluaJQToGeGZyOapTl0SHHVKslQ3UHDBwA3oKpRaLnCq6CQSstY4g2VAwVusQqJlODF7 dAV8+x24ad6rZk8OyrrHuapvjXa6RmFUksCz26N1e0ELXQc0CqPAsY6N8C9kSWGcI5Lc+9 Qwsg8WNz8whe95umlPGpMv7XHnb17jMrwcqxum5v8mxNevzDA44WjzbQ9dlvjjrJ8o72zp D0HiVw447s3fwP0k1505i0GOEXUF88fNl4N4LMDXsl+rqnzkiIyLm4dgyn4Sb1RWNR7W9F z7rrSvOH4jktyH3WCrcEElM/q7iCO3MA/+v/1eUsoPDtfbmnMjWs8la0+1gypQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706554990; 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=bkWjXQDdafi9NfUJrN2iyxUvgHiKdbLNtMQtX0YgVis=; b=Y09kN5hR5sY/qhWsEGyqPLViyj8xlWFf3T501ZwMKtvNfSKIrHarpDaJdRXCjZwvudmeU6 K53zhejKGnAf+B6codgQ5N4nAzNHRYG2y1QPkwUm7jaPPZv0ZjW6XQhi/wLYRO7QMsjV6Y 6edCj4OEvSB2Q6i0osrhe34Pql6NCGo6D5a4ICwdosUlF6K7xmLcNu0Sjpd/pEVh4+RciE uGmWRaOls9ga7E3xmY8KheXlKnF2E3ZXMaBIyTGnYXt4ssQL2KvqhowxHuehZYGONDdRef pIVdyKPJuNI3CAe3CIMQWhCiEHkwVOCdcoH97GXwN0liMpQV1h4olhW1PtLbQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706554990; a=rsa-sha256; cv=none; b=IiRWnouCNd683s+zpEn/tpULRcR48EfjP6kqjdIypOl7/+0kIZkvaK8vJ8pVu4GB7v++GP 627XFbLcl13xvCXzqDCt1YISnBPloQYM2Cwy0tL6LfAUXXdm7vmXJIWrNGTEqrNZPc9EfK PDAOHDrOit/eAabLcZeQNzQPyXzfXHJmcksWH4E0CvVCnvGKN3n/o2WiKn/qhFSLmCWK3I Uhdi5Q766dEtjjdTUI9yYv8ORympak4HchV4jteQbdM4xxUUi1hXV0atRzVaIVk3riQoBE lcICjglNPP5Ghx9SF1nTeKhKR015Fsv2lIuyfhED22ug0hWfEYMjYKPvXbB4ww== 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 4TNyPB18g0z13HS; Mon, 29 Jan 2024 19:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40TJ3ABk058809; Mon, 29 Jan 2024 19:03:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TJ3Ao5058806; Mon, 29 Jan 2024 19:03:10 GMT (envelope-from git) Date: Mon, 29 Jan 2024 19:03:10 GMT Message-Id: <202401291903.40TJ3Ao5058806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3a477a9b70a3 - main - nvme: Add NVMEF helper macro as the inverse of NVMEV List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a477a9b70a34dc0686630599c27f022b1e07bd8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3a477a9b70a34dc0686630599c27f022b1e07bd8 commit 3a477a9b70a34dc0686630599c27f022b1e07bd8 Author: John Baldwin AuthorDate: 2024-01-29 19:00:57 +0000 Commit: John Baldwin CommitDate: 2024-01-29 19:00:57 +0000 nvme: Add NVMEF helper macro as the inverse of NVMEV This macro accepts a field name and a value for the field and constructs the shifted field value. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D43604 --- sys/dev/nvme/nvme.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 2c36d0813253..004fa1e9d1ca 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -610,6 +610,9 @@ enum nvme_critical_warning_state { /* Helper macro to extract value from x */ #define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK) +/* Helper macro to construct a field value */ +#define NVMEF(name, x) (((x) & name##_MASK) << name##_SHIFT) + /* CC register SHN field values */ enum shn_value { NVME_SHN_NORMAL = 0x1,