From nobody Thu Aug 18 09:10:07 2022 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 4M7fH36QY8z4YwxV; Thu, 18 Aug 2022 09:10: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 4M7fH34Hd6z3PnT; Thu, 18 Aug 2022 09:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660813807; 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=JVsYLKAV1CGZfLMe6RjkgXdQLdd2mLuplARuHQSAPWs=; b=RD6Fio194n1qzlbASCxooTEtZHpDeTwIY+sdPHCGxSqzomhpCSJR8U0V1v3LdBP1eu93n0 XrpKym1ZdiqQM0L4RVBYK6DRKoZgQgnumADF6mhmhNKPU3O5ZSMxetPNA5y9n1vkIsyJiP wggFWrNgAAQey8kIlayzzfxFND3RVzAzPeuBSe1KX2DAEBMTNsOHE3HiPgZ8WrhaVCHX99 7NynzieIvPhULtgdlKNZiN8I97ZV/ib7W4cY8UQ3F+mO5684hQWyhgzcS02J/pqDlRwGK7 zU+PFZbeE7Wc8xI1zOIBEHAAXyfEwIXqRtEmahOqnbiyM4jSjqqdu/RfxgN+5A== 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 4M7fH33NFKz1MvN; Thu, 18 Aug 2022 09:10:07 +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 27I9A71t017457; Thu, 18 Aug 2022 09:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27I9A7qV017451; Thu, 18 Aug 2022 09:10:07 GMT (envelope-from git) Date: Thu, 18 Aug 2022 09:10:07 GMT Message-Id: <202208180910.27I9A7qV017451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 9202c95f47c2 - main - linuxkpi: Add dma_{un,}map_sgtable 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9202c95f47c2c3be8972052dc31d540924db1447 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660813807; 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=JVsYLKAV1CGZfLMe6RjkgXdQLdd2mLuplARuHQSAPWs=; b=nKic5e3BS2Vp8TBqwMq7BjQ7j90K2wIOwRDy2S0cvEex1lPjXHTeRDmBRJ+rm7S63Sfo9Z LmysyLeZyXt+bGs6ey3qwhF/fjDEnFrUjHEmLSoZJrK+Wuld4kjMlpAA0TjMlXpj0f0dyQ zK/sVi6/mlQY179B/2gSfj4XW9PGOS1kf880DDxPq4syWaUvSqJtoXBOcJzpMPh7zjxWTY 07oFN2/vB0Cx82EkB8eeNo7AWxKbSbWXmSygXQ/NfAuJEogvTOqFzWnmZBUFg9npMWK3RB yv+hQoVKAZZPkq5PaCZLrME1MmcgJyOeaMJ2rG+XyY3B5lRdrwDM3JGC/Gpoog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660813807; a=rsa-sha256; cv=none; b=XQ0M6+2zIpf9I/qa0nTz5ud3ycWzH/AQev+QvZu0hgJJH6BWJUzBk3cttcryWLo3PUaM+n evANOvK4TzxxZhLyIWNJM186g2E7adwoUqiKBLmDw1e9yv+GTY8PsqLL963bzosZbUgG2q alnYVe3mempXYu/YoUmk5sJnasRiUwx3c5GWd2689ObMxtLJ0uLIGW4b7SmJOjSe1HNfp2 nIv47zbi0qHKFI2g2hkZ3638yKs3CiWsp79BbTXKKnaErcthadNRPi5oHfKBL63XeSF6zM BYEAsfl9CJDU4xxolGI56zTvo8TWLfnyRs2YGmZc7dBO6ywVanXzuMcrzzHC0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9202c95f47c2c3be8972052dc31d540924db1447 commit 9202c95f47c2c3be8972052dc31d540924db1447 Author: Emmanuel Vadot AuthorDate: 2022-08-09 09:55:02 +0000 Commit: Emmanuel Vadot CommitDate: 2022-08-18 07:46:40 +0000 linuxkpi: Add dma_{un,}map_sgtable Variant of dma_{un,}map_sg_attrs for struct sg_table. Reviewed by: bz Obtained from: drm-kmod Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D36106 --- .../linuxkpi/common/include/linux/dma-mapping.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index dd3bbc094dfb..94adb0c64431 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -341,4 +341,24 @@ dma_max_mapping_size(struct device *dev) extern int uma_align_cache; #define dma_get_cache_alignment() uma_align_cache + +static inline int +dma_map_sgtable(struct device *dev, struct sg_table *sgt, + enum dma_data_direction dir, + unsigned long attrs) +{ + + return (dma_map_sg_attrs(dev, sgt->sgl, sgt->nents, dir, attrs)); +} + +static inline void +dma_unmap_sgtable(struct device *dev, struct sg_table *sgt, + enum dma_data_direction dir, + unsigned long attrs) +{ + + dma_unmap_sg_attrs(dev, sgt->sgl, sgt->nents, dir, attrs); +} + + #endif /* _LINUXKPI_LINUX_DMA_MAPPING_H_ */