From nobody Thu Oct 23 09:44:02 2025 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 4csh1t2BW0z6D1JT; Thu, 23 Oct 2025 09:44:02 +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 4csh1t1Z2dz3dm6; Thu, 23 Oct 2025 09:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761212642; 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=sjjBdd3sXKoriEpKxAqgTYal2jvVfmJ810w1ysoBbzc=; b=aRVuZz0DDv0/6TByMnAB3nk3YyNaA5bWYQqbu5/bSauVxoddH8kdivVl5co3E6KTdNDgCc eo5LEp4/tvXsgFlZPmCWITGDmKK9fc/danhBygcPUY5m+h/7/kObMOynoYGZ5Mecupl3a+ IVLubv8E03pjjq2ViW3AtpKFBtO7Le+JDQyKR2Z5RSKFJS8JjEiS6YwdabTKkC4yaxuzni CrhF0ooKPXfGAgF32GpDFE/BQsSly5K3Iesh8jRT4r23I3LtM1opYid7etJAiuR0c1CYHM dyWEGKY4zo3LxmRrXCsj2PNFZzRiPfZ8MIPX1y2m3FHtmMDItVEl6q1xA29LDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1761212642; 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=sjjBdd3sXKoriEpKxAqgTYal2jvVfmJ810w1ysoBbzc=; b=seetlGDJF0aaKts7NJMRtCHzZ4oDint5MXDJvj9t4ItJSunoal6qwY/eDUyg7ZAa3ZgJQg YKSdWpRezHKizfHvbzmgEK/Y751cRmT2DW0NWinfZoyFI0UTrDJhWOzZx8LHokKTFB311V N4WUFniAtho7uZC06K2CPvVcoUhdVy+oeHTpH5KL3kwMh1nQ8PVb0y/4yNcal52NK/NlVa zyHMaDrajW32zO+FlvxanxJ74HH3VMPVxD98Y6N1227OX3HmnjpYGWxOK+UYFHvitYB+b0 Pl5n2+jKR5M7aOqB59QJOTr/9qOD+ecJ8bOGOIZZi0VGgBmFuYbNyNarjlyJRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1761212642; a=rsa-sha256; cv=none; b=MkLuUqJWxHwRPp6ng3YLSSgFciILtswwg8yZ1ZgDPuIMIiAszyZodGKepRXU380ojgWDOZ 8QRfcldrOWbkN/bMtV9iooLMqO6kIXl4ioi4WWa84u9hlUtr4NoOI2q1c7Eg4CviTjutRS 51y+sneFw8tDsdfiw7SNPaBrEi6E5R+r6PFvDvUdshiIKKsYYL3wHT39ELThZpX1Nuza8c kzN/EJyoIad2j8V6mWUrqtQgznV5dQQtYYYvnp3AFrzYx0MwzH7nwyGCucYcOkZu+wZeg8 CP+v8qcySw3DyW4kBpiMraeI6/r+5o7pgPI3GN+xDsD/egId9cdBXI2x89Ecmw== 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 4csh1t18GXz18bD; Thu, 23 Oct 2025 09:44:02 +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 59N9i2p8059955; Thu, 23 Oct 2025 09:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59N9i2O4059949; Thu, 23 Oct 2025 09:44:02 GMT (envelope-from git) Date: Thu, 23 Oct 2025 09:44:02 GMT Message-Id: <202510230944.59N9i2O4059949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0e30cab0f32e - stable/15 - LinuxKPI: add __counted_by_le() and __counted_by_be() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/15 X-Git-Reftype: branch X-Git-Commit: 0e30cab0f32ee40e89f59b3a287ae96c084e1e7a Auto-Submitted: auto-generated The branch stable/15 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0e30cab0f32ee40e89f59b3a287ae96c084e1e7a commit 0e30cab0f32ee40e89f59b3a287ae96c084e1e7a Author: Bjoern A. Zeeb AuthorDate: 2025-10-11 09:22:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-10-23 06:34:47 +0000 LinuxKPI: add __counted_by_le() and __counted_by_be() The former is needed by a wireless driver at v6.17. Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D53203 (cherry picked from commit 0a4b11ddb298fa08e1a81af7337995a3769552bf) --- 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)