--- Gnu-Mach/i386/intel/pmap.c 2020/09/02 04:49:25 1.1.1.4 +++ Gnu-Mach/i386/intel/pmap.c 2020/09/02 04:53:40 1.1.1.6 @@ -83,6 +83,7 @@ #include #include #include +#include #ifdef MACH_PSEUDO_PHYS #define WRITE_PTE(pte_p, pte_entry) *(pte_p) = pte_entry?pa_to_ma(pte_entry):0; @@ -166,7 +167,7 @@ vm_offset_t kernel_virtual_end; #define unlock_pvh_pai(pai) (bit_unlock(pai, pv_lock_table)) /* - * Array of physical page attribites for managed pages. + * Array of physical page attributes for managed pages. * One byte per physical page. */ char *pmap_phys_attributes; @@ -642,7 +643,7 @@ void pmap_bootstrap(void) kernel_pmap->dirbase = kernel_page_dir = (pt_entry_t*)phystokv(pmap_grab_page()); #endif /* PAE */ { - int i; + unsigned i; for (i = 0; i < NPDES; i++) kernel_pmap->dirbase[i] = 0; } @@ -677,7 +678,7 @@ void pmap_bootstrap(void) l2_map += (la >> PDESHIFT) & PDEMASK; if (!(*l2_map & INTEL_PTE_VALID)) { struct mmu_update update; - int j, n; + unsigned j, n; l1_map[n_l1map] = (pt_entry_t*) phystokv(pmap_grab_page()); for (j = 0; j < NPTES; j++) @@ -856,11 +857,11 @@ void pmap_set_page_readonly_init(void *_ } void pmap_clear_bootstrap_pagetable(pt_entry_t *base) { - int i; + unsigned i; pt_entry_t *dir; vm_offset_t va = 0; #if PAE - int j; + unsigned j; #endif /* PAE */ if (!hyp_mmuext_op_mfn (MMUEXT_UNPIN_TABLE, kv_to_mfn(base))) panic("pmap_clear_bootstrap_pagetable: couldn't unpin page %p(%p)\n", base, (vm_offset_t) kv_to_ma(base)); @@ -977,9 +978,9 @@ void pmap_init(void) * and of the physical-to-virtual entries. */ s = (vm_size_t) sizeof(struct pmap); - kmem_cache_init(&pmap_cache, "pmap", s, 0, NULL, NULL, NULL, 0); + kmem_cache_init(&pmap_cache, "pmap", s, 0, NULL, 0); s = (vm_size_t) sizeof(struct pv_entry); - kmem_cache_init(&pv_list_cache, "pv_entry", s, 0, NULL, NULL, NULL, 0); + kmem_cache_init(&pv_list_cache, "pv_entry", s, 0, NULL, 0); #if NCPUS > 1 /* @@ -1585,8 +1586,8 @@ void pmap_page_protect( /* * Consistency checks. */ - /* assert(*pte & INTEL_PTE_VALID); XXX */ - /* assert(pte_to_phys(*pte) == phys); */ + assert(*pte & INTEL_PTE_VALID); + assert(pte_to_pa(*pte) == phys); /* * Remove the mapping if new protection is NONE @@ -1597,7 +1598,7 @@ void pmap_page_protect( * Remove the mapping, collecting any modify bits. */ if (*pte & INTEL_PTE_WIRED) - panic("pmap_remove_all removing a wired page"); + panic("pmap_page_protect removing a wired page"); { int i = ptes_per_vm_page; @@ -2463,13 +2464,11 @@ phys_attribute_clear( va = pv_e->va; pte = pmap_pte(pmap, va); -#if 0 /* * Consistency checks. */ assert(*pte & INTEL_PTE_VALID); - /* assert(pte_to_phys(*pte) == phys); */ -#endif + assert(pte_to_pa(*pte) == phys); /* * Clear modify or reference bits. @@ -2556,13 +2555,11 @@ phys_attribute_test( va = pv_e->va; pte = pmap_pte(pmap, va); -#if 0 /* * Consistency checks. */ assert(*pte & INTEL_PTE_VALID); - /* assert(pte_to_phys(*pte) == phys); */ -#endif + assert(pte_to_pa(*pte) == phys); } /*