From 94b2c453829b3aebdaccf7d3d252136b283002b3 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 9 Nov 2014 22:31:21 +0100 Subject: Deal with odd kernel behavior Some versions of gnumach actually take address as a mapping hint, and would fail if the hint is bogus. Make sure to pass 0 for those versions. * console/pager.c (user_pager_create): Make sure to set *user to 0 before calling vm_map. * libdiskfs/disk-pager.c (diskfs_start_disk_pager): Make sure to set *image to 0 before calling vm_map. * libpager/pager-memcpy.c (pager_memcpy): Set window to 0 before calling vm_map. * tmpfs/node.c (diskfs_get_filemap): Make sure to set np->dn->u.reg.memref to 0 before calling vm_map. --- console/pager.c | 1 + 1 file changed, 1 insertion(+) (limited to 'console') diff --git a/console/pager.c b/console/pager.c index 3568211e..5e13ba48 100644 --- a/console/pager.c +++ b/console/pager.c @@ -169,6 +169,7 @@ user_pager_create (struct user_pager *user_pager, unsigned int npages, mach_port_insert_right (mach_task_self (), user_pager->memobj, user_pager->memobj, MACH_MSG_TYPE_MAKE_SEND); + *user = 0; err = vm_map (mach_task_self (), (vm_address_t *) user, (vm_size_t) npages * vm_page_size, -- cgit v1.2.3