From nobody Wed Apr 17 08:13:43 2024 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 4VKDFM3rRXz5J6wj; Wed, 17 Apr 2024 08:13:43 +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 4VKDFM2KCsz49dT; Wed, 17 Apr 2024 08:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713341623; 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=fcOmb+4jpd1fByhNt4dTtAFtjOvmpOHt9SSbYFZH7QE=; b=wpCAMKBnflFOIOFZjmwVcHtXzH7qZv3oplhNfiN0t71JVcb3fSYTGlYtam0XlCrbUaPEbK fcvPlGx2qnPA0hKnUZk1nEOgx0jjZqgPTAHcHuyjwaUzrWIXB/bUmorttmu1COhAGZ5Puo 5+FIwlWwpynJQj3+8jFAasdpjj13LSG7OsdGk8sSHX7F2JhEBhdY8mlpgwbPbTQTPqUYSt vH1coYxj/AjvLx34uTlhBAVLKapQlGxJTg/eEIgE0moE6WkoQ4W2SX1P0o8o7Vyafrad/A Cq2PxkYrQncinZHMLAvGJAi71gt1yGvlJpcewBbAv5eXPTcp0iRJY+a3YxjUOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713341623; a=rsa-sha256; cv=none; b=V7KpIQJKvy1QT0ya6rwjjtTAw1k+6WTCLr/5G+askHjmQQ/oEj+hVeNY3QpaPsQuzfygjB 9TBkZaSkQCbn50KLkTa+O5ovPCyPeQ5Faydw0MFRMEzHy2TXgUk0eAJ+194ZbepNUda6pU tCrD4RD31pTs7ojkvsGlWqLhun4Xt5ynnJPSpOYh7NN3KKJQD5/V68Ki7zAkxE4c4lYBga GUb/qma0gU0NysbAUk6DLmvkx2P0PbbG4ZvHIPVzHOFIMO7qANFjH7QG4pR+i9+yqiEDmJ phomgHZJwZK7wiVEFXxAeeIXIYybuz/fzs+tVIHE1FiSlLOoXMX3hLcwekXuiQ== 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=1713341623; 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=fcOmb+4jpd1fByhNt4dTtAFtjOvmpOHt9SSbYFZH7QE=; b=cg5ey/U6eWZ3lQKFfL/U7TtAqURa1yUKzaN7T7JuX4wJpnii5OZuHX5qpfz8g/aKU+H+3l CET6yG5bOQ4CbEJm3FyTvB3aecCoBp3f2PmGFwRlS++4qDeWOCbnmpAt7SASbNQ2FXWRPL fC9Trly5j6X8LKppjxWiK2UA33uueQeCnmkYFt7TAlIZBSsKoKHUMCjWTUQT1dZsdm6Abn X0yyrt07MnM8kdy2E60OL5w1Sffp5JOiZieeD6FgzdgI/5XPX+9C91h/1Rg4j9KyJ3wL4G Nb+sfmTl691tq/njecvlQyN5B36MukdA9b68Vj49PC4Vki8Dq28QUxV2XEkNyg== 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 4VKDFM1vx3zJhm; Wed, 17 Apr 2024 08:13: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 43H8DhKT062405; Wed, 17 Apr 2024 08:13:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43H8Dh0g062402; Wed, 17 Apr 2024 08:13:43 GMT (envelope-from git) Date: Wed, 17 Apr 2024 08:13:43 GMT Message-Id: <202404170813.43H8Dh0g062402@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: f7fd7f8b88a1 - stable/13 - acpidump: add printfield() helper 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f7fd7f8b88a15cd70e8d5b471264875d006fcd39 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f7fd7f8b88a15cd70e8d5b471264875d006fcd39 commit f7fd7f8b88a15cd70e8d5b471264875d006fcd39 Author: Konstantin Belousov AuthorDate: 2024-04-04 04:49:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-17 08:13:18 +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 5005c4bbe630..ec7bd65b14c9 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) {