2026-02-19 19:13:44 +00:00
|
|
|
#ifndef KERNEL_IOVEC_H_
|
|
|
|
|
#define KERNEL_IOVEC_H_
|
|
|
|
|
|
|
|
|
|
#include <mango/types.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
struct iovec_iterator {
|
2026-02-21 11:17:16 +00:00
|
|
|
/* 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;
|
2026-03-01 19:10:01 +00:00
|
|
|
const kern_iovec_t *it_vecs;
|
2026-02-19 19:13:44 +00:00
|
|
|
size_t it_nr_vecs;
|
|
|
|
|
size_t it_vec_ptr;
|
|
|
|
|
|
|
|
|
|
virt_addr_t it_base;
|
|
|
|
|
size_t it_len;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern void iovec_iterator_begin(
|
|
|
|
|
struct iovec_iterator *it,
|
2026-03-01 19:10:01 +00:00
|
|
|
const kern_iovec_t *vecs,
|
2026-02-19 19:13:44 +00:00
|
|
|
size_t nr_vecs);
|
2026-02-21 11:17:16 +00:00
|
|
|
extern void iovec_iterator_begin_user(
|
|
|
|
|
struct iovec_iterator *it,
|
|
|
|
|
struct vm_region *address_space,
|
2026-03-01 19:10:01 +00:00
|
|
|
const kern_iovec_t *vecs,
|
2026-02-21 11:17:16 +00:00
|
|
|
size_t nr_vecs);
|
2026-02-19 19:13:44 +00:00
|
|
|
|
|
|
|
|
extern void iovec_iterator_seek(struct iovec_iterator *it, size_t nr_bytes);
|
|
|
|
|
|
|
|
|
|
#endif
|