aboutsummaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/mmio.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/include/sys/mmio.h b/sys/include/sys/mmio.h
index 75f834b..8e3db52 100644
--- a/sys/include/sys/mmio.h
+++ b/sys/include/sys/mmio.h
@@ -52,10 +52,13 @@
static inline void \
mmio_write##SUFFIX(void *addr, TYPE val) \
{ \
- if (addr < VM_HIGHER_HALF) { \
- addr += VM_HIGHER_HALF; \
+ uintptr_t tmp; \
+ \
+ tmp = (uintptr_t)addr; \
+ if (tmp < VM_HIGHER_HALF) { \
+ tmp += VM_HIGHER_HALF; \
} \
- *(volatile TYPE *)addr = val; \
+ *(volatile TYPE *)tmp = val; \
}
/*