#include <lunaix/syscall.h>
#include <lunaix/syscall_utils.h>
+#include <sys/mm/mempart.h>
+
// any size beyond this is bullshit
-#define BS_SIZE (KERNEL_MM_BASE - UMMAP_START)
+#define BS_SIZE (KERNEL_EXEC - UMMAP_START)
int
mem_has_overlap(vm_regions_t* regions, ptr_t start, ptr_t end)
return ENOMEM;
found:
- if (found_loc >= KERNEL_MM_BASE || found_loc < USER_START) {
+ if (found_loc >= KERNEL_EXEC || found_loc < USER_START) {
return ENOMEM;
}
*mapping.pte &= ~PG_DIRTY;
- cpu_invplg((ptr_t)mapping.pte);
+ cpu_flush_page((ptr_t)mapping.pte);
} else if ((options & MS_INVALIDATE)) {
goto invalidate;
}
invalidate:
*mapping.pte &= ~PG_PRESENT;
pmm_free_page(KERNEL_PID, mapping.pa);
- cpu_invplg((ptr_t)mapping.pte);
+ cpu_flush_page((ptr_t)mapping.pte);
}
}
struct mmap_param param = { .flags = options,
.mlen = ROUNDUP(length, PG_SIZE),
+ .flen = length,
.offset = offset,
.type = REGION_TYPE_GENERAL,
.proct = proct,