* pmap_zero_page_area zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. * * off and size may not cover an area beyond a single hardware page. */
| 5886 | * off and size may not cover an area beyond a single hardware page. |
| 5887 | */ |
| 5888 | void |
| 5889 | pmap_zero_page_area(vm_page_t m, int off, int size) |
| 5890 | { |
| 5891 | pt2_entry_t *cmap2_pte2p; |
| 5892 | struct pcpu *pc; |
| 5893 | |
| 5894 | sched_pin(); |
| 5895 | pc = get_pcpu(); |
| 5896 | cmap2_pte2p = pc->pc_cmap2_pte2p; |
| 5897 | mtx_lock(&pc->pc_cmap_lock); |
| 5898 | if (pte2_load(cmap2_pte2p) != 0) |
| 5899 | panic("%s: CMAP2 busy", __func__); |
| 5900 | pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW, |
| 5901 | vm_page_pte2_attr(m))); |
| 5902 | if (off == 0 && size == PAGE_SIZE) |
| 5903 | pagezero(pc->pc_cmap2_addr); |
| 5904 | else |
| 5905 | bzero(pc->pc_cmap2_addr + off, size); |
| 5906 | pte2_clear(cmap2_pte2p); |
| 5907 | tlb_flush((vm_offset_t)pc->pc_cmap2_addr); |
| 5908 | sched_unpin(); |
| 5909 | mtx_unlock(&pc->pc_cmap_lock); |
| 5910 | } |
| 5911 | |
| 5912 | /* |
| 5913 | * pmap_copy_page copies the specified (machine independent) |
no test coverage detected