summaryrefslogtreecommitdiff
path: root/src/kernel/ring.c
blob: 6c0333318841329df9ef8685423bd766c8565ffe (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, struct process *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);
}