- if (ptr) {
- pmm_mark_chunk_occupied(KERNEL_PID,
- paddr >> PG_SIZE_BITS,
- CEIL(size, PG_SIZE_BITS),
- PP_FGLOCKED);
- }
+ pfn_t start = pfn(paddr);
+ size_t npages = leaf_count(size);
+
+ // Ensure the range is reservable (not already in use)
+ assert(pmm_onhold_range(start, npages));