xref: /linux/rust/helpers/scatterlist.c (revision 644672e93a1aa6bfc3ebc102cbf9b8efad16e786)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/dma-direction.h>
4 
5 __rust_helper dma_addr_t rust_helper_sg_dma_address(struct scatterlist *sg)
6 {
7 	return sg_dma_address(sg);
8 }
9 
10 __rust_helper unsigned int rust_helper_sg_dma_len(struct scatterlist *sg)
11 {
12 	return sg_dma_len(sg);
13 }
14 
15 __rust_helper struct scatterlist *rust_helper_sg_next(struct scatterlist *sg)
16 {
17 	return sg_next(sg);
18 }
19 
20 __rust_helper void rust_helper_dma_unmap_sgtable(struct device *dev,
21 						 struct sg_table *sgt,
22 						 enum dma_data_direction dir,
23 						 unsigned long attrs)
24 {
25 	return dma_unmap_sgtable(dev, sgt, dir, attrs);
26 }
27