kernel: re-implement sending handles via port messages
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
static bool read_iovec(
|
||||
struct iovec_iterator *it,
|
||||
size_t index,
|
||||
struct iovec *out)
|
||||
kern_iovec_t *out)
|
||||
{
|
||||
if (index >= it->it_nr_vecs) {
|
||||
return false;
|
||||
@@ -20,18 +20,18 @@ static bool read_iovec(
|
||||
size_t nr_read = 0;
|
||||
kern_status_t status = vm_region_read_kernel(
|
||||
it->it_region,
|
||||
(virt_addr_t)it->it_vecs + (index * sizeof(struct iovec)),
|
||||
sizeof(struct iovec),
|
||||
(virt_addr_t)it->it_vecs + (index * sizeof(kern_iovec_t)),
|
||||
sizeof(kern_iovec_t),
|
||||
out,
|
||||
&nr_read);
|
||||
|
||||
return (status == KERN_OK && nr_read != sizeof(struct iovec));
|
||||
return (status == KERN_OK && nr_read != sizeof(kern_iovec_t));
|
||||
}
|
||||
|
||||
void iovec_iterator_begin_user(
|
||||
struct iovec_iterator *it,
|
||||
struct vm_region *region,
|
||||
const struct iovec *vecs,
|
||||
const kern_iovec_t *vecs,
|
||||
size_t nr_vecs)
|
||||
{
|
||||
memset(it, 0x0, sizeof *it);
|
||||
@@ -39,7 +39,7 @@ void iovec_iterator_begin_user(
|
||||
it->it_vecs = vecs;
|
||||
it->it_nr_vecs = nr_vecs;
|
||||
|
||||
struct iovec iov;
|
||||
kern_iovec_t iov;
|
||||
|
||||
while (it->it_vec_ptr < nr_vecs) {
|
||||
read_iovec(it, it->it_vec_ptr, &iov);
|
||||
@@ -60,7 +60,7 @@ void iovec_iterator_begin_user(
|
||||
|
||||
void iovec_iterator_begin(
|
||||
struct iovec_iterator *it,
|
||||
const struct iovec *vecs,
|
||||
const kern_iovec_t *vecs,
|
||||
size_t nr_vecs)
|
||||
{
|
||||
memset(it, 0x0, sizeof *it);
|
||||
@@ -97,7 +97,7 @@ void iovec_iterator_seek(struct iovec_iterator *it, size_t nr_bytes)
|
||||
}
|
||||
|
||||
nr_bytes -= to_seek;
|
||||
struct iovec iov;
|
||||
kern_iovec_t iov;
|
||||
|
||||
it->it_vec_ptr++;
|
||||
while (it->it_vec_ptr < it->it_nr_vecs) {
|
||||
|
||||
Reference in New Issue
Block a user