From nobody Thu Feb 16 11:56:23 2023 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 4PHYLx3wqDz3q5sW; Thu, 16 Feb 2023 11:56:25 +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 4PHYLw4gq3z4B1L; Thu, 16 Feb 2023 11:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548584; 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=XvDusA3jIXb7R593WcWgbTh0Zt1fCDJ/VqSWEKdpLj0=; b=GXodLvh1hFyVN9OrvG7kxMcQAqBU071o7gfnaCwGW8qEvVDrXyIg2iA/64AbkeGqhontQz mHcct71Jpd/7CWUd90BWHvKjc2s8PZkIWQI+ZHOoHGSsvN505CHqXg6fvQeolWb0ha5/IN DosOcxYGRq+6PuefazwEuk5grLiKY84gmvFyMklER2xD1bBBq/JmmUc66dIqveqxmEq/4k QdkNbNHhnRl9QRT3N8oSc64+CEHbq1/4egs5aZYgi2lugqWc8MYibqELZgBUFb22Ota/vH fo9pz8xwcyWAgdFtR+4iDmb27m1R32iUWN2n355HuPqbarcMT9Jil5ARx/l8cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548584; 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=XvDusA3jIXb7R593WcWgbTh0Zt1fCDJ/VqSWEKdpLj0=; b=Ws8IJKM+xXcQ0zG/ilU2z8LLik5sIbBw88lumPVQChAuGZVjmcbPGNNrHXBt99v215H+rV +4H4W/jI557iX/PypqP5tguvY2XmW0y6TWU0T+3nx7D8yhFubly/2Yvrs+Gl+zPLoL7Npb gsi04Z9yhLyOpMp/UZ25WHWZdAx/K5+ELNi1yI+TybwH7STFb96+xyjsIe3uLjwCLg2cOL KaWyzb11lN7FRrCBeNBllBp/s6EP4CAP5akVQz5BY1rlfgjAzGt1J1LMsFP/Eo97hYLiJr lNgZxT0ThBw6j2yh9qmTmDK5ZnNnL0bHxr/qXGk6wbapvq1x8Olyrl7LiukAsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548584; a=rsa-sha256; cv=none; b=sr3rQyf/O93HnGqxa+2ISiN0nchvFlhSfSFnhfA7sB39KGQVxA4KCVjbu1mDN21nBzf+u8 MPt9gFJygy3hdBXsYtAUzJFGs5OMgPx8+H4Mbb1Sp0nEB5yUKm1UkSxz7AH64qBIBqbpNL mZRv5/nxhGMoOwo4zzj7tcYirVMmoW3PrUKcEEYO4qyUN4qPpDuV5Ufma1cNzL8110tmRn fO5AW9e07yUSdMBdXdpG/m8qRwICRGq3pcWhS7WZcEiW9P4JwGKzfBPeTtCayroV4hvFxO R4zO8CBfs6zISnq5T/nSUlYlIeVKLpeomm9egzLpslQ2HUgHNW9EUrWlIhD+tw== 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 4PHYLw1Cbxz12tk; Thu, 16 Feb 2023 11:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31GBuNXO056086; Thu, 16 Feb 2023 11:56:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBuNXN056085; Thu, 16 Feb 2023 11:56:23 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:56:23 GMT Message-Id: <202302161156.31GBuNXN056085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 313d438a20d1 - stable/13 - linuxkpi: Define `xa_is_err()`, `xa_{store,erase}_irq()` and `xa_{,un}lock_irq*()` 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 313d438a20d1e9ed527f0a8ac095f81b8ba43250 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=313d438a20d1e9ed527f0a8ac095f81b8ba43250 commit 313d438a20d1e9ed527f0a8ac095f81b8ba43250 Author: Jean-Sébastien Pédron AuthorDate: 2023-02-08 17:55:29 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:19 +0000 linuxkpi: Define `xa_is_err()`, `xa_{store,erase}_irq()` and `xa_{,un}lock_irq*()` `xa_is_err()` is synonymous to `IS_ERR()`. Other introduced functions call their equivalent without the `irq*` suffix. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38534 (cherry picked from commit 5542309ec6eba3af9e26c50acd654de462181b8e) --- sys/compat/linuxkpi/common/include/linux/xarray.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/xarray.h b/sys/compat/linuxkpi/common/include/linux/xarray.h index 408906867479..8a9d8fa3ea41 100644 --- a/sys/compat/linuxkpi/common/include/linux/xarray.h +++ b/sys/compat/linuxkpi/common/include/linux/xarray.h @@ -45,6 +45,9 @@ #define XA_ERROR(x) \ ERR_PTR(x) +#define xa_is_err(x) \ + IS_ERR(x) + #define xa_limit_32b XA_LIMIT(0, 0xFFFFFFFF) #define XA_ASSERT_LOCKED(xa) mtx_assert(&(xa)->mtx, MA_OWNED) @@ -87,6 +90,24 @@ void *__xa_store(struct xarray *, uint32_t, void *, gfp_t); bool __xa_empty(struct xarray *); void *__xa_next(struct xarray *, unsigned long *, bool); +#define xa_store_irq(xa, index, ptr, gfp) \ + xa_store((xa), (index), (ptr), (gfp)) + +#define xa_erase_irq(xa, index) \ + xa_erase((xa), (index)) + +#define xa_lock_irqsave(xa, flags) \ + do { \ + xa_lock((xa)); \ + flags = 0; \ + } while (0) + +#define xa_unlock_irqrestore(xa, flags) \ + do { \ + xa_unlock((xa)); \ + flags == 0; \ + } while (0) + static inline int xa_err(void *ptr) {