From nobody Fri Apr 12 01:18:43 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 4VFzGr1607z5GX1r; Fri, 12 Apr 2024 01:18:44 +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 4VFzGr0HN3z4QMK; Fri, 12 Apr 2024 01:18:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884724; 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=bfL8bqZDq2aHW1t1w/4nfmqxFlqA7WhR4c06WUEmc3Y=; b=YIDC645FTKKjKs0UcIBErNfG2ZO08BLCIZJokGe0MMhcL51H6X/ceK7+vHYFEeOSqDKUzy vkpvCqw0Gt0J24Y9A397ZLspyxpoBVqqtmMAC0NJ2l2d1FuPeTDMzI5vLA3ULj6AffhKTU EEIta54BVZ7kwSGVYxbqp+1wB+k9MHkyoUh7fAjIsCUumjv2E/zaanWOt4KVzueqQk7TrX Dd1vHYfeK2ZPOLUCOGmCmirs5eWWJWRaDI9TPNmQ0/ai1sGaSIJnCSSlvuaUCThGAIhRnC F9HhaQhap43+3GuvzmnDaDLCHOedJ8oXYG9osCdilOPWfUEkjGkKPDjc5/HuGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712884724; a=rsa-sha256; cv=none; b=nqdGRK1H/SVYDe2FE3BQstnlUprEGd/6plyNtExrEF6ICwqcWGFCr3/MNWkbEHmGT0TC59 JhR7BUrU8vS+M7oSzkMBy4QFa7aeXSJoEsuOy8N9JQmD6lL/3KlKs51DPClz4BGZOxlANA eSErNHtWJNVXwTqHbx1u/C+yhBOwWT12rp99kU9sbGPBYnnYwX2o7ZpfMP72yRbjQ63EFm 2UWHYzh7e+A0NRBciwWXl1JvVErbNEo5QwfEMOXFVaBO+FVVkxevOqFh3vbYBvsKEMB438 VMTdrFr+9cbPG2/RKEhwDSp+WtTErl/TUv2JlpM+XjS2AwLLxzgfL3nD9pNLDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712884724; 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=bfL8bqZDq2aHW1t1w/4nfmqxFlqA7WhR4c06WUEmc3Y=; b=TbpQak9D/Ef40jSbz0iOhc6F4UxrJW06CO8u6YjU69u87Oo6TXEmMyV5otIby2DzmG0ZL2 gJAO/RcPPCuGoeK86U3k8MsrdkvyY6seHUjfdXrrP9C54CDoRLN1PNDTksFZ0zjyJipd8l gIYhXyLvFx78fQFbhlblEDDi3hU/OiGLRqJ7DLpm7vSmugc/iE7sTwg82Bp3tAjglzzbXK czqGKpxPYFbs5jCs9qs/D19RV5ZwusR+XURq+LpFV4KALsHix8t25I3KQnBj3ygN7WKOPs GSHjvJRUyCkmrWSHAdaZLgeh5Hq4j1lmTJcsJV3a4u1Wrv77aOjsrOwXsLqMnw== 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 4VFzGq6xXczT0h; Fri, 12 Apr 2024 01:18:43 +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 43C1IhZV050377; Fri, 12 Apr 2024 01:18:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C1IhFL050374; Fri, 12 Apr 2024 01:18:43 GMT (envelope-from git) Date: Fri, 12 Apr 2024 01:18:43 GMT Message-Id: <202404120118.43C1IhFL050374@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: 9ab216e2646a - stable/14 - acpidump: add printfield() helper 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: dev-commits-src-all+owner@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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9ab216e2646a52caeacc56d763877ca866e167c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab216e2646a52caeacc56d763877ca866e167c3 commit 9ab216e2646a52caeacc56d763877ca866e167c3 Author: Konstantin Belousov AuthorDate: 2024-04-04 04:49:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-12 01:18:32 +0000 acpidump: add printfield() helper (cherry picked from commit 969a4b8be5a7d8edf55bd8945a5a071f57386b0e) --- usr.sbin/acpi/acpidump/acpi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 9875a4798085..391310b44c7c 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -156,6 +156,18 @@ printflag(uint64_t var, uint64_t mask, const char *name) } } +static void +printfield(uint64_t var, int lbit, int hbit, const char *name) +{ + uint64_t mask; + int len; + + len = hbit - lbit + 1; + mask = ((1 << (len + 1)) - 1) << lbit; + printf("%c%s=%#jx", pf_sep, name, (uintmax_t)((var & mask) >> lbit)); + pf_sep = ','; +} + static void acpi_print_string(char *s, size_t length) {