DPRINTF(PDB_INIT, ("stealspool: 0x%x @ 0x%x\n", virtual_avail - virtual_steal, virtual_steal));
pmap_bootstrap(vstart)	vaddr_t vstart;{	extern char etext, etext1;	extern u_int totalphysmem, *ie_mem;	vaddr_t addr = hppa_round_page(vstart), t;	vsize_t size;#if 0 && (defined(HP7100LC_CPU) || defined(HP7300LC_CPU))	struct vp_entry *hptp;#endif	struct pmap *kpm;	int i;	DPRINTF(PDB_FOLLOW|PDB_INIT, ("pmap_bootstrap(0x%x)\n", vstart));	uvm_setpagesize();	hppa_prot[VM_PROT_NONE | VM_PROT_NONE  | VM_PROT_NONE]    =TLB_AR_NA;	hppa_prot[VM_PROT_READ | VM_PROT_NONE  | VM_PROT_NONE]    =TLB_AR_R;	hppa_prot[VM_PROT_NONE | VM_PROT_WRITE | VM_PROT_NONE]    =TLB_AR_RW;	hppa_prot[VM_PROT_READ | VM_PROT_WRITE | VM_PROT_NONE]    =TLB_AR_RW;	hppa_prot[VM_PROT_NONE | VM_PROT_NONE  | VM_PROT_EXECUTE] =TLB_AR_RX;	hppa_prot[VM_PROT_READ | VM_PROT_NONE  | VM_PROT_EXECUTE] =TLB_AR_RX;	hppa_prot[VM_PROT_NONE | VM_PROT_WRITE | VM_PROT_EXECUTE] =TLB_AR_RWX;	hppa_prot[VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE] =TLB_AR_RWX;	/*	 * Initialize kernel pmap	 */	kpm = &kernel_pmap_store;	bzero(kpm, sizeof(*kpm));	simple_lock_init(&kpm->pm_obj.vmobjlock);	kpm->pm_obj.pgops = NULL;	TAILQ_INIT(&kpm->pm_obj.memq);	kpm->pm_obj.uo_npages = 0;	kpm->pm_obj.uo_refs = 1;	kpm->pm_space = HPPA_SID_KERNEL;	kpm->pm_pid = HPPA_PID_KERNEL;	kpm->pm_pdir_pg = NULL;	kpm->pm_pdir = addr;	addr += PAGE_SIZE;	bzero((void *)addr, PAGE_SIZE);	fdcache(HPPA_SID_KERNEL, addr, PAGE_SIZE);	/*	 * Allocate various tables and structures.	 */	mtctl(addr, CR_VTOP);	bzero((void *)addr, (hppa_sid_max + 1) * 4);	fdcache(HPPA_SID_KERNEL, addr, (hppa_sid_max + 1) * 4);	printf("vtop: 0x%x @ 0x%x\n", (hppa_sid_max + 1) * 4, addr);	addr += (hppa_sid_max + 1) * 4;	pmap_sdir_set(HPPA_SID_KERNEL, kpm->pm_pdir);	ie_mem = (u_int *)addr;	addr += 0x8000;#if 0 && (defined(HP7100LC_CPU) || defined(HP7300LC_CPU))	if (pmap_hptsize && (cpu_type == hpcxl || cpu_type == hpcxl2)) {		int error;		if (pmap_hptsize > pdc_hwtlb.max_size)			pmap_hptsize = pdc_hwtlb.max_size;		else if (pmap_hptsize < pdc_hwtlb.min_size)			pmap_hptsize = pdc_hwtlb.min_size;		size = pmap_hptsize * sizeof(*hptp);		bzero((void *)addr, size);		/* Allocate the HPT */		for (hptp = (struct vp_entry *)addr, i = pmap_hptsize; i--;)			hptp[i].vp_tag = 0xffff;		DPRINTF(PDB_INIT, ("hpt_table: 0x%x @ %p\n", size, addr));		if ((error = (cpu_hpt_init)(addr, size)) < 0) {			printf("WARNING: HPT init error %d\n", error);		} else {			printf("HPT: %d entries @ 0x%x\n",			    pmap_hptsize / sizeof(struct vp_entry), addr);		}		/* TODO find a way to avoid using cr*, use cpu regs instead */		mtctl(addr, CR_VTOP);		mtctl(size - 1, CR_HPTMASK);		addr += size;	}#endif	/* HP7100LC_CPU | HP7300LC_CPU */	/* map the kernel space, which will give us virtual_avail */	vstart = hppa_round_page(addr + (totalphysmem - (atop(addr))) *	    (16 + sizeof(struct pv_head) + sizeof(struct vm_page)));	/* XXX PCXS needs two separate inserts in separate btlbs */	t = (vaddr_t)&etext1;	if (btlb_insert(HPPA_SID_KERNEL, 0, 0, &t,	    pmap_sid2pid(HPPA_SID_KERNEL) |	    pmap_prot(pmap_kernel(), VM_PROT_READ|VM_PROT_EXECUTE)) < 0)		panic("pmap_bootstrap: cannot block map kernel text");	t = vstart - (vaddr_t)&etext1;	if (btlb_insert(HPPA_SID_KERNEL, (vaddr_t)&etext1, (vaddr_t)&etext1, &t,	    pmap_sid2pid(HPPA_SID_KERNEL) | TLB_UNCACHABLE |	    pmap_prot(pmap_kernel(), VM_PROT_ALL)) < 0)		panic("pmap_bootstrap: cannot block map kernel");	vstart = (vaddr_t)&etext1 + t;	virtual_avail = vstart;	kpm->pm_stats.wired_count = kpm->pm_stats.resident_count =	    physmem = atop(vstart);	if (&etext < &etext1) {		physical_steal = (vaddr_t)&etext;		physical_end = (vaddr_t)&etext1;	}	/*	 * NOTE: we no longer trash the BTLB w/ unused entries,	 * lazy map only needed pieces (see bus_mem_add_mapping() for refs).	 */	addr = hppa_round_page(addr);	size = hppa_round_page(sizeof(struct pv_head) * totalphysmem);	bzero ((caddr_t)addr, size);	DPRINTF(PDB_INIT, ("pmseg.pvent: 0x%x @ 0x%x\n", size, addr));	/* XXX we might need to split this for isa */	virtual_steal = addr + size;	i = atop(virtual_avail - virtual_steal);	uvm_page_physload(0, totalphysmem + i,		atop(virtual_avail), totalphysmem + i, VM_FREELIST_DEFAULT);	/* we have only one initial phys memory segment */	vm_physmem[0].pmseg.pvhead = (struct pv_head *)addr;}