pmap_update(pmap_kernel());
dumpsys(){	int psize;	daddr_t blkno;	int (*dump)	__P((dev_t, daddr_t, caddr_t, size_t));	int error = 0;	struct memarr *mp;	int nmem;	extern struct memarr pmemarr[];	extern int npmemarr;	/* copy registers to memory */	snapshot(cpcb);	stackdump();	if (dumpdev == NODEV)		return;	/*	 * For dumps during autoconfiguration,	 * if dump device has already configured...	 */	if (dumpsize == 0)		dumpconf();	if (dumplo <= 0)		return;	printf("\ndumping to dev(%d,%d), at offset %ld blocks\n",	    major(dumpdev), minor(dumpdev), dumplo);	psize = (*bdevsw[major(dumpdev)].d_psize)(dumpdev);	printf("dump ");	if (psize == -1) {		printf("area unavailable\n");		return;	}	blkno = dumplo;	dump = bdevsw[major(dumpdev)].d_dump;	printf("mmu ");	error = pmap_dumpmmu(dump, blkno);	blkno += ctod(pmap_dumpsize());	printf("memory ");	for (mp = pmemarr, nmem = npmemarr; --nmem >= 0 && error == 0; mp++) {		unsigned i = 0, n;		unsigned maddr = mp->addr;		/* XXX - what's so special about PA 0 that we can't dump it? */		if (maddr == 0) {			/* Skip first page at physical address 0 */			maddr += NBPG;			i += NBPG;			blkno += btodb(NBPG);		}		printf("@%p:",maddr);		for (; i < mp->len; i += n) {			n = mp->len - i;			if (n > BYTES_PER_DUMP)				 n = BYTES_PER_DUMP;			/* print out which MBs we are dumping */			if (i % (1024*1024) <= NBPG)				printf("%d ", i / (1024*1024));			(void) pmap_map(dumpspace, maddr, maddr + n,					VM_PROT_READ);			pmap_update(pmap_kernel());			error = (*dump)(dumpdev, blkno,					(caddr_t)dumpspace, (int)n);			pmap_remove(pmap_kernel(), dumpspace, dumpspace + n);			pmap_update(pmap_kernel());			if (error)				break;			maddr += n;			blkno += btodb(n);		}	}	switch (error) {	case ENXIO:		printf("device bad\n");		break;	case EFAULT:		printf("device not ready\n");		break;	case EINVAL:		printf("area improper\n");		break;	case EIO:		printf("i/o error\n");		break;	case 0:		printf("succeeded\n");		break;	default:		printf("error %d\n", error);		break;	}}