summaryrefslogtreecommitdiff
path: root/src/kernel/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fd.c')
-rw-r--r--src/kernel/fd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/kernel/fd.c b/src/kernel/fd.c
index e99fb7d..c495c8c 100644
--- a/src/kernel/fd.c
+++ b/src/kernel/fd.c
@@ -3,9 +3,9 @@
#include <kernel/panic.h>
#include <kernel/proc.h>
-static int fdop_special_tty(enum fdop fdop, struct fd *fd, void *ptr, size_t len);
+static int fdop_special_tty(enum fdop fdop, struct fd *fd, user_ptr ptr, size_t len);
-int fdop_dispatch(enum fdop fdop, struct fd *fd, void *ptr, size_t len) {
+int fdop_dispatch(enum fdop fdop, struct fd *fd, user_ptr ptr, size_t len) {
switch(fd->type) {
case FD_EMPTY:
return -1;
@@ -16,15 +16,14 @@ int fdop_dispatch(enum fdop fdop, struct fd *fd, void *ptr, size_t len) {
}
}
-static int fdop_special_tty(enum fdop fdop, struct fd *fd, void *ptr, size_t len) {
+static int fdop_special_tty(enum fdop fdop, struct fd *fd, user_ptr ptr, size_t len) {
switch(fdop) {
case FDOP_READ:
return -1; // input not implemented yet
case FDOP_WRITE: {
struct virt_iter iter;
- virt_iter_new(&iter, (void*)ptr, len,
- process_current->pages, true, false);
+ virt_iter_new(&iter, ptr, len, process_current->pages, true, false);
while (virt_iter_next(&iter))
tty_write(iter.frag, iter.frag_len);
return iter.prior;