* 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. */
| 5916 | * time. |
| 5917 | */ |
| 5918 | void |
| 5919 | pmap_copy_page(vm_page_t src, vm_page_t dst) |
| 5920 | { |
| 5921 | pt2_entry_t *cmap1_pte2p, *cmap2_pte2p; |
| 5922 | struct pcpu *pc; |
| 5923 | |
| 5924 | sched_pin(); |
| 5925 | pc = get_pcpu(); |
| 5926 | cmap1_pte2p = pc->pc_cmap1_pte2p; |
| 5927 | cmap2_pte2p = pc->pc_cmap2_pte2p; |
| 5928 | mtx_lock(&pc->pc_cmap_lock); |
| 5929 | if (pte2_load(cmap1_pte2p) != 0) |
| 5930 | panic("%s: CMAP1 busy", __func__); |
| 5931 | if (pte2_load(cmap2_pte2p) != 0) |
| 5932 | panic("%s: CMAP2 busy", __func__); |
| 5933 | pte2_store(cmap1_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(src), |
| 5934 | PTE2_AP_KR | PTE2_NM, vm_page_pte2_attr(src))); |
| 5935 | pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(dst), |
| 5936 | PTE2_AP_KRW, vm_page_pte2_attr(dst))); |
| 5937 | bcopy(pc->pc_cmap1_addr, pc->pc_cmap2_addr, PAGE_SIZE); |
| 5938 | pte2_clear(cmap1_pte2p); |
| 5939 | tlb_flush((vm_offset_t)pc->pc_cmap1_addr); |
| 5940 | pte2_clear(cmap2_pte2p); |
| 5941 | tlb_flush((vm_offset_t)pc->pc_cmap2_addr); |
| 5942 | sched_unpin(); |
| 5943 | mtx_unlock(&pc->pc_cmap_lock); |
| 5944 | } |
| 5945 | |
| 5946 | int unmapped_buf_allowed = 1; |
| 5947 |
nothing calls this directly
no test coverage detected