aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-04-21 23:25:57 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-04-21 23:25:57 +0300
commit42451ed4718af3f93770feb201bd023625d69b3a (patch)
tree7f69bc86e0fc0591f176ca086db377e1cb99a718 /arch/riscv64/include
parent1a5248bb177242a34fd51efadb4af941853d5e35 (diff)
downloadkmi-42451ed4718af3f93770feb201bd023625d69b3a.tar.gz
kmi-42451ed4718af3f93770feb201bd023625d69b3a.zip
fix warnings on 32bit riscv
+ Will most probably not work on 32bit, but nice to make 'portable' code.
Diffstat (limited to 'arch/riscv64/include')
-rw-r--r--arch/riscv64/include/types.h4
-rw-r--r--arch/riscv64/include/vmem.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/arch/riscv64/include/types.h b/arch/riscv64/include/types.h
index 3e1c08b..59a2762 100644
--- a/arch/riscv64/include/types.h
+++ b/arch/riscv64/include/types.h
@@ -3,7 +3,7 @@
#include <apos/types.h>
-typedef size_t vm_t;
-typedef size_t pm_t;
+typedef uintptr_t vm_t;
+typedef uintptr_t pm_t;
#endif /* APOS_RISCV_TYPES_H */
diff --git a/arch/riscv64/include/vmem.h b/arch/riscv64/include/vmem.h
index 115f2b0..4446aef 100644
--- a/arch/riscv64/include/vmem.h
+++ b/arch/riscv64/include/vmem.h
@@ -4,6 +4,8 @@
#include <apos/types.h>
#include <apos/attrs.h>
+#define RISCV_NUM_LEAVES (4096 / sizeof(void *))
+
#define VM_V (1 << 0)
#define VM_R (1 << 1)
#define VM_W (1 << 2)
@@ -19,8 +21,8 @@ enum mm_mode {
Sv32,
};
-struct __packed vm_branch {
- struct vm_branch *leaf[512];
+struct vm_branch {
+ struct vm_branch *leaf[RISCV_NUM_LEAVES];
};
#endif /* APOS_RISCV_VMAP_H */