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/pipe.c | |
parent | 52e7fe3c679469032e77a5ca4adf19618ba1201b (diff) |
kernel/virt: replace the virt_cpy api with a more foolproof one
Diffstat (limited to 'src/kernel/pipe.c')
-rw-r--r-- | src/kernel/pipe.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/kernel/pipe.c b/src/kernel/pipe.c index d9dc8a7..29e68e2 100644 --- a/src/kernel/pipe.c +++ b/src/kernel/pipe.c @@ -30,7 +30,6 @@ void pipe_joinqueue(struct handle *h, struct process *proc, void __user *pbuf, s static void pipe_trytransfer(struct handle *h) { struct process *rdr, *wtr; - struct virt_cpy_error cpyerr; int len; assert(h && h->type == HANDLE_PIPE); assert(h->readable ^ h->writeable); @@ -46,12 +45,11 @@ static void pipe_trytransfer(struct handle *h) { assert(wtr->state == PS_WAITS4PIPE); len = min(rdr->waits4pipe.len, wtr->waits4pipe.len); - virt_cpy( - rdr->pages, rdr->waits4pipe.buf, - wtr->pages, wtr->waits4pipe.buf, - len, &cpyerr); - if (cpyerr.read_fail || cpyerr.write_fail) - panic_unimplemented(); + len = pcpy_bi( + rdr, rdr->waits4pipe.buf, + wtr, wtr->waits4pipe.buf, + len + ); h->pipe.queued = h->pipe.queued->waits4pipe.next; h->pipe.sister->pipe.queued = h->pipe.sister->pipe.queued->waits4pipe.next; process_transition(rdr, PS_RUNNING); |