From 3b63e0fb5a903adf5c9164b4810e6def9c754a7e Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Thu, 28 Dec 2017 20:52:15 -0800 Subject: arm64: Add read64() and write64() Change-Id: I89cf4b996405af616f54cf2d9fabd4e258352b03 Signed-off-by: David Hendricks Reviewed-on: https://review.coreboot.org/23036 Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/arch/arm64/include/armv8/arch/io.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/arch/arm64') diff --git a/src/arch/arm64/include/armv8/arch/io.h b/src/arch/arm64/include/armv8/arch/io.h index f60e1f4d64..31615f736f 100644 --- a/src/arch/arm64/include/armv8/arch/io.h +++ b/src/arch/arm64/include/armv8/arch/io.h @@ -51,6 +51,12 @@ static inline uint32_t read32(const void *addr) return *(volatile uint32_t *)addr; } +static inline uint64_t read64(const void *addr) +{ + dmb(); + return *(volatile uint64_t *)addr; +} + static inline void write8(void *addr, uint8_t val) { dmb(); @@ -72,4 +78,11 @@ static inline void write32(void *addr, uint32_t val) dmb(); } +static inline void write64(void *addr, uint64_t val) +{ + dmb(); + *(volatile uint64_t *)addr = val; + dmb(); +} + #endif /* __ARCH_IO_H */ -- cgit v1.2.3