libpayload/arm*: Add 64bit memory access primitives

Add read64 and write64 for consistency with x86.

BUG=b:178785769

Change-Id: I342e3a23201d0b804ea5ecfe47ee3e4bb516de4c
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50115
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Patrick Georgi 2021-01-29 14:08:48 +01:00
parent adac6f40f2
commit 60f5328c7d
2 changed files with 26 additions and 0 deletions

View File

@ -98,6 +98,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();
@ -119,4 +125,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

View File

@ -99,6 +99,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();
@ -120,4 +126,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