From nobody Thu Jul 9 17:49:35 2026 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 4gx2Xc0crLz6kZxW for ; Thu, 09 Jul 2026 17:49:36 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gx2Xb3Kq2z3h5G for ; Thu, 09 Jul 2026 17:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783619375; 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=eBGypYxmM+PSLet6elB70oAXIi7hj8NjKrFVDUeUs3c=; b=Hwb2v5pCin9WNiYO9ulWXCVxfolsjQ9w2HG540kJhgH9iTrOiSvrjqt6Rwv8R1metCp0Cp uqgPBmr+wYTyKll3BaMtB4bXiAZe/J6AKaDCEjWwPm87JGDqt+Y/2Z5FW2aT24aisDR8xN eMD1LTzLIGPWTTNjdJAlQON8e+EanUXuylnlSqNS6h3QI7vD9DAeZNDutxWJ+or+SYuyT0 ZJbDwnTdJuyJY5GzUjzBTJ6yF70sIT7fboi2mUxBjTw6G5Rl60zva5Znf+ZGmg1C54N9IG B+2IgEJiN2dpIqeMHyJ7qs8WH7AkgTgwzk45xnW06nBsEEex2FRzwG0zBPt40g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783619375; a=rsa-sha256; cv=none; b=kFFN5Ufg+xtFDUjj5Q4lhEauYgpmxmdjzBn5g60uwFewS56f9H9qdwPLBHk7vSybvIpXCq fN1YbDLeV6EfpWqLFfu4tPBWpDK3Fla7VFthXIoSUd3CItFlbn0yK8hLiK/qJdDo3qS3Ec hkoRMNHlyPaRIg2veCISPlrx7mLfyhRWgSdYNj8pVT6XrK9kxrOIWIORYN9wsLx3496tDc 0Me6mxb4FbCG96OKPLQpjCdnTTPilc0eRXJcQ9EdWrvfpEWV10Ydoc6/W53dlqr38V3UIT DXBnRLtQc6eOpAP6MvPUl0AChnyE96WqguIxHeG7UvNuEzNqqdDaMvCF2y8iqw== 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=1783619375; 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=eBGypYxmM+PSLet6elB70oAXIi7hj8NjKrFVDUeUs3c=; b=GhK8ADQlYjKNzs+ZqfHbx6Ubf4nkt4DhPWBtzrTvnTm/k6GbJ3XXMePk+8x6d46DvU3kM0 wiM13eF8uh7rfn5KQmnhQ+xcYsv1NTvbJY2j2jrO4lZb4/B/K2vp+hsydDByBwSDCJIGii yk9tJ3w41E0mosoe1Mq+fTjhrEN7lRmCkDrb+DXh70bO1DL41M/UwP57zyv+gpG24ik9hf ElyLE6tXia68JwdD/mFEVMi1MsjhsfHFMxZU2JvSddnf3BMfLlkTSyQ5DivFkC/66hyRxb sNtcyBvFWncE2KUoPf/S2ZMQwonYVlaDj4B1EOGvA8HKG6Z1pAEcrpuoGLlV5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gx2Xb24Yxz3my for ; Thu, 09 Jul 2026 17:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40f2c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 09 Jul 2026 17:49:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 745c0ea79057 - stable/15 - stand/libofw: make OF_hasprop() part of the library 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 745c0ea7905789ab0ca1e3f143b7550ce5f7ea91 Auto-Submitted: auto-generated Date: Thu, 09 Jul 2026 17:49:35 +0000 Message-Id: <6a4fdf2f.40f2c.1adfc212@gitrepo.freebsd.org> The branch stable/15 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=745c0ea7905789ab0ca1e3f143b7550ce5f7ea91 commit 745c0ea7905789ab0ca1e3f143b7550ce5f7ea91 Author: Mitchell Horne AuthorDate: 2026-04-16 17:48:46 +0000 Commit: Mitchell Horne CommitDate: 2026-07-09 17:49:12 +0000 stand/libofw: make OF_hasprop() part of the library Currently it is only needed by powerpc ofwfdt.c, and defined statically there. Make it available as part of libofw, mirroring what we have in the kernel. Two small tweaks are made to the implementation: 1. Return type is changed to bool 2. Return 'true' when OF_getproplen() == 0. This matches the expected semantics of the kernel version, described in OF_hasprop(9). Reviewed by: manu, imp, adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56429 (cherry picked from commit 48a05f833c7d0c089d37522cc234039ec823edf4) --- stand/libofw/openfirm.c | 7 +++++++ stand/libofw/openfirm.h | 1 + stand/powerpc/ofw/ofwfdt.c | 6 ------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c index 1df65784e47a..ce4444262f6d 100644 --- a/stand/libofw/openfirm.c +++ b/stand/libofw/openfirm.c @@ -288,6 +288,13 @@ OF_getencprop(phandle_t package, const char *propname, cell_t *buf, int buflen) return (retval); } +/* Check existence of a property of a package. */ +bool +OF_hasprop(phandle_t node, const char *prop) +{ + return (OF_getproplen(node, prop) >= 0); +} + /* Get the next property of a package. */ int OF_nextprop(phandle_t package, const char *previous, char *buf) diff --git a/stand/libofw/openfirm.h b/stand/libofw/openfirm.h index 35d10c320b57..b4890762b0f9 100644 --- a/stand/libofw/openfirm.h +++ b/stand/libofw/openfirm.h @@ -89,6 +89,7 @@ phandle_t OF_instance_to_package(ihandle_t); int OF_getproplen(phandle_t, const char *); int OF_getprop(phandle_t, const char *, void *, int); int OF_getencprop(phandle_t, const char *, cell_t *, int); +bool OF_hasprop(phandle_t, const char *); int OF_nextprop(phandle_t, const char *, char *); int OF_setprop(phandle_t, const char *, void *, int); int OF_canon(const char *, char *, int); diff --git a/stand/powerpc/ofw/ofwfdt.c b/stand/powerpc/ofw/ofwfdt.c index eeb5f132a3f2..5422924a3b4c 100644 --- a/stand/powerpc/ofw/ofwfdt.c +++ b/stand/powerpc/ofw/ofwfdt.c @@ -32,12 +32,6 @@ extern int command_fdt_internal(int argc, char *argv[]); -static int -OF_hasprop(phandle_t node, const char *prop) -{ - return (OF_getproplen(node, (char *)prop) > 0); -} - static void add_node_to_fdt(void *buffer, phandle_t node, int fdt_offset) {