From 42451ed4718af3f93770feb201bd023625d69b3a Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 21 Apr 2022 23:25:57 +0300 Subject: fix warnings on 32bit riscv + Will most probably not work on 32bit, but nice to make 'portable' code. --- arch/riscv64/include/vmem.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/riscv64/include/vmem.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 #include +#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 */ -- cgit v1.3