diff options
author | dzwdz | 2023-01-25 01:02:04 +0100 |
---|---|---|
committer | dzwdz | 2023-01-25 01:04:49 +0100 |
commit | 2a2fc4dffe0117ce874a6cf1dcc34321ed8add77 (patch) | |
tree | af1e24f72241dbbff97797b9e186f7d27b5b54b4 /src/kernel/vfs/procfs.c | |
parent | 52e7fe3c679469032e77a5ca4adf19618ba1201b (diff) |
kernel/virt: replace the virt_cpy api with a more foolproof one
Diffstat (limited to 'src/kernel/vfs/procfs.c')
-rw-r--r-- | src/kernel/vfs/procfs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/kernel/vfs/procfs.c b/src/kernel/vfs/procfs.c index be907fd..78dad0d 100644 --- a/src/kernel/vfs/procfs.c +++ b/src/kernel/vfs/procfs.c @@ -1,4 +1,5 @@ #include <camellia/errno.h> +#include <kernel/mem/alloc.h> #include <kernel/mem/virt.h> #include <kernel/panic.h> #include <kernel/proc.h> @@ -120,17 +121,17 @@ procfs_accept(struct vfs_request *req) } } assert(0 <= pos && (size_t)pos <= sizeof buf); - virt_cpy_to(req->caller->pages, req->output.buf, buf, pos); + pcpy_to(req->caller, req->output.buf, buf, pos); vfsreq_finish_short(req, pos); } else if (req->type == VFSOP_READ && h->type == PhMem) { if (p->pages == NULL || req->caller->pages == NULL) { vfsreq_finish_short(req, 0); return; } - size_t res = virt_cpy( - req->caller->pages, req->output.buf, - p->pages, (__user void*)req->offset, - req->output.len, NULL + size_t res = pcpy_bi( + req->caller, req->output.buf, + p, (__user void*)req->offset, + req->output.len ); vfsreq_finish_short(req, res); } else if (req->type == VFSOP_WRITE && h->type == PhIntr) { |