From nobody Fri Apr 05 15:18:05 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 4VB2DY5bFpz5Gdwt; Fri, 5 Apr 2024 15:18:05 +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 4VB2DY34TTz4LZC; Fri, 5 Apr 2024 15:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712330285; 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=02BQRER3mK4QfJoK8dYfroOaIDam1nCy15Be/oLGiHU=; b=EciU5nfGTuN+xgO9wmxV1unNZBbHysL6r6JeaNZ+qz6ES6UZrDq3wv0AM8wDITKBjmUsVO Y+0ExyUIDZ6qZBe4hg9XTMk4HCOOMSzOgFIs1SnSZtIXwDYD/lUhJ7u/rySrYz9DDR17TA MahQyTeLCJaVBMRNm6l3y3KHuulDmhRdPiRfuXOe4uobwsWUjc5BY2QCQ8L3CTP/0KABxD FExpkS30ztLowqtkNYogTrWIZhmpknkBnuWddwqOno/PY0YU6JwHpFBlgRuzGFmxMV/ghg v39SWl6KpxOy8epvZBUtmu4nSwmVuRkD6C4OAu9585dONG7C8hi2ZsQjf5BbMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712330285; a=rsa-sha256; cv=none; b=MB/twNH/J+qagg/na5WL3HBkxwME76Y1XaiEdBC/z5PvVO2dr8vIPA6LTvWH8mfl3vAAwd ImY2fkhD2Ipoir2m07oOp1lcxU9/2rmqa+ELIx/v+bInkefqbsZ8Z81yWvKGRYNUT/kW27 dolCiqZ2IZxuTRER/DGtdnaYw+V2YgS26YF243glrE5fc7ZjOKCQRlh7Z+V8t4YkzkPOfP IjyygaGi2tdtfik3Dz/Pdub+A7EkDvUoGANkaCE29CGYV0e9NwPj6rqMKfQezHa66/QtCU KS2JQFzzZJWEOq+ATyVGIaILB/OzcCQcUgGAiutbd0MlOfpIqVC+Q7cTPNz9wQ== 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=1712330285; 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=02BQRER3mK4QfJoK8dYfroOaIDam1nCy15Be/oLGiHU=; b=qxROR86mxOx2/7SWbnrqftvpnH/kkhjwoSKqojazYYX9yxv03mu4td4wfiSwbhZiIiSOnZ JKBJhmQyoH5g4L5qAuMRnW4H17TkcKS0NM5IQfdtaGOHpAiyWrC1JvD6ItxJhmwht9rKJK 3xHYwTMqKS2HMDAJrJNA85O0av34Oimr+O8vg5LoLEi7tGH58yHX4GsEUmQwkfd9q4HcQk IxhleOv+rzk4mi1YUBehK1Qfn7/dnhsi1V9B1ttKv0TxAbtVjtbsGXwE5GftGLkQ0Sfc3O jbP928eKDkf9V6pWTf7SUUXTgToA4doXnpnn3EvaxNogx9KQGDR+n5TuWgT/eA== 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 4VB2DY2hgwz14nf; Fri, 5 Apr 2024 15:18:05 +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 435FI5lI078369; Fri, 5 Apr 2024 15:18:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435FI5ID078366; Fri, 5 Apr 2024 15:18:05 GMT (envelope-from git) Date: Fri, 5 Apr 2024 15:18:05 GMT Message-Id: <202404051518.435FI5ID078366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 969a4b8be5a7 - main - 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: 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 969a4b8be5a7d8edf55bd8945a5a071f57386b0e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=969a4b8be5a7d8edf55bd8945a5a071f57386b0e commit 969a4b8be5a7d8edf55bd8945a5a071f57386b0e Author: Konstantin Belousov AuthorDate: 2024-04-04 04:49:21 +0000 Commit: Konstantin Belousov CommitDate: 2024-04-05 15:17:55 +0000 acpidump: add printfield() helper Reviewed by: markj Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44634 --- 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 e3190fa98ad4..322fcaed2dc0 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) {