diff options
Diffstat (limited to 'sys/amd64')
| -rw-r--r-- | sys/amd64/amd64/pmap.c | 55 | ||||
| -rw-r--r-- | sys/amd64/include/pmap.h | 5 | ||||
| -rw-r--r-- | sys/amd64/isa/isa_dma.c | 4 |
3 files changed, 7 insertions, 57 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7292906fbc577..fc10df9de22ff 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -146,8 +146,7 @@ #define pte_prot(m, p) (protection_codes[p]) static int protection_codes[8]; -static struct pmap kernel_pmap_store; -pmap_t kernel_pmap; +struct pmap kernel_pmap_store; LIST_HEAD(pmaplist, pmap); struct pmaplist allpmaps; @@ -306,14 +305,9 @@ pmap_bootstrap(firstaddr, loadaddr) i386_protection_init(); /* - * The kernel's pmap is statically allocated so we don't have to use - * pmap_create, which is unlikely to work correctly at this part of - * the boot sequence (XXX and which no longer exists). + * Initialize the kernel pmap (which is statically allocated). */ - kernel_pmap = &kernel_pmap_store; - kernel_pmap->pm_pdir = (pd_entry_t *) (KERNBASE + (u_int)IdlePTD); - kernel_pmap->pm_count = 1; kernel_pmap->pm_active = -1; /* don't allow deactivation */ TAILQ_INIT(&kernel_pmap->pm_pvlist); LIST_INIT(&allpmaps); @@ -1281,7 +1275,6 @@ pmap_pinit0(pmap) pmap->pm_pdir = (pd_entry_t *)kmem_alloc_pageable(kernel_map, PAGE_SIZE); pmap_kenter((vm_offset_t) pmap->pm_pdir, (vm_offset_t) IdlePTD); - pmap->pm_count = 1; pmap->pm_ptphint = NULL; pmap->pm_active = 0; TAILQ_INIT(&pmap->pm_pvlist); @@ -1342,7 +1335,6 @@ pmap_pinit(pmap) pmap->pm_pdir[PTDPTDI] = VM_PAGE_TO_PHYS(ptdpg) | PG_V | PG_RW | PG_A | PG_M; - pmap->pm_count = 1; pmap->pm_active = 0; pmap->pm_ptphint = NULL; TAILQ_INIT(&pmap->pm_pvlist); @@ -1642,39 +1634,9 @@ pmap_growkernel(vm_offset_t addr) splx(s); } -/* - * Retire the given physical map from service. - * Should only be called if the map contains - * no valid mappings. - */ -void -pmap_destroy(pmap_t pmap) -{ - int count; - - if (pmap == NULL) - return; - - count = --pmap->pm_count; - if (count == 0) { - pmap_release(pmap); - panic("destroying a pmap is not yet implemented"); - } -} - -/* - * Add a reference to the specified pmap. - */ -void -pmap_reference(pmap_t pmap) -{ - if (pmap != NULL) { - pmap->pm_count++; - } -} /*************************************************** -* page management routines. + * page management routines. ***************************************************/ /* @@ -2846,17 +2808,6 @@ printf ("IT HAPPENNED!"); } /* - * Routine: pmap_kernel - * Function: - * Returns the physical map handle for the kernel. - */ -pmap_t -pmap_kernel() -{ - return (kernel_pmap); -} - -/* * pmap_zero_page zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. */ diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 7348b67a3e952..ca3fe525acd31 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -208,7 +208,6 @@ struct pmap { pd_entry_t *pm_pdir; /* KVA of page directory */ vm_object_t pm_pteobj; /* Container for pte's */ TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ - int pm_count; /* reference count */ int pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ struct vm_page *pm_ptphint; /* pmap ptp hint */ @@ -220,7 +219,8 @@ struct pmap { typedef struct pmap *pmap_t; #ifdef _KERNEL -extern pmap_t kernel_pmap; +extern struct pmap kernel_pmap_store; +#define kernel_pmap (&kernel_pmap_store) #endif /* @@ -262,7 +262,6 @@ extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; void pmap_bootstrap( vm_offset_t, vm_offset_t); -pmap_t pmap_kernel(void); void *pmap_mapdev(vm_offset_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); pt_entry_t *pmap_pte(pmap_t, vm_offset_t) __pure2; diff --git a/sys/amd64/isa/isa_dma.c b/sys/amd64/isa/isa_dma.c index 36bd2e58366c9..3b6e231119205 100644 --- a/sys/amd64/isa/isa_dma.c +++ b/sys/amd64/isa/isa_dma.c @@ -257,7 +257,7 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) } /* translate to physical */ - phys = pmap_extract(pmap_kernel(), (vm_offset_t)addr); + phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); if (flags & ISADMA_RAW) { dma_auto_mode |= (1 << chan); @@ -380,7 +380,7 @@ isa_dmarangecheck(caddr_t va, u_int length, int chan) endva = (vm_offset_t)round_page((vm_offset_t)va + length); for (; va < (caddr_t) endva ; va += PAGE_SIZE) { - phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va)); + phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va)); #define ISARAM_END RAM_END if (phys == 0) panic("isa_dmacheck: no physical page present"); |
