git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: one more step towards arch-agnostic design
[lunaix-os.git]
/
lunaix-os
/
kernel
/
mm
/
mmap.c
diff --git
a/lunaix-os/kernel/mm/mmap.c
b/lunaix-os/kernel/mm/mmap.c
index f23ff60ab895702ee90271bcc5bc57e177db4bde..fcdd91c27d899b9358b80c1ca89ce178575d7fd2 100644
(file)
--- a/
lunaix-os/kernel/mm/mmap.c
+++ b/
lunaix-os/kernel/mm/mmap.c
@@
-7,8
+7,10
@@
#include <lunaix/syscall.h>
#include <lunaix/syscall_utils.h>
#include <lunaix/syscall.h>
#include <lunaix/syscall_utils.h>
+#include <sys/mm/mempart.h>
+
// any size beyond this is bullshit
// 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)
int
mem_has_overlap(vm_regions_t* regions, ptr_t start, ptr_t end)
@@
-101,7
+103,7
@@
mem_map(void** addr_out,
return ENOMEM;
found:
return ENOMEM;
found:
- if (found_loc >= KERNEL_
MM_BASE
|| found_loc < USER_START) {
+ if (found_loc >= KERNEL_
EXEC
|| found_loc < USER_START) {
return ENOMEM;
}
return ENOMEM;
}
@@
-177,7
+179,7
@@
mem_sync_pages(ptr_t mnt,
*mapping.pte &= ~PG_DIRTY;
*mapping.pte &= ~PG_DIRTY;
- cpu_
invplg
((ptr_t)mapping.pte);
+ cpu_
flush_page
((ptr_t)mapping.pte);
} else if ((options & MS_INVALIDATE)) {
goto invalidate;
}
} else if ((options & MS_INVALIDATE)) {
goto invalidate;
}
@@
-191,7
+193,7
@@
mem_sync_pages(ptr_t mnt,
invalidate:
*mapping.pte &= ~PG_PRESENT;
pmm_free_page(KERNEL_PID, mapping.pa);
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);
}
}
}
}