Skip to content

Commit 3462a48

Browse files
kartbencfriedt
authored andcommitted
arch: arc: add sys_write64/sys_read64 functions
Added sys_read64 and sys_write64 functions for 64-bit memory operations, similar to sys_read32 and sys_write32. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent 45179f8 commit 3462a48

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

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

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

0 commit comments

Comments
 (0)