aboutsummaryrefslogtreecommitdiff
path: root/include/apos/mem.h
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-04-10 20:37:51 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-04-10 20:37:51 +0300
commit4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f (patch)
tree898854069101e6616620e2bd732a48e5eca08fd2 /include/apos/mem.h
parent8aa17b12f29536ea9c8b6ca22c7f153e8d90fa3b (diff)
downloadkmi-4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f.tar.gz
kmi-4c6be9cb63ff66ce49a6f733c1e00d1889f2c95f.zip
add basic ubsan and fix issues reported by it
Diffstat (limited to 'include/apos/mem.h')
-rw-r--r--include/apos/mem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/apos/mem.h b/include/apos/mem.h
index 7c0fde1..be44104 100644
--- a/include/apos/mem.h
+++ b/include/apos/mem.h
@@ -30,8 +30,8 @@
#define __o_container(idx) ((idx) / MM_OINFO_WIDTH)
#define __o_bit(idx) ((idx) & (MM_OINFO_WIDTH - 1))
-#define __va(x) (((char *)(x)) + VM_DMAP - RAM_BASE)
-#define __pa(x) (((char *)(x)) + RAM_BASE - VM_DMAP)
+#define __va(x) (void *)(((uintptr_t)(x)) + VM_DMAP - RAM_BASE)
+#define __pa(x) (void *)(((uintptr_t)(x)) - VM_DMAP + RAM_BASE)
#define __page(x) ((x) / BASE_PAGE_SIZE)
#define __addr(x) ((x)*BASE_PAGE_SIZE)
#define __pages(x) \