Skip to content

Commit a1e7cbf

Browse files
Lyudejannau
authored andcommitted
rust: Introduce iosys_map bindings
This introduces a set of bindings for working with iosys_map in rust code. The design of this is heavily based off the design for both the io and dma_map bindings for Rust. Signed-off-by: Lyude Paul <lyude@redhat.com>
1 parent 31a3c6b commit a1e7cbf

4 files changed

Lines changed: 631 additions & 0 deletions

File tree

rust/helpers/helpers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "irq.c"
3232
#include "fs.c"
3333
#include "io.c"
34+
#include "iosys_map.c"
3435
#include "jump_label.c"
3536
#include "kunit.c"
3637
#include "maple_tree.c"

rust/helpers/iosys_map.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <linux/iosys-map.h>
4+
5+
void rust_helper_iosys_map_memcpy_to(struct iosys_map *dst, size_t dst_offset,
6+
const void *src, size_t len)
7+
{
8+
iosys_map_memcpy_to(dst, dst_offset, src, len);
9+
}
10+
11+
void rust_helper_iosys_map_memcpy_from(void *dst, const struct iosys_map *src,
12+
size_t src_offset, size_t len)
13+
{
14+
iosys_map_memcpy_from(dst, src, src_offset, len);
15+
}

0 commit comments

Comments
 (0)