Files

147 lines
3.0 KiB
C
Raw Permalink Normal View History

2024-12-19 18:04:09 +01:00
// SPDX-License-Identifier: GPL-2.0
#include <linux/io.h>
2025-07-17 12:55:22 -03:00
#include <linux/ioport.h>
2024-12-19 18:04:09 +01:00
2025-12-02 19:37:43 +00:00
__rust_helper void __iomem *rust_helper_ioremap(phys_addr_t offset, size_t size)
2024-12-19 18:04:09 +01:00
{
return ioremap(offset, size);
}
2025-12-02 19:37:43 +00:00
__rust_helper void __iomem *rust_helper_ioremap_np(phys_addr_t offset,
size_t size)
{
return ioremap_np(offset, size);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_iounmap(void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
iounmap(addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper u8 rust_helper_readb(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readb(addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper u16 rust_helper_readw(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readw(addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper u32 rust_helper_readl(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readl(addr);
}
#ifdef CONFIG_64BIT
2025-12-02 19:37:43 +00:00
__rust_helper u64 rust_helper_readq(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readq(addr);
}
#endif
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writeb(u8 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writeb(value, addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writew(u16 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writew(value, addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writel(u32 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writel(value, addr);
}
#ifdef CONFIG_64BIT
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writeq(u64 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writeq(value, addr);
}
#endif
2025-12-02 19:37:43 +00:00
__rust_helper u8 rust_helper_readb_relaxed(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readb_relaxed(addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper u16 rust_helper_readw_relaxed(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readw_relaxed(addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper u32 rust_helper_readl_relaxed(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readl_relaxed(addr);
}
#ifdef CONFIG_64BIT
2025-12-02 19:37:43 +00:00
__rust_helper u64 rust_helper_readq_relaxed(const void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
return readq_relaxed(addr);
}
#endif
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writeb_relaxed(u8 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writeb_relaxed(value, addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writew_relaxed(u16 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writew_relaxed(value, addr);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writel_relaxed(u32 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writel_relaxed(value, addr);
}
#ifdef CONFIG_64BIT
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_writeq_relaxed(u64 value, void __iomem *addr)
2024-12-19 18:04:09 +01:00
{
writeq_relaxed(value, addr);
}
#endif
2025-07-17 12:55:22 -03:00
2025-12-02 19:37:43 +00:00
__rust_helper resource_size_t rust_helper_resource_size(struct resource *res)
2025-07-17 12:55:22 -03:00
{
return resource_size(res);
}
2025-12-02 19:37:43 +00:00
__rust_helper struct resource *
rust_helper_request_mem_region(resource_size_t start, resource_size_t n,
const char *name)
2025-07-17 12:55:22 -03:00
{
return request_mem_region(start, n, name);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_release_mem_region(resource_size_t start,
resource_size_t n)
2025-07-17 12:55:22 -03:00
{
release_mem_region(start, n);
}
2025-12-02 19:37:43 +00:00
__rust_helper struct resource *rust_helper_request_region(resource_size_t start,
resource_size_t n,
const char *name)
2025-07-17 12:55:22 -03:00
{
return request_region(start, n, name);
}
2025-12-02 19:37:43 +00:00
__rust_helper struct resource *
rust_helper_request_muxed_region(resource_size_t start, resource_size_t n,
const char *name)
2025-07-17 12:55:22 -03:00
{
return request_muxed_region(start, n, name);
}
2025-12-02 19:37:43 +00:00
__rust_helper void rust_helper_release_region(resource_size_t start,
resource_size_t n)
2025-07-17 12:55:22 -03:00
{
release_region(start, n);
}