arch/common: add 64bit register access functions for 64bit arch

Some 64bit arch SoC happens to have 64bit registers.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2023-07-25 17:59:06 +08:00 committed by Chris Friedt
commit 74f73cd535

View file

@ -50,6 +50,16 @@ static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr)
*(volatile uint32_t *)addr = data;
}
static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr)
{
return *(volatile uint64_t *)addr;
}
static ALWAYS_INLINE void sys_write64(uint64_t data, mem_addr_t addr)
{
*(volatile uint64_t *)addr = data;
}
#ifdef __cplusplus
}
#endif