diff options
author | dzwdz | 2023-01-25 20:56:36 +0100 |
---|---|---|
committer | dzwdz | 2023-01-25 20:56:36 +0100 |
commit | c24a9376b4a048a3f9408df2d47eaad367459bd7 (patch) | |
tree | 74388b8b575719ab94e6f8eed9ad834abe7ba36b /src/kernel/arch/amd64/driver/util.c | |
parent | 93194f8645ecd9f280372ec99497ede5f0ce7cee (diff) |
kernel: consolidate some header files
Diffstat (limited to 'src/kernel/arch/amd64/driver/util.c')
-rw-r--r-- | src/kernel/arch/amd64/driver/util.c | 8 |
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); +} |