aprot = m88k_protection(prot);
aprot = m88k_protection(kernel_pmap, prot);
pmap_map_batc(virt, start, end, prot, cmode)	vm_offset_t virt, start, end;	vm_prot_t prot;	unsigned int cmode;{	int		aprot;	unsigned	num_phys_pages;	vm_offset_t	phys;	pt_entry_t	*pte;	pte_template_t	template;	batc_template_t	batctmp;	register int	i;#ifdef DEBUG	if ((pmap_con_dbg & (CD_MAPB | CD_FULL)) == (CD_MAPB | CD_FULL))		printf ("(pmap_map_batc :%x) phys address from %x to %x mapped at virtual %x, prot %x\n", curproc,			start, end, virt, prot);#endif#ifdef DIAGNOSTIC	if (start > end)		panic("pmap_map_batc: start greater than end address");#endif	aprot = m88k_protection(prot);	template.bits = trunc_page(start) | aprot | DT_VALID | cmode;	phys = start;	batctmp.bits = 0;	batctmp.field.sup = 1;	     /* supervisor */	batctmp.field.wt = template.pte.wt;	 /* write through */	batctmp.field.g = template.pte.g;     /* global */	batctmp.field.ci = template.pte.ci;	 /* cache inhibit */	batctmp.field.wp = template.pte.prot; /* protection */	batctmp.field.v = 1;	     /* valid */	num_phys_pages = atop(round_page(end) - 				   trunc_page(start));	while (num_phys_pages > 0) {#ifdef DEBUG		if ((pmap_con_dbg & (CD_MAPB | CD_FULL)) == (CD_MAPB | CD_FULL))			printf("(pmap_map_batc :%x) num_phys_pg=%x, virt=%x, aligne V=%d, phys=%x, aligne P=%d\n", curproc,			       num_phys_pages, virt, BATC_BLK_ALIGNED(virt), phys, BATC_BLK_ALIGNED(phys));#endif		if ( BATC_BLK_ALIGNED(virt) && BATC_BLK_ALIGNED(phys) && 		     num_phys_pages >= BATC_BLKBYTES/PAGE_SIZE &&		     batc_used < BATC_MAX ) {			/*			 * map by BATC			 */			batctmp.field.lba = M88K_BTOBLK(virt);			batctmp.field.pba = M88K_BTOBLK(phys);			for (i = 0; i < max_cpus; i++)				if (cpu_sets[i])					cmmu_set_pair_batc_entry(i, batc_used, 								 batctmp.bits);			batc_entry[batc_used] = batctmp.field;#ifdef DEBUG			if ((pmap_con_dbg & (CD_MAPB | CD_NORM)) == (CD_MAPB | CD_NORM)) {				printf("(pmap_map_batc :%x) BATC used=%d, data=%x\n", curproc, batc_used, batctmp.bits);			}			if (pmap_con_dbg & CD_MAPB) {				for (i = 0; i < BATC_BLKBYTES; i += PAGE_SIZE ) {					pte = pmap_pte(kernel_pmap, virt+i);					if (pte->dtype)						printf("(pmap_map_batc :%x) va %x is already mapped : pte %x\n", curproc, virt+i, ((pte_template_t *)pte)->bits);				}			}#endif			batc_used++;			virt += BATC_BLKBYTES;			phys += BATC_BLKBYTES;			template.pte.pfn = atop(phys);			num_phys_pages -= BATC_BLKBYTES/PAGE_SIZE;			continue;		}		if ((pte = pmap_pte(kernel_pmap, virt)) == PT_ENTRY_NULL)			if ((pte = pmap_expand_kmap(virt, VM_PROT_READ|VM_PROT_WRITE)) == PT_ENTRY_NULL)				panic("pmap_map_batc: Cannot allocate pte table");#ifdef	DEBUG		if (pmap_con_dbg & CD_MAPB)			if (pte->dtype)				printf("(pmap_map_batc :%x) pte @ 0x%x already valid\n", curproc, (unsigned)pte);#endif		*pte = template.pte;		virt += PAGE_SIZE;		phys += PAGE_SIZE;		template.bits += PAGE_SIZE;		num_phys_pages--;	}	return (round_page(virt));} /* pmap_map_batc() */