mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 22:18:21 +00:00
vmm: allow vmm_getphysical to return a page held
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user