summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/driver/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.c')
-rw-r--r--src/kernel/arch/amd64/driver/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/kernel/arch/amd64/driver/util.c b/src/kernel/arch/amd64/driver/util.c
index 957005c..1462258 100644
--- a/src/kernel/arch/amd64/driver/util.c
+++ b/src/kernel/arch/amd64/driver/util.c
@@ -1,6 +1,5 @@
#include <camellia/fsutil.h>
#include <kernel/arch/amd64/driver/util.h>
-#include <kernel/mem/virt.h>
#include <kernel/panic.h>
#include <kernel/proc.h>
#include <kernel/vfs/request.h>
@@ -53,3 +52,10 @@ void postqueue_ringreadall(VfsReq **queue, ring_t *r) {
}
*queue = NULL;
}
+
+size_t ring_to_virt(ring_t *r, Proc *proc, void __user *ubuf, size_t max) {
+ char tmp[32];
+ if (max > sizeof tmp) max = sizeof tmp;
+ max = ring_get(r, tmp, max);
+ return pcpy_to(proc, ubuf, tmp, max);
+}