git: 825b33fccdd9 - stable/13 - linuxkpi: Add for_each_sgtable_dma_sg and for_each_sgtable_dma_page
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 27 Apr 2022 15:16:25 UTC
The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=825b33fccdd98ff1905cfe3c68a8093b365a5b2c commit 825b33fccdd98ff1905cfe3c68a8093b365a5b2c Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2022-03-29 11:02:25 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2022-04-27 16:38:06 +0000 linuxkpi: Add for_each_sgtable_dma_sg and for_each_sgtable_dma_page Variants of for_each_sg/for_each_sg_dma_page but they operate on sgtable structs. Needed by drm v5.10 MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 1aca8a6ec61cce1a4673a8f7b5412b106e366aff) --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index 23a083577b30..d51c45853945 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -99,6 +99,12 @@ struct sg_dma_page_iter { #define for_each_sg(sglist, sg, sgmax, iter) \ for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg)) +#define for_each_sgtable_dma_sg(sgt, sg, iter) \ + for_each_sg((sgt)->sgl, sg, (sgt)->nents, iter) + +#define for_each_sgtable_dma_page(sgt, iter, pgoffset) \ + for_each_sg_dma_page((sgt)->sgl, iter, (sgt)->nents, pgoffset) + typedef struct scatterlist *(sg_alloc_fn) (unsigned int, gfp_t); typedef void (sg_free_fn) (struct scatterlist *, unsigned int);