+#define UIO_SEG_IS_USER_SPACE( a_uio_seg ) \
+ ( (a_uio_seg) == UIO_USERSPACE64 || (a_uio_seg) == UIO_USERSPACE32 || \
+ (a_uio_seg) == UIO_USERSPACE )
+
+
+__BEGIN_DECLS
+
+/*
+ * uio_create - create an uio_t.
+ * Space is allocated to hold up to a_iovcount number of iovecs. The uio_t
+ * is not fully initialized until all iovecs are added using uio_addiov calls.
+ * a_iovcount is the maximum number of iovecs you may add.
+ */
+uio_t uio_create( int a_iovcount, /* max number of iovecs */
+ off_t a_offset, /* current offset */
+ int a_spacetype, /* type of address space */
+ int a_iodirection ); /* read or write flag */
+
+/*
+ * uio_reset - reset an uio_t.
+ * Reset the given uio_t to initial values. The uio_t is not fully initialized
+ * until all iovecs are added using uio_add_ov calls.
+ * The a_iovcount value passed in the uio_create is the maximum number of
+ * iovecs you may add.
+ */
+void uio_reset( uio_t a_uio,
+ off_t a_offset, /* current offset */
+ int a_spacetype, /* type of address space */
+ int a_iodirection ); /* read or write flag */
+
+/*
+ * uio_duplicate - allocate a new uio and make a copy of the given uio_t.
+ * may return NULL.
+ */
+uio_t uio_duplicate( uio_t a_uio );
+
+
+/*
+ * uio_free - free a uio_t allocated via uio_create.
+ */
+void uio_free( uio_t a_uio );
+
+/*
+ * uio_addiov - add an iovec to the given uio_t. You may call this up to
+ * the a_iovcount number that was passed to uio_create.
+ * returns 0 if add was successful else non zero.
+ */
+int uio_addiov( uio_t a_uio, user_addr_t a_baseaddr, user_size_t a_length );
+
+/*
+ * uio_getiov - get iovec data associated with the given uio_t. Use
+ * a_index to iterate over each iovec (0 to (uio_iovcnt(uio_t) - 1)).
+ * a_baseaddr_p and a_length_p may be NULL.
+ * returns -1 when a_index is out of range or invalid uio_t.
+ * returns 0 when data is returned.
+ */
+int uio_getiov( uio_t a_uio,
+ int a_index,
+ user_addr_t * a_baseaddr_p,
+ user_size_t * a_length_p );
+
+/*
+ * uio_update - update the given uio_t for a_count of completed IO.
+ * This call adjusts decrements the current iovec length and residual IO,
+ * and increments the current iovec base address and offset value.
+ */
+void uio_update( uio_t a_uio, user_size_t a_count );
+
+/*
+ * uio_resid - return the residual IO value for the given uio_t
+ */
+user_ssize_t uio_resid( uio_t a_uio );
+
+/*
+ * uio_setresid - set the residual IO value for the given uio_t
+ */
+void uio_setresid( uio_t a_uio, user_ssize_t a_value );
+
+/*
+ * uio_iovcnt - return count of active iovecs for the given uio_t
+ */
+int uio_iovcnt( uio_t a_uio );
+
+/*
+ * uio_offset - return the current offset value for the given uio_t
+ */
+off_t uio_offset( uio_t a_uio );
+
+/*
+ * uio_setoffset - set the current offset value for the given uio_t
+ */
+void uio_setoffset( uio_t a_uio, off_t a_offset );
+
+/*
+ * uio_rw - return the read / write flag for the given uio_t
+ */
+int uio_rw( uio_t a_uio );
+
+/*
+ * uio_setrw - set the read / write flag for the given uio_t
+ */
+void uio_setrw( uio_t a_uio, int a_value );
+
+/*
+ * uio_isuserspace - return non zero value if the address space
+ * flag is for a user address space (could be 32 or 64 bit).
+ */
+int uio_isuserspace( uio_t a_uio );
+
+/*
+ * uio_curriovbase - return the base address of the current iovec associated
+ * with the given uio_t. May return 0.
+ */
+user_addr_t uio_curriovbase( uio_t a_uio );
+
+/*
+ * uio_curriovlen - return the length value of the current iovec associated
+ * with the given uio_t.
+ */
+user_size_t uio_curriovlen( uio_t a_uio );
+