diff options
author | alc <alc@FreeBSD.org> | 2005-06-10 03:33:36 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2005-06-10 03:33:36 +0000 |
commit | 2d109601cbaeb90e93aad0948a9367a78f196f9d (patch) | |
tree | 1fda0878f37dc5e54399f30ad5588c0876f46516 /sys/arm | |
parent | 5273b0bf9faa803d4d586ba6d8c03c9d340e85c9 (diff) | |
download | FreeBSD-src-2d109601cbaeb90e93aad0948a9367a78f196f9d.zip FreeBSD-src-2d109601cbaeb90e93aad0948a9367a78f196f9d.tar.gz |
Introduce a procedure, pmap_page_init(), that initializes the
vm_page's machine-dependent fields. Use this function in
vm_pageq_add_new_page() so that the vm_page's machine-dependent and
machine-independent fields are initialized at the same time.
Remove code from pmap_init() for initializing the vm_page's
machine-dependent fields.
Remove stale comments from pmap_init().
Eliminate the Boolean variable pmap_initialized from the alpha, amd64,
i386, and ia64 pmap implementations. Its use is no longer required
because of the above changes and earlier changes that result in physical
memory that is being mapped at initialization time being mapped without
pv entries.
Tested by: cognet, kensmith, marcel
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/pmap.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c index f7d80d8..e98e2ba 100644 --- a/sys/arm/arm/pmap.c +++ b/sys/arm/arm/pmap.c @@ -1927,32 +1927,27 @@ pmap_pinit0(struct pmap *pmap) bcopy(kernel_pmap, pmap, sizeof(*pmap)); } +/* + * Initialize a vm_page's machine-dependent fields. + */ +void +pmap_page_init(vm_page_t m) +{ + + TAILQ_INIT(&m->md.pv_list); + m->md.pv_list_count = 0; +} /* * Initialize the pmap module. * Called by vm_init, to initialize any structures that the pmap * system needs to map virtual memory. - * pmap_init has been enhanced to support in a fairly consistant - * way, discontiguous physical memory. */ void pmap_init(void) { - int i; PDEBUG(1, printf("pmap_init: phys_start = %08x\n")); - /* - * Allocate memory for random pmap data structures. Includes the - * pv_head_table. - */ - - for(i = 0; i < vm_page_array_size; i++) { - vm_page_t m; - - m = &vm_page_array[i]; - TAILQ_INIT(&m->md.pv_list); - m->md.pv_list_count = 0; - } /* * init the pv free list @@ -3156,7 +3151,7 @@ pmap_remove_all(vm_page_t m) * XXX this makes pmap_page_protect(NONE) illegal for non-managed * pages! */ - if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) { + if (m->flags & PG_FICTITIOUS) { panic("pmap_page_protect: illegal for unmanaged page, va: 0x%x", VM_PAGE_TO_PHYS(m)); } #endif @@ -4331,7 +4326,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_page_t m) int loops = 0; int s; - if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) + if (m->flags & PG_FICTITIOUS) return (FALSE); s = splvm(); |