struct pmap *pv_pmap;
LIST_HEAD(pte_ovtab, pte_ovfl) *potable; /* Overflow entries for ptable */struct pmap kernel_pmap_;int physmem;static int npgs;static u_int nextavail;static struct mem_region *mem, *avail;#if 0voiddump_avail(){	int cnt;	struct mem_region *mp;	extern struct mem_region *avail;		printf("memory %x\n", mem);	for (cnt = 0, mp = mem; mp->size; mp++) {		printf("memory region %x: start %x, size %x\n",				cnt, mp->size, mp->start);		cnt++;	}	printf("available %x\n", avail);	for (cnt = 0, mp = avail; mp->size; mp++) {		printf("avail region %x: start %x, size %x\n",				cnt, mp->size, mp->start);		cnt++;	}}#endif/* * This is a cache of referenced/modified bits. * Bits herein are shifted by ATTRSHFT. */static char *pmap_attrib;#define	ATTRSHFT	4struct pv_entry {	struct pv_entry *pv_next;	/* Linked list of mappings */	int pv_idx;			/* Index into ptable */	vm_offset_t pv_va;		/* virtual address of mapping */};struct pv_entry *pv_table;struct pv_page;struct pv_page_info {	LIST_ENTRY(pv_page) pgi_list;	struct pv_entry *pgi_freelist;	int pgi_nfree;};#define	NPVPPG	((NBPG - sizeof(struct pv_page_info)) / sizeof(struct pv_entry))struct pv_page {	struct pv_page_info pvp_pgi;	struct pv_entry pvp_pv[NPVPPG];};LIST_HEAD(pv_page_list, pv_page) pv_page_freelist;int pv_nfree;int pv_pcnt;static struct pv_entry *pmap_alloc_pv __P((void));static void pmap_free_pv __P((struct pv_entry *));struct po_page;struct po_page_info {	LIST_ENTRY(po_page) pgi_list;	vm_page_t pgi_page;	LIST_HEAD(po_freelist, pte_ovfl) pgi_freelist;	int pgi_nfree;};#define	NPOPPG	((NBPG - sizeof(struct po_page_info)) / sizeof(struct pte_ovfl))struct po_page {	struct po_page_info pop_pgi;	struct pte_ovfl pop_po[NPOPPG];};LIST_HEAD(po_page_list, po_page) po_page_freelist;int po_nfree;int po_pcnt;static struct pte_ovfl *poalloc __P((void));static void pofree __P((struct pte_ovfl *, int));static u_int usedsr[NPMAPS / sizeof(u_int) / 8];static int pmap_initialized;/* * These small routines may have to be replaced, * if/when we support processors other that the 604. */static inline voidtlbie(ea)	caddr_t ea;{	asm volatile ("tlbie %0" :: "r"(ea));}