summaryrefslogtreecommitdiff
path: root/src/kernel/ring.c
blob: 2cb696164d24ea8f6ca230c6dbb9b6a8642f8566 (plain)
1
2
3
4
5
6
7
8
9
#include <kernel/mem/virt.h>
#include <kernel/ring.h>

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);
}