summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/lock.c4
-rw-r--r--kern/zalloc.c14
2 files changed, 15 insertions, 3 deletions
diff --git a/kern/lock.c b/kern/lock.c
index 909aa46..0c61227 100644
--- a/kern/lock.c
+++ b/kern/lock.c
@@ -104,7 +104,7 @@ boolean_t simple_lock_try(simple_lock_t l)
#endif /* NCPUS > 1 */
#if NCPUS > 1
-int lock_wait_time = 100;
+static int lock_wait_time = 100;
#else /* NCPUS > 1 */
/*
@@ -112,7 +112,7 @@ int lock_wait_time = 100;
* thought something magical would happen to the
* want_write bit while we are executing.
*/
-int lock_wait_time = 0;
+static int lock_wait_time = 0;
#endif /* NCPUS > 1 */
#if MACH_SLOCKS && NCPUS == 1
diff --git a/kern/zalloc.c b/kern/zalloc.c
index 839e40f..f2904e4 100644
--- a/kern/zalloc.c
+++ b/kern/zalloc.c
@@ -214,7 +214,7 @@ zone_t zinit(size, align, max, alloc, memtype, name)
max = alloc;
if (align > 0) {
- if (align >= PAGE_SIZE)
+ if (PAGE_SIZE % align || align % sizeof(z->free_elements))
panic("zinit");
ALIGN_SIZE_UP(size, align);
}
@@ -828,6 +828,18 @@ static void zone_gc(void)
free_addr = zone_map_min_address +
PAGE_SIZE * (freep - zone_page_table);
+
+ /* Hack Hack */
+ /* Needed to make vm_map_delete's vm_map_clip_end always be
+ * able to get an element without having to call zget_space and
+ * hang because zone_map is already locked by vm_map_delete */
+
+ extern zone_t vm_map_kentry_zone; /* zone for kernel entry structures */
+ vm_offset_t entry1 = zalloc(vm_map_kentry_zone),
+ entry2 = zalloc(vm_map_kentry_zone);
+ zfree(vm_map_kentry_zone, entry1);
+ zfree(vm_map_kentry_zone, entry2);
+
kmem_free(zone_map, free_addr, PAGE_SIZE);
}
}