* Free a contiguous, arbitrarily sized set of physical pages. * * The free page queues must be locked. */
| 1194 | * The free page queues must be locked. |
| 1195 | */ |
| 1196 | void |
| 1197 | vm_phys_free_contig(vm_page_t m, u_long npages) |
| 1198 | { |
| 1199 | int order_start, order_end; |
| 1200 | vm_page_t m_start, m_end; |
| 1201 | |
| 1202 | vm_domain_free_assert_locked(vm_pagequeue_domain(m)); |
| 1203 | |
| 1204 | m_start = m; |
| 1205 | order_start = max_order(m_start); |
| 1206 | if (order_start < VM_NFREEORDER - 1) |
| 1207 | m_start += 1 << order_start; |
| 1208 | m_end = m + npages; |
| 1209 | order_end = max_order(m_end); |
| 1210 | if (order_end < VM_NFREEORDER - 1) |
| 1211 | m_end -= 1 << order_end; |
| 1212 | /* |
| 1213 | * Avoid unnecessary coalescing by freeing the pages at the start and |
| 1214 | * end of the range last. |
| 1215 | */ |
| 1216 | if (m_start < m_end) |
| 1217 | vm_phys_enqueue_contig(m_start, m_end - m_start); |
| 1218 | if (order_start < VM_NFREEORDER - 1) |
| 1219 | vm_phys_free_pages(m, order_start); |
| 1220 | if (order_end < VM_NFREEORDER - 1) |
| 1221 | vm_phys_free_pages(m_end, order_end); |
| 1222 | } |
| 1223 | |
| 1224 | /* |
| 1225 | * Scan physical memory between the specified addresses "low" and "high" for a |
nothing calls this directly
no test coverage detected