feat: provide some libc routines only for testing
[lunaix-os.git] / lunaix-os / kernel / asm / x86 / pfault.c
index 0d5131f53def4ce02ea288afdaf1efa1391fdb9c..f6c4355a1c0fabc58fc745b315bd4d74d0c604c6 100644 (file)
@@ -89,7 +89,7 @@ intr_routine_page_fault(const isr_param* param)
     if (hit_region->mfile && !PG_IS_PRESENT(*pte)) {
         struct v_file* file = hit_region->mfile;
         u32_t offset =
-          (ptr - hit_region->start) & (PG_SIZE - 1) + hit_region->foff;
+          ((ptr - hit_region->start) & (PG_SIZE - 1)) + hit_region->foff;
         uintptr_t pa = pmm_alloc_page(__current->pid, 0);
 
         if (!pa) {