FreeBSD/sys/i386/i386/pmap.c
/*
 *	pmap_copy_page copies the specified (machine independent)
 *	page by mapping the page into virtual memory and using
 *	bcopy to copy the page, one machine dependent page at a
 *	time.
 */
pmap_copy_page copies the specified (machine independent)
page by mapping the page into virtual memory and using
bcopy to copy the page, one machine dependent page at a
time.
pmap_copy_page copies the specified ( machine independent ) page by mapping the page into virtual memory and using bcopy to copy the page one machine dependent page at a time .
void
pmap_copy_page(vm_page_t src, vm_page_t dst)
{
	struct sysmaps *sysmaps;
	sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
	mtx_lock(&sysmaps->lock);
	if (*sysmaps->CMAP1)
		panic("pmap_copy_page: CMAP1 busy");
	if (*sysmaps->CMAP2)
		panic("pmap_copy_page: CMAP2 busy");
	sched_pin();
	*sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A |
	    pmap_cache_bits(src->md.pat_mode, 0);
	invlcaddr(sysmaps->CADDR1);
	*sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M |
	    pmap_cache_bits(dst->md.pat_mode, 0);
	invlcaddr(sysmaps->CADDR2);
	bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE);
	*sysmaps->CMAP1 = 0;
	*sysmaps->CMAP2 = 0;
	sched_unpin();
	mtx_unlock(&sysmaps->lock);
}
void pmap_copy_page ( vm_page_t src , vm_page_t dst ) { struct sysmaps * sysmaps ; sysmaps = & sysmaps_pcpu [ PCPU_GET ( cpuid ) ] ; mtx_lock ( & sysmaps -> lock ) ; if ( * sysmaps -> CMAP1 ) panic ( " " ) ; if ( * sysmaps -> CMAP2 ) panic ( " " ) ; sched_pin ( ) ; * sysmaps -> CMAP1 = PG_V | VM_PAGE_TO_PHYS ( src ) | PG_A | pmap_cache_bits ( src -> md . pat_mode , 0 ) ; invlcaddr ( sysmaps -> CADDR1 ) ; * sysmaps -> CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS ( dst ) | PG_A | PG_M | pmap_cache_bits ( dst -> md . pat_mode , 0 ) ; invlcaddr ( sysmaps -> CADDR2 ) ; bcopy ( sysmaps -> CADDR1 , sysmaps -> CADDR2 , PAGE_SIZE ) ; * sysmaps -> CMAP1 = 0 ; * sysmaps -> CMAP2 = 0 ; sched_unpin ( ) ; mtx_unlock ( & sysmaps -> lock ) ; }
pmap_copy_page copies the specified (machine independent)
      page by mapping the page into virtual memory and using
      bcopy to copy the page, one machine dependent page at a
      time.
pmap_copy_page copies the specified ( machine independent ) page by mapping the page into virtual memory and using bcopy to copy the page one machine dependent page at a time .