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:
parent
adac6f40f2
commit
60f5328c7d
2 changed files with 26 additions and 0 deletions
|
@ -98,6 +98,12 @@ static inline uint32_t read32(const void *addr)
|
||||||
return *(volatile uint32_t *)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)
|
static inline void write8(void *addr, uint8_t val)
|
||||||
{
|
{
|
||||||
dmb();
|
dmb();
|
||||||
|
@ -119,4 +125,11 @@ static inline void write32(void *addr, uint32_t val)
|
||||||
dmb();
|
dmb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void write64(void *addr, uint64_t val)
|
||||||
|
{
|
||||||
|
dmb();
|
||||||
|
*(volatile uint64_t *)addr = val;
|
||||||
|
dmb();
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -99,6 +99,12 @@ static inline uint32_t read32(const void *addr)
|
||||||
return *(volatile uint32_t *)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)
|
static inline void write8(void *addr, uint8_t val)
|
||||||
{
|
{
|
||||||
dmb();
|
dmb();
|
||||||
|
@ -120,4 +126,11 @@ static inline void write32(void *addr, uint32_t val)
|
||||||
dmb();
|
dmb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void write64(void *addr, uint64_t val)
|
||||||
|
{
|
||||||
|
dmb();
|
||||||
|
*(volatile uint64_t *)addr = val;
|
||||||
|
dmb();
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue