Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/io.h>
4
5void __iomem *rust_helper_ioremap(phys_addr_t offset, size_t size)
6{
7 return ioremap(offset, size);
8}
9
10void rust_helper_iounmap(void __iomem *addr)
11{
12 iounmap(addr);
13}
14
15u8 rust_helper_readb(const void __iomem *addr)
16{
17 return readb(addr);
18}
19
20u16 rust_helper_readw(const void __iomem *addr)
21{
22 return readw(addr);
23}
24
25u32 rust_helper_readl(const void __iomem *addr)
26{
27 return readl(addr);
28}
29
30#ifdef CONFIG_64BIT
31u64 rust_helper_readq(const void __iomem *addr)
32{
33 return readq(addr);
34}
35#endif
36
37void rust_helper_writeb(u8 value, void __iomem *addr)
38{
39 writeb(value, addr);
40}
41
42void rust_helper_writew(u16 value, void __iomem *addr)
43{
44 writew(value, addr);
45}
46
47void rust_helper_writel(u32 value, void __iomem *addr)
48{
49 writel(value, addr);
50}
51
52#ifdef CONFIG_64BIT
53void rust_helper_writeq(u64 value, void __iomem *addr)
54{
55 writeq(value, addr);
56}
57#endif
58
59u8 rust_helper_readb_relaxed(const void __iomem *addr)
60{
61 return readb_relaxed(addr);
62}
63
64u16 rust_helper_readw_relaxed(const void __iomem *addr)
65{
66 return readw_relaxed(addr);
67}
68
69u32 rust_helper_readl_relaxed(const void __iomem *addr)
70{
71 return readl_relaxed(addr);
72}
73
74#ifdef CONFIG_64BIT
75u64 rust_helper_readq_relaxed(const void __iomem *addr)
76{
77 return readq_relaxed(addr);
78}
79#endif
80
81void rust_helper_writeb_relaxed(u8 value, void __iomem *addr)
82{
83 writeb_relaxed(value, addr);
84}
85
86void rust_helper_writew_relaxed(u16 value, void __iomem *addr)
87{
88 writew_relaxed(value, addr);
89}
90
91void rust_helper_writel_relaxed(u32 value, void __iomem *addr)
92{
93 writel_relaxed(value, addr);
94}
95
96#ifdef CONFIG_64BIT
97void rust_helper_writeq_relaxed(u64 value, void __iomem *addr)
98{
99 writeq_relaxed(value, addr);
100}
101#endif