diff options
-rw-r--r-- | arch/riscv/include/asm/io.h | 16 | ||||
-rw-r--r-- | arch/riscv/mm/ioremap.c | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h index c1f32cfcc79b..2a5c7c371e2d 100644 --- a/arch/riscv/include/asm/io.h +++ b/arch/riscv/include/asm/io.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef _ASM_RISCV_IO_H | 19 | #ifndef _ASM_RISCV_IO_H |
20 | #define _ASM_RISCV_IO_H | 20 | #define _ASM_RISCV_IO_H |
21 | 21 | ||
22 | #include <linux/types.h> | ||
23 | |||
22 | #ifdef CONFIG_MMU | 24 | #ifdef CONFIG_MMU |
23 | 25 | ||
24 | extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); | 26 | extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); |
@@ -32,7 +34,7 @@ extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); | |||
32 | #define ioremap_wc(addr, size) ioremap((addr), (size)) | 34 | #define ioremap_wc(addr, size) ioremap((addr), (size)) |
33 | #define ioremap_wt(addr, size) ioremap((addr), (size)) | 35 | #define ioremap_wt(addr, size) ioremap((addr), (size)) |
34 | 36 | ||
35 | extern void iounmap(void __iomem *addr); | 37 | extern void iounmap(volatile void __iomem *addr); |
36 | 38 | ||
37 | #endif /* CONFIG_MMU */ | 39 | #endif /* CONFIG_MMU */ |
38 | 40 | ||
@@ -266,9 +268,9 @@ __io_reads_ins(reads, u32, l, __io_br(), __io_ar()) | |||
266 | __io_reads_ins(ins, u8, b, __io_pbr(), __io_par()) | 268 | __io_reads_ins(ins, u8, b, __io_pbr(), __io_par()) |
267 | __io_reads_ins(ins, u16, w, __io_pbr(), __io_par()) | 269 | __io_reads_ins(ins, u16, w, __io_pbr(), __io_par()) |
268 | __io_reads_ins(ins, u32, l, __io_pbr(), __io_par()) | 270 | __io_reads_ins(ins, u32, l, __io_pbr(), __io_par()) |
269 | #define insb(addr, buffer, count) __insb((void __iomem *)addr, buffer, count) | 271 | #define insb(addr, buffer, count) __insb((void __iomem *)(long)addr, buffer, count) |
270 | #define insw(addr, buffer, count) __insw((void __iomem *)addr, buffer, count) | 272 | #define insw(addr, buffer, count) __insw((void __iomem *)(long)addr, buffer, count) |
271 | #define insl(addr, buffer, count) __insl((void __iomem *)addr, buffer, count) | 273 | #define insl(addr, buffer, count) __insl((void __iomem *)(long)addr, buffer, count) |
272 | 274 | ||
273 | __io_writes_outs(writes, u8, b, __io_bw(), __io_aw()) | 275 | __io_writes_outs(writes, u8, b, __io_bw(), __io_aw()) |
274 | __io_writes_outs(writes, u16, w, __io_bw(), __io_aw()) | 276 | __io_writes_outs(writes, u16, w, __io_bw(), __io_aw()) |
@@ -280,9 +282,9 @@ __io_writes_outs(writes, u32, l, __io_bw(), __io_aw()) | |||
280 | __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) | 282 | __io_writes_outs(outs, u8, b, __io_pbw(), __io_paw()) |
281 | __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) | 283 | __io_writes_outs(outs, u16, w, __io_pbw(), __io_paw()) |
282 | __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) | 284 | __io_writes_outs(outs, u32, l, __io_pbw(), __io_paw()) |
283 | #define outsb(addr, buffer, count) __outsb((void __iomem *)addr, buffer, count) | 285 | #define outsb(addr, buffer, count) __outsb((void __iomem *)(long)addr, buffer, count) |
284 | #define outsw(addr, buffer, count) __outsw((void __iomem *)addr, buffer, count) | 286 | #define outsw(addr, buffer, count) __outsw((void __iomem *)(long)addr, buffer, count) |
285 | #define outsl(addr, buffer, count) __outsl((void __iomem *)addr, buffer, count) | 287 | #define outsl(addr, buffer, count) __outsl((void __iomem *)(long)addr, buffer, count) |
286 | 288 | ||
287 | #ifdef CONFIG_64BIT | 289 | #ifdef CONFIG_64BIT |
288 | __io_reads_ins(reads, u64, q, __io_br(), __io_ar()) | 290 | __io_reads_ins(reads, u64, q, __io_br(), __io_ar()) |
diff --git a/arch/riscv/mm/ioremap.c b/arch/riscv/mm/ioremap.c index e99194a4077e..70ef2724cdf6 100644 --- a/arch/riscv/mm/ioremap.c +++ b/arch/riscv/mm/ioremap.c | |||
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(ioremap); | |||
85 | * | 85 | * |
86 | * Caller must ensure there is only one unmapping for the same pointer. | 86 | * Caller must ensure there is only one unmapping for the same pointer. |
87 | */ | 87 | */ |
88 | void iounmap(void __iomem *addr) | 88 | void iounmap(volatile void __iomem *addr) |
89 | { | 89 | { |
90 | vunmap((void *)((unsigned long)addr & PAGE_MASK)); | 90 | vunmap((void *)((unsigned long)addr & PAGE_MASK)); |
91 | } | 91 | } |