Skip to content

Commit

Permalink
Revert "[arch][arm64][mmio] add 'Z' to the mmio write accessor inline…
Browse files Browse the repository at this point in the history
… asm"

Sadly this doesn't really work in all situations and only happens to
work with gcc + binutils for 32bit accesses, presumably because gnu as
replaces a literal 0 with wzr.

Clang doesn't understand it at all.

This reverts commit 6c14941.
  • Loading branch information
travisg committed Jun 1, 2024
1 parent 0e25214 commit 479f7fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arm64/include/arch/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
})

#define _ARCH_MMIO_WRITE8(addr, val) \
__asm__ volatile("strb %w1, %0" : "=m"(*(addr)) : "Zr"(val) : "memory")
__asm__ volatile("strb %w1, %0" : "=m"(*(addr)) : "r"(val) : "memory")
#define _ARCH_MMIO_WRITE16(addr, val) \
__asm__ volatile("strh %w1, %0" : "=m"(*(addr)): "Zr"(val) : "memory")
__asm__ volatile("strh %w1, %0" : "=m"(*(addr)): "r"(val) : "memory")
#define _ARCH_MMIO_WRITE32(addr, val) \
__asm__ volatile("str %w1, %0" : "=m"(*(addr)) : "Zr"(val) : "memory")
__asm__ volatile("str %w1, %0" : "=m"(*(addr)) : "r"(val) : "memory")
#define _ARCH_MMIO_WRITE64(addr, val) \
__asm__ volatile("str %1, %0" : "=m"(*(addr)) : "Zr"(val) : "memory")
__asm__ volatile("str %1, %0" : "=m"(*(addr)) : "r"(val) : "memory")

0 comments on commit 479f7fb

Please sign in to comment.