libpayload: add read64() and write64()

Change-Id: I6febf13ed54a7707f5a99d3d2715c36e18517c12
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34206
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Thomas Heijligen 2019-07-10 16:04:50 +02:00 committed by Patrick Georgi
parent 573481bf6f
commit e5b2453f91
1 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,11 @@ static inline __attribute__((always_inline)) uint32_t read32(const volatile void
return *((volatile uint32_t *)(addr)); return *((volatile uint32_t *)(addr));
} }
static inline __attribute__((always_inline)) uint64_t read64(const volatile void *addr)
{
return *((volatile uint64_t *)(addr));
}
static inline __attribute__((always_inline)) void write8(volatile void *addr, uint8_t value) static inline __attribute__((always_inline)) void write8(volatile void *addr, uint8_t value)
{ {
*((volatile uint8_t *)(addr)) = value; *((volatile uint8_t *)(addr)) = value;
@ -79,6 +84,11 @@ static inline __attribute__((always_inline)) void write32(volatile void *addr, u
*((volatile uint32_t *)(addr)) = value; *((volatile uint32_t *)(addr)) = value;
} }
static inline __attribute__((always_inline)) void write64(volatile void *addr, uint64_t value)
{
*((volatile uint64_t *)(addr)) = value;
}
static inline unsigned int inl(int port) static inline unsigned int inl(int port)
{ {
unsigned long val; unsigned long val;