From nobody Tue Oct 21 07:53:07 2025 X-Original-To: dev-commits-src-main@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 4crPfq4dtlz6F3V3; Tue, 21 Oct 2025 07:53:07 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4crPfq33fNz3mS5; Tue, 21 Oct 2025 07:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761033187; 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=33bGpX8jwkJWEh64RMLwvonnifsKPnl0DGY7umJqyK8=; b=nTQT3izzoR5Nn0Luqp8kCdiFna6VxOvJZcXq4IwTrERVfjGU3WLtknbetSP3IfvE6bSrZh t/l/YEug8u4aoksGhSeGHqMkK4xUNMMCtDkH9jimJXJH9DrggCd1LKJWuPMb1iAHCWfVzM sEAtEFqnGL5F7GPhNBchsMcB8zbYksPiSmPHqBikqzTFVki47gwsu6Dds1KOrShihoP21E QPywDKftqwHOqPoEm+AGZdu+Yane48WornaurlLgwyamjOaz4PP1WF3qsUvhByHif4nM3s lVPcbc6vPhcpjwPysxe8e4gZrqbiUD+wUYusQN97Z5H7HNNa7XQwjMEkqMHinw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761033187; 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=33bGpX8jwkJWEh64RMLwvonnifsKPnl0DGY7umJqyK8=; b=Iq/89DccOKq2rDfhW11taJNI2zuqzmif8Ih3FjkH3A5hAVNETgdYVrxBe880z+OAyL4bAg GIAhqX+H3zUkYcTXrH4SDadCMNHy9EMiCJoiNHVi8YNQWGIsz1mb02vkBv7hjuHKkPcmEM JVcJeQA85/Ov7h3feAk7ul+cqadw9VBk5d2/zK/8UXff5IMlV89NfdPQSe5S4OojuqH9kp 4KhsMy2964gQ/iXQOFPjI+oF7p9jaMWhBe5xAueWflCfkjdXJzYvN1k1PaO+ZKJO1aVAEc ENFs9sENuADyz6Iwx3cIUPnxQ1zz/6vBbWf+jDh2qrrfhwXiR682g4RxucAcuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761033187; a=rsa-sha256; cv=none; b=OCJopl1h/J+4Hv6R+zsGC1OpkuTCIsoFFYxGfqTY+2hdWD0bbn/JLVqZz1JpZJiZp/009j cLTkx9dnPJC/UgoTnAYHw3KFV3fSK+todHnY0p/sfZb1CuEuk/0jY+sBTQ79/xaankOVWP o3HK6xhLe+1ZpruBjzKdhoAk70AK0TbyRMN34lI6DmI+tOQ9/Wt8Ua6lhcn5T0MTIpZDCU FpOvnoThYBYVCRRpmHyOQFSckqOs0I+IAuIHDRRx2j4p6DDAvYZohfNU8BqbQltNLRzZIh Jt1eXG+5IBcPcfjVVKPOzFFO0cgzA0w4i2eSr+poKVIvUYYWnDtvoM6FlPB5dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4crPfq2dcYzrQP; Tue, 21 Oct 2025 07:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59L7r7Hq014338; Tue, 21 Oct 2025 07:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59L7r7dG014335; Tue, 21 Oct 2025 07:53:07 GMT (envelope-from git) Date: Tue, 21 Oct 2025 07:53:07 GMT Message-Id: <202510210753.59L7r7dG014335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0a4b11ddb298 - main - LinuxKPI: add __counted_by_le() and __counted_by_be() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a4b11ddb298fa08e1a81af7337995a3769552bf Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0a4b11ddb298fa08e1a81af7337995a3769552bf commit 0a4b11ddb298fa08e1a81af7337995a3769552bf Author: Bjoern A. Zeeb AuthorDate: 2025-10-11 09:22:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-10-21 07:49:38 +0000 LinuxKPI: add __counted_by_le() and __counted_by_be() The former is needed by a wireless driver at v6.17. MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D53203 --- sys/compat/linuxkpi/common/include/linux/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 948396144ad6..4146c829b936 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -31,6 +31,7 @@ #define _LINUXKPI_LINUX_COMPILER_H_ #include +#include #define __user #define __kernel @@ -79,6 +80,13 @@ #else #define __counted_by(_x) #endif +#if BYTE_ORDER == LITTLE_ENDIAN +#define __counted_by_le(_x) __counted_by(_x) +#define __counted_by_be(_x) +#else +#define __counted_by_le(_x) +#define __counted_by_be(_x) __counted_by(_x) +#endif #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0)