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
@@ -517,11 +517,13 @@ static int rwblocks(nvmenamespace_t *namespace, void *buffer, uintmax_t lba, siz
size_t docount = (done == 0) ? (PAGE_SIZE - pageoffset) / namespace->blocksize : PAGE_SIZE / namespace->blocksize;
docount = min(docount, count - done);
prp[0] = (uint64_t)vmm_getphysical((void *)((uintptr_t)buffer + done * namespace->blocksize));
prp[0] = (uint64_t)vmm_getphysical((void *)((uintptr_t)buffer + done * namespace->blocksize), true);
__assert(prp[0]);
err = write ? iowrite(namespace, prp, lba + done, docount) : ioread(namespace, prp, lba + done, docount);
pmm_release((void *)prp[0]);
if (err)
break;
+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;