arm/arm64: add 64bit read/write APIs
Added sys_read64() and sys_write64() for 64bit operations. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
This commit is contained in:
parent
495d10234d
commit
ae82738e71
1 changed files with 16 additions and 0 deletions
|
@ -81,6 +81,22 @@ static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr)
|
||||||
__asm__ volatile("str %w0, [%1]" : : "r" (data), "r" (addr));
|
__asm__ volatile("str %w0, [%1]" : : "r" (data), "r" (addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr)
|
||||||
|
{
|
||||||
|
uint64_t val;
|
||||||
|
|
||||||
|
__asm__ volatile("ldr %x0, [%1]" : "=r" (val) : "r" (addr));
|
||||||
|
|
||||||
|
__DMB();
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ALWAYS_INLINE void sys_write64(uint64_t data, mem_addr_t addr)
|
||||||
|
{
|
||||||
|
__DMB();
|
||||||
|
__asm__ volatile("str %x0, [%1]" : : "r" (data), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue