From a9506dbaf410d9b2d297661f51f0e0b9842170e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 20 Mar 2019 20:30:02 +0200 Subject: arch/mips: Fix prototypes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These signatures need to be consistent across different architectures. Change-Id: Ide8502ee8cda8995828c77fe1674d8ba6f3aa15f Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/31995 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/arch/mips/include/arch/mmio.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/arch') diff --git a/src/arch/mips/include/arch/mmio.h b/src/arch/mips/include/arch/mmio.h index 27a4944961..c491b51bcb 100644 --- a/src/arch/mips/include/arch/mmio.h +++ b/src/arch/mips/include/arch/mmio.h @@ -24,43 +24,47 @@ #include #include -static inline uint8_t read8(unsigned long addr) +static inline uint8_t read8(const volatile void *addr) { asm("sync"); return *(volatile uint8_t *)addr; } -static inline uint16_t read16(unsigned long addr) +static inline uint16_t read16(const volatile void *addr) { asm("sync"); return *(volatile uint16_t *)addr; } -static inline uint32_t read32(unsigned long addr) +static inline uint32_t read32(const volatile void *addr) { asm("sync"); return *(volatile uint32_t *)addr; } -static inline void write8(unsigned long addr, uint8_t val) +static inline void write8(volatile void *addr, uint8_t val) { asm("sync"); *(volatile uint8_t *)addr = val; asm("sync"); } -static inline void write16(unsigned long addr, uint16_t val) +static inline void write16(volatile void *addr, uint16_t val) { asm("sync"); *(volatile uint16_t *)addr = val; asm("sync"); } -static inline void write32(unsigned long addr, uint32_t val) +static inline void write32(volatile void *addr, uint32_t val) { asm("sync"); *(volatile uint32_t *)addr = val; asm("sync"); } +/* Fixing soc/imgtech/pistachio seemed painful at the time. */ +#define read32_x(addr) read32((void *)(addr)) +#define write32_x(addr, val) write32((void *)(addr), (val)) + #endif /* __MIPS_ARCH_IO_H */ -- cgit v1.2.3