void	i386_protection_init __P((void));
TAILQ_HEAD(pv_page_list, pv_page) pv_page_freelist;int		pv_nfree;pt_entry_t *pmap_pte __P((pmap_t, vm_offset_t));#if BSDVM_COMPAT#include <sys/msgbuf.h>/* * All those kernel PT submaps that BSD is so fond of */pt_entry_t	*CMAP1, *CMAP2, *XXX_mmap;caddr_t		CADDR1, CADDR2, vmmap;pt_entry_t	*msgbufmap;#endif	/* BSDVM_COMPAT *//* *	Bootstrap the system enough to run with virtual memory. *	Map the kernel's code and data, and allocate the system page table. * *	On the I386 this is called after mapping has already been enabled *	and just syncs the pmap module with what has already been done. *	[We can't call it easily with mapping off since the kernel is not *	mapped with PA == VA, hence we would have to relocate every address *	from the linked base (virtual) address to the actual (physical) *	address starting relative to 0] */voidpmap_bootstrap(virtual_start)	vm_offset_t virtual_start;{#if BSDVM_COMPAT	vm_offset_t va;	pt_entry_t *pte;#endif	extern int physmem;	extern vm_offset_t reserve_dumppages(vm_offset_t);	/* XXX: allow for msgbuf */	avail_end -= i386_round_page(sizeof(struct msgbuf));	virtual_avail = virtual_start;	virtual_end = VM_MAX_KERNEL_ADDRESS;	/*	 * Initialize protection array.	 */	i386_protection_init();#ifdef notdef	/*	 * Create Kernel page directory table and page maps.	 * [ currently done in locore. i have wild and crazy ideas -wfj ]	 */	bzero(firstaddr, (1+NKPDE)*NBPG);	pmap_kernel()->pm_pdir = firstaddr + VM_MIN_KERNEL_ADDRESS;	pmap_kernel()->pm_ptab = firstaddr + VM_MIN_KERNEL_ADDRESS + NBPG;	firstaddr += NBPG;	for (x = i386_btod(VM_MIN_KERNEL_ADDRESS);	     x < i386_btod(VM_MIN_KERNEL_ADDRESS) + NKPDE; x++) {		pd_entry_t *pde;		pde = pmap_kernel()->pm_pdir + x;		*pde = (firstaddr + x*NBPG) | PG_V | PG_KW;	}#else	pmap_kernel()->pm_pdir =	    (pd_entry_t *)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);#endif	simple_lock_init(&pmap_kernel()->pm_lock);	pmap_kernel()->pm_count = 1;#if BSDVM_COMPAT	/*	 * Allocate all the submaps we need	 */#define	SYSMAP(c, p, v, n)	\	v = (c)va; va += ((n)*NBPG); p = pte; pte += (n);	va = virtual_avail;	pte = pmap_pte(pmap_kernel(), va);	SYSMAP(caddr_t		,CMAP1		,CADDR1	   ,1		)	SYSMAP(caddr_t		,CMAP2		,CADDR2	   ,1		)	SYSMAP(caddr_t		,XXX_mmap	,vmmap	   ,1		)	SYSMAP(struct msgbuf *	,msgbufmap	,msgbufp   ,1		)	virtual_avail = va;#endif	/*	 * Reserve pmap space for mapping physical pages during dump.	 */	virtual_avail = reserve_dumppages(virtual_avail);	/*	 * reserve special hunk of memory for use by bus dma as a bounce	 * buffer (contiguous virtual *and* physical memory).  XXX	 */#if NISA > 0 && NISADMA > 0	if (ctob(physmem) >= 0x1000000) {		isaphysmem = pmap_steal_memory(DMA_BOUNCE * NBPG);		isaphysmempgs = DMA_BOUNCE;	} else {		isaphysmem = pmap_steal_memory(DMA_BOUNCE_LOW * NBPG);		isaphysmempgs = DMA_BOUNCE_LOW;	}#endif	pmap_update();}