uio - #ifndef _UIO_H_ #define _UIO_H_ /* * Like BSD uio,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef _UIO_H_ #define _UIO_H_ /* * Like BSD uio, but simplified a bit. (In BSD, there can be more than one * iovec in a uio.) */ enum uio_rw { UIO_READ, UIO_WRITE, }; enum uio_seg { UIO_USERSPACE, UIO_SYSSPACE, UIO_USERISPACE, }; struct iovec { union { void *un_kbase; /* kernel address (UIO_SYSSPACE) */ userptr_t un_ubase; /* user address (UIO_USER{,I}SPACE */ } iov_un; size_t iov_len; /* Length of data */ }; #define iov_kbase iov_un.un_kbase #define iov_ubase iov_un.un_ubase struct uio { struct iovec uio_iovec; /* Data block */ off_t uio_offset; /* desired offset into object */ size_t uio_resid; /* Remaining amt of data to xfer */ enum uio_seg uio_segflg; /* what kind of pointer we have */ enum uio_rw uio_rw; /* whether op is a read or write */ struct addrspace *uio_space; /* address space for user pointer */ }; /* * Copy data from a kernel buffer to a data region defined by a uio struct, * updating the uio struct's offset and resid fields. May alter the iovec * fields as well. * * Before calling this, you should
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

uio - #ifndef _UIO_H_ #define _UIO_H_ /* * Like BSD uio,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online