Skip to content

Commit 8a739f6

Browse files
williamtunmorey
authored andcommitted
util: Fix mmio read on ARM
[ Upstream commit d5e1802 ] Cast the addr to uint8_t pointer instead of uint32_t pointer. This fixes a SIGBUS error on ARM system. Fixes: 3f1f8d9 ("util: Add common mmio macros") Signed-off-by: William Tu <[email protected]> Signed-off-by: Nicolas Morey <[email protected]>
1 parent 9d5d26d commit 8a739f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/mmio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static inline void mmio_write8(void *addr, uint8_t value)
158158
}
159159
static inline uint8_t mmio_read8(const void *addr)
160160
{
161-
return atomic_load_explicit((_Atomic(uint32_t) *)addr,
161+
return atomic_load_explicit((_Atomic(uint8_t) *)addr,
162162
memory_order_relaxed);
163163
}
164164
#endif /* __s390x__ */

0 commit comments

Comments
 (0)