From c24a9376b4a048a3f9408df2d47eaad367459bd7 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 25 Jan 2023 20:56:36 +0100 Subject: kernel: consolidate some header files --- src/kernel/arch/amd64/driver/util.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/kernel/arch/amd64/driver/util.c') 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 #include -#include #include #include #include @@ -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); +} -- cgit v1.2.3