arch/x86: Add read64 and write64 functions
Create new functions similar to read and write of other sizes. Change-Id: I35a08c498f25227233604c65c45b73b1c44fae1f Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/19394 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
8e055f8f53
commit
efd077ac52
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue