vmm: allow vmm_getphysical to return a page held

This commit is contained in:
Matheus
2024-09-18 21:27:36 -03:00
parent 611f13b562
commit c76b37693b
6 changed files with 14 additions and 5 deletions
+3 -1
View File
@@ -121,11 +121,13 @@ static int vioblk_rw(vioblkdev_t *blkdev, void *buffer, uintmax_t lba, size_t co
size_t docount = (done == 0) ? (PAGE_SIZE - pageoffset) / 512 : PAGE_SIZE / 512;
docount = min(docount, count - done);
void *bufferphys = vmm_getphysical((void *)((uintptr_t)buffer + done * 512));
void *bufferphys = vmm_getphysical((void *)((uintptr_t)buffer + done * 512), true);
__assert(bufferphys);
vioblk_enqueue(blkdev, header, bufferphys, docount * 512, status, write);
pmm_release(bufferphys);
if (*statushhdm) {
err = EIO;
break;