From nobody Mon Feb 13 21:09:47 2023 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 4PFxmq2YcVz3q5KP; Mon, 13 Feb 2023 21:09:47 +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 4PFxmq26vPz4Rqw; Mon, 13 Feb 2023 21:09:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322587; 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=sS+YdkeZhyAMOuCkBqOBQANqdb2C8+tlJZuhPqGVR20=; b=o2io79f1HefXuUm/JTt0YVAWSLrxt0f7LfJHhRGbaJdRB4xTE9POClethY8HvRWn2U4Jaf Et1KRIqgCsX+qaXHv5Nr8AhIcP/yrlyrNH7+CaQ8PSz69Zsrwgu4t5L/6jM4JFFA4fWytX A53XDfed8YzQACRODA7n3EvJk0y3KhS1f5ADgsJ4j1WQw9Rp/Vy1Nq+/UvvAYRr2sqIjQd WE3RuHRZA2GccD22/SSfi8zB1ZnfFG+tr2hA7o14s4ugEnqlUfFzBuFbl7KNWShoAa0ch2 /EoJn2hAtILyu3O3P5UYFc5RGBR6gDbzc9F7APdBMd7EUFrkAwIuvV7qcCKkZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676322587; 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=sS+YdkeZhyAMOuCkBqOBQANqdb2C8+tlJZuhPqGVR20=; b=e6O1sEvMt6QWvyKeudvjjOPW7Odlg9r5Rse0cq7LhosrbDl0S4v5BWFLxFTjnE0ILI93Mm IdAlEIOwM6TwiRpHFRTWvUjl7UIESHI1+IrDIlJ7Rc9U0dZYk1Hx9gHyjNUbkZqSKcpQGk XBDKnyArX3+8iHdfOR+LgXiWiTg4Ci5B1xFNoJCKWAzrJP+i4Zy/qq4z++pu/UnmMYowiH vsVs5cXGkY7CSU8Gp25nmTav5IfPFSXuH3INS2rNBXIf7fcRxEAU09ULSFSPNzSMKvgwCe N0TrDemm2nBvAQJ1hTkvOX6jOsAn953SShPe6+Rqns2ozm1D939KQglckU44Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676322587; a=rsa-sha256; cv=none; b=mDWktXozSoS9slzb6DDaS6O+wEJTrdY23MxnQcJtGyE6F0ZPCkG2MSXzWlSapRTZglmW4L iMvTiuAO2AHbNE85RKpX4hJ/6SZW3xDOistxOY6lsWCJ/49XRIGJRI1gXQEaB5BHG0L6xu aSxQOwjnVen2Ps39ALe0twgB1N54zDYLYQosZdeyMVqHRPfwtWEAXV93UYnqbBPaantvOH 2G0IkEKdlzgrdyI2Pir9WbVpy4AEBben3viMW1JDRqFAA5BpBuHBe9aWXliOlUezEF+k0U n26861SfsxCFnwYwubADFIV1DWhKRZNVu6ikFZbdvjn+HAzg6CakJjOXgV5ZRA== 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 4PFxmq1CBjzXrX; Mon, 13 Feb 2023 21:09:47 +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 31DL9lal056353; Mon, 13 Feb 2023 21:09:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31DL9loE056352; Mon, 13 Feb 2023 21:09:47 GMT (envelope-from git) Date: Mon, 13 Feb 2023 21:09:47 GMT Message-Id: <202302132109.31DL9loE056352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 5542309ec6eb - main - linuxkpi: Define `xa_is_err()`, `xa_{store,erase}_irq()` and `xa_{,un}lock_irq*()` 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5542309ec6eba3af9e26c50acd654de462181b8e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5542309ec6eba3af9e26c50acd654de462181b8e commit 5542309ec6eba3af9e26c50acd654de462181b8e Author: Jean-Sébastien Pédron AuthorDate: 2023-02-08 17:55:29 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-13 21:09:31 +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 --- 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) {