/*
- * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
uint64_t pmap_pv_throttle_stat, pmap_pv_throttled_waiters;
+int pmap_asserts_enabled = (DEBUG);
+int pmap_asserts_traced = 0;
+
unsigned int pmap_cache_attributes(ppnum_t pn) {
if (pmap_get_cache_attributes(pn, FALSE) & INTEL_PTE_NCACHE)
return (VM_WIMG_IO);
boolean_t
pmap_has_managed_page(ppnum_t first, ppnum_t last)
{
- ppnum_t pn;
- boolean_t result;
+ ppnum_t pn, kdata_start, kdata_end;
+ boolean_t result;
+ boot_args * args;
+
+ args = (boot_args *) PE_state.bootArgs;
+
+ // Allow pages that the booter added to the end of the kernel.
+ // We may miss reporting some pages in this range that were freed
+ // with ml_static_free()
+ kdata_start = atop_32(args->kaddr);
+ kdata_end = atop_32(args->kaddr + args->ksize);
assert(last_managed_page);
assert(first <= last);
&& (pn <= last_managed_page);
pn++)
{
+ if ((pn >= kdata_start) && (pn < kdata_end)) continue;
result = (0 != (pmap_phys_attributes[pn] & PHYS_MANAGED));
}
unsigned pmap_user_reserve_replenish_stat;
unsigned pmap_kern_reserve_alloc_stat;
-void mapping_replenish(void)
+__attribute__((noreturn))
+void
+mapping_replenish(void)
{
pv_hashed_entry_t pvh_e;
pv_hashed_entry_t pvh_eh;