From efd077ac5283cb88627a53b703f1eb67aec4e5a3 Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Thu, 20 Apr 2017 14:03:11 -0600 Subject: arch/x86: Add read64 and write64 functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create new functions similar to read and write of other sizes. Change-Id: I35a08c498f25227233604c65c45b73b1c44fae1f Signed-off-by: Marshall Dawson Reviewed-on: https://review.coreboot.org/19394 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/arch/x86/include/arch/io.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/arch/x86/include/arch/io.h b/src/arch/x86/include/arch/io.h index c194379bb6..a59ac2c50b 100644 --- a/src/arch/x86/include/arch/io.h +++ b/src/arch/x86/include/arch/io.h @@ -174,6 +174,14 @@ static inline __attribute__((always_inline)) uint32_t read32( return *((volatile uint32_t *)(addr)); } +#ifndef __ROMCC__ +static inline __attribute__((always_inline)) uint64_t read64( + const volatile void *addr) +{ + return *((volatile uint64_t *)(addr)); +} +#endif + static inline __attribute__((always_inline)) void write8(volatile void *addr, uint8_t value) { @@ -192,6 +200,14 @@ static inline __attribute__((always_inline)) void write32(volatile void *addr, *((volatile uint32_t *)(addr)) = value; } +#ifndef __ROMCC__ +static inline __attribute__((always_inline)) void write64(volatile void *addr, + uint64_t value) +{ + *((volatile uint64_t *)(addr)) = value; +} +#endif + /* Conflicts with definition in lib.h */ #if defined(__ROMCC__) static inline int log2(u32 value) -- cgit v1.2.3