Skip to content

Commit df1cb88

Browse files
ycsinjhedberg
authored andcommitted
arch: arc: add sys_write64/sys_read64 functions
Added sys_read64 and sys_write64 functions for 64-bit memory operations when building for 64-bit. Signed-off-by: Benjamin Cabé <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]>
1 parent aebc427 commit df1cb88

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/zephyr/arch/arc/sys-io-common.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr)
7474
compiler_barrier();
7575
}
7676

77+
#ifdef CONFIG_64BIT
78+
static ALWAYS_INLINE uint64_t sys_read64(mem_addr_t addr)
79+
{
80+
uint64_t value;
81+
82+
compiler_barrier();
83+
value = *(volatile uint64_t *)addr;
84+
compiler_barrier();
85+
86+
return value;
87+
}
88+
89+
static ALWAYS_INLINE void sys_write64(uint64_t data, mem_addr_t addr)
90+
{
91+
compiler_barrier();
92+
*(volatile uint64_t *)addr = data;
93+
compiler_barrier();
94+
}
95+
#endif /* CONFIG_64BIT */
96+
7797
#ifdef __cplusplus
7898
}
7999
#endif

0 commit comments

Comments
 (0)