summaryrefslogtreecommitdiff
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index e0644fa..26effdb 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -245,11 +245,6 @@ mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
goto done;
}
- if (addr == NULL) {
- pr_error("mmap: NULL addr not supported\n");
- return NULL;
- }
-
/* Only allocate new obj if needed */
if (map_obj == NULL) {
map_obj = dynalloc(sizeof(*map_obj));
@@ -278,6 +273,12 @@ mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off)
return NULL;
}
+ /* TODO: copy-on-write */
+ if (addr == NULL) {
+ va = pg->phys_addr;
+ addr = (void *)va;
+ }
+
pa = pg->phys_addr;
error = vm_map(vas, va + page_off, pa, prot, len);
if (error < 0) {