kernel: iovec: implement iterating through an iovec list stored in userspace

This commit is contained in:
2026-02-21 11:17:16 +00:00
parent aa0933be10
commit 0680b73461
2 changed files with 73 additions and 3 deletions

View File

@@ -5,6 +5,9 @@
#include <stddef.h>
struct iovec_iterator {
/* if this is set, we are iterating over a list of iovecs stored in
* userspace, and must go through this region to retrieve the data. */
struct vm_region *it_region;
const struct iovec *it_vecs;
size_t it_nr_vecs;
size_t it_vec_ptr;
@@ -17,6 +20,11 @@ extern void iovec_iterator_begin(
struct iovec_iterator *it,
const struct iovec *vecs,
size_t nr_vecs);
extern void iovec_iterator_begin_user(
struct iovec_iterator *it,
struct vm_region *address_space,
const struct iovec *vecs,
size_t nr_vecs);
extern void iovec_iterator_seek(struct iovec_iterator *it, size_t nr_bytes);