From nobody Wed Jun 12 19:16:46 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 4VzwJZ3WbRz5NHph; Wed, 12 Jun 2024 19:16:46 +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 4VzwJZ2RHVz56lh; Wed, 12 Jun 2024 19:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718219806; 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=a8/PceXyILzw4gwp94Bzr/dTJwjmreZ7TImLTIj8PyY=; b=CCZVwvI2u0GQEHhBJNgeL8+MU0rM+iyqSPCmOvP4OGClDq1jzuHmkipCWcLgIQaCt1sB0u 2iVoGRNffIieGms04wF57691yfNMEtDd1cl1fIooh0eeXFdm9kbCeEc5Jqvv61VNG/N28H tlai9sBOuX085rnbi7h/8MLenBZ2MbzoxkoWz9P35ZSk9PmC2Gv8Q65SbRQe3RB4vmsJmv LAvWawcqEwgxVaOhGw5yG0/OQ+IeYcIVbi2C6ePEPHaKnPNIXQ5/VODcP/I9l3iCmcPBhG 2A2ivhwfwCvsj6i5zKTIlUdCl/ESydhioyExqqI0ki/D1zEz94Q5h/BYFOsIAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718219806; a=rsa-sha256; cv=none; b=vlu6O7RfWZFH9ig/t24BGBwmzgmsQhnWQ5q/XyI3SdwE337lrCDUTySFRE35mgQVnzXB1O mGzVSNVov8EaJ8FDNzuTyor73oXwl+LEPmaEm8u6ZsgKDqyvwk2a/n57FFiMi4UKGIe+EH 58kGyTa1DEL5U3K9S8VpXYnHjV3AsCfsWk4zT8xonBSF0sFD4VNOcLCvVVJ825PtJIY9hW o5BCfQRCARaUNowZHtsKzYqW6pg0ZiNmG8OSCO3EGhQ66GPoxOunmSfIYArKWLsIqhwe9/ mAZEUHcZ12YdJU9CTBIoZ5otjy4ubtg0rFC56E+1ZMzMkcbrKA0oZKhAjZO5tA== 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=1718219806; 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=a8/PceXyILzw4gwp94Bzr/dTJwjmreZ7TImLTIj8PyY=; b=Qk4bAy6NXXT7JGhO9qWR5EcFpKlsPc1aMDSk+x3OfOuN5QNp1Xj/mq6xwU/4x+X26BodvL G3U7alCpQirZT1Btim9FBxICrHBUHjPuR7qFR2BA1St1wmyai7IWS0jqkEsq6BUDMDPqE2 Rxubcc4tQbi+ABeerdz9mqdiKIsYpsVIicRyWeWDI+tj/WopJfYAOq2fg7qLxld2ouhh9T 8mRDZQQOHgJEOUQwEWIKUwjLt5pYe7wVRqQSudrfmfHbT/ZW4mTAymB4Dwbz2HLxON8dq5 DI7F4aYCceVMs9JOPtqjZNO/WMwn4F0nQAo7zrieLYrdw9+1j0x4unTL9YQ8lA== 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 4VzwJZ23h1z1585; Wed, 12 Jun 2024 19:16:46 +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 45CJGkin003938; Wed, 12 Jun 2024 19:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CJGksL003935; Wed, 12 Jun 2024 19:16:46 GMT (envelope-from git) Date: Wed, 12 Jun 2024 19:16:46 GMT Message-Id: <202406121916.45CJGksL003935@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: 0f87cc98f926 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 0f87cc98f92691957a253b78a5b6fba5f1824ea9 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0f87cc98f92691957a253b78a5b6fba5f1824ea9 commit 0f87cc98f92691957a253b78a5b6fba5f1824ea9 Author: Bjoern A. Zeeb AuthorDate: 2024-04-02 09:41:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-06-12 16:57:46 +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 22300e73652d..94595b2e8c50 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -66,6 +66,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)