From nobody Mon Apr 22 19:44:07 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 4VNbKh0003z5Hm6M; Mon, 22 Apr 2024 19:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VNbKg4DRMz4mrr; Mon, 22 Apr 2024 19:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713815047; 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=ppR2YbIZP5GpxcmhQjfFh8/MCGnoGBRRYid2SEmN7Vk=; b=Fwbd5nwI3MID6SDX9ccdgTY7EhRjp2n6V+uw7dZlLmKVGLw8nqU0upLJmk41etP9PdxXMX Sukl/vSOJLMoeXiqAIQsuScWQFh8B0zZtV662sk8c5/PQjMRILyOPgagHwIqNFqVQq5YoA Lv7xF7KQgm9FfKfrl6rtcB3/5EFEc4E3WKFeXgo19gkE8Jwq75Ema86iexti125rfdF7b1 gRZt61+Bq5FFtOzaXKkJ+CysbpPmtwnmRxcnjWNgWTfYy2eOlXJTewg3r82QyntLZ0eWBM HUjPTBoqkkGghf46+jweuK1wRWvyQgnuFHWM/Kyvik49KuENQF8YPmAuKSggsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713815047; a=rsa-sha256; cv=none; b=dZPgaXkCHFRoYseXTdRtnfgS0srcSNVsCjAJS1Ly1PuGMuDBL6zykaekwIF82iKgmsMhSz rIaSiJ2zfTarFmIJkz7yNdnsUfelGYzutbWJj4I8cmV6uq9HP7+860JkjgLpoRCZ4EioNO KzyVqh10O6dsiscRfnCmrpgN+6AJTHsAl7Z5H4Zh7jwjIfLwTOAwGcS0EMmH0D+5+tcVbj IWBfP9m74UXQjw3CIHKxrg3U57WZPGvBwQcL+y5BCF3pQkXCyYL2QA4dKfVDy5xbBjHmbk CRPj5TjiCnjSQILTSID7EL2CGY8QQjQh7wFYT+ZvKlkBkbP16gk8G/FyYsUhTg== 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=1713815047; 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=ppR2YbIZP5GpxcmhQjfFh8/MCGnoGBRRYid2SEmN7Vk=; b=X+bsgTtvDdwp04lLi1Ss1q/nyRKEMT5g10AMWgmfIKy9IUHcxUAwvo7mboNBV9A0Awxy+B Gd3tJrS9a8wxyelp9WtWsjpOO9imxhsmc90Xg+9zEk94d2/v+mg+7IfEyICGHujXuxF3UH WdJTQ7nmqnZwLPB/iDKu3mHh4zdvlH2Wd2Mo8XIc4OoOidhtif34SpJThlLhzKiBVqRshP CgVydYDvhQJppLhI125BhBdYY1hfXb3RyOK1CLFpMyBMgQdnhaqDuaInlJEMBUIecsRTOH C6hcHd1AjnwNNIfoESoDaesWeFFU5277B4eVN73TiH0F5gtefQUZHFjrWAvDOA== 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 4VNbKg3q16z11tb; Mon, 22 Apr 2024 19:44:07 +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 43MJi757032480; Mon, 22 Apr 2024 19:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43MJi73e032477; Mon, 22 Apr 2024 19:44:07 GMT (envelope-from git) Date: Mon, 22 Apr 2024 19:44:07 GMT Message-Id: <202404221944.43MJi73e032477@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: 6290fe776c74 - stable/14 - LinuxKPI: add __counted_by() and __nonstring 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/14 X-Git-Reftype: branch X-Git-Commit: 6290fe776c74297eb6fd14bee08a31b17a6a54b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6290fe776c74297eb6fd14bee08a31b17a6a54b2 commit 6290fe776c74297eb6fd14bee08a31b17a6a54b2 Author: Bjoern A. Zeeb AuthorDate: 2024-04-02 09:41:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-04-22 17:00:48 +0000 LinuxKPI: add __counted_by() and __nonstring Add checks for __counted_by(_x) and __nonstring as and depending on compiler support enable the attribute/feature. This is needed to make mtk76 and ath1xk drivers compile. Sposnored by: The FreeBSD Foundation Reviewed by: emaste, dim Differential Revision: https://reviews.freebsd.org/D44587 (cherry picked from commit 2a8c50592f7fce8bceedf004f674a5a9eae0fd46) --- sys/compat/linuxkpi/common/include/linux/compiler.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 97687ccdc7e1..59c7d3cc04e7 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -67,6 +67,17 @@ #define ____cacheline_aligned_in_smp __aligned(CACHE_LINE_SIZE) #define fallthrough /* FALLTHROUGH */ do { } while(0) +#if __has_attribute(__nonstring__) +#define __nonstring __attribute__((__nonstring__)) +#else +#define __nonstring +#endif +#if __has_attribute(__counted_by__) +#define __counted_by(_x) __attribute__((__counted_by__(_x))) +#else +#define __counted_by(_x) +#endif + #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #define typeof(x) __typeof(x)