aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/mini-os/lib/sys.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 1284f5a714..6e12be0f4a 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -1256,11 +1256,8 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset
unsigned long zero = 0;
return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, 0, 0);
} else if (files[fd].type == FTYPE_MEM) {
- int i;
- unsigned long mfns[n];
- for (i = 0; i < n; i++)
- mfns[i] = ((unsigned long) offset + (i * PAGE_SIZE)) >> PAGE_SHIFT;
- return map_frames_ex(mfns, n, 1, 0, 1, DOMID_IO, 0, _PAGE_PRESENT|_PAGE_RW);
+ unsigned long first_mfn = offset >> PAGE_SHIFT;
+ return map_frames_ex(&first_mfn, n, 0, 1, 1, DOMID_IO, 0, _PAGE_PRESENT|_PAGE_RW);
} else ASSERT(0);
}