4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #ifndef _LIBSPL_SYS_UIO_H
41 #define _LIBSPL_SYS_UIO_H
43 #include_next <sys/uio.h>
45 typedef struct iovec iovec_t;
52 typedef enum uio_seg {
59 struct iovec *uio_iov; /* pointer to array of iovecs */
60 int uio_iovcnt; /* number of iovecs */
61 offset_t uio_loffset; /* file offset */
62 uio_seg_t uio_segflg; /* address space (kernel or user) */
63 uint16_t uio_fmode; /* file mode flags */
64 uint16_t uio_extflg; /* extended flags */
65 offset_t uio_limit; /* u-limit (maximum byte offset) */
66 ssize_t uio_resid; /* residual count */
69 typedef enum xuio_type {
74 #define UIOA_IOV_MAX 16
76 typedef struct uioa_page_s { /* locked uio_iov state */
77 int uioa_pfncnt; /* count of pfn_t(s) in *uioa_ppp */
78 void **uioa_ppp; /* page_t or pfn_t arrary */
79 caddr_t uioa_base; /* address base */
80 size_t uioa_len; /* span length */
84 uio_t xu_uio; /* embedded UIO structure */
86 /* Extended uio fields */
87 enum xuio_type xu_type; /* uio type */
90 uint32_t xu_a_state; /* state of async i/o */
91 ssize_t xu_a_mbytes; /* bytes moved */
92 uioa_page_t *xu_a_lcur; /* uioa_locked[] pointer */
93 void **xu_a_lppp; /* lcur->uioa_pppp[] pointer */
94 void *xu_a_hwst[4]; /* opaque hardware state */
95 uioa_page_t xu_a_locked[UIOA_IOV_MAX];
99 int xu_zc_rw; /* read or write buffer */
100 void *xu_zc_priv; /* fs specific */
105 #define XUIO_XUZC_PRIV(xuio) xuio->xu_ext.xu_zc.xu_zc_priv
106 #define XUIO_XUZC_RW(xuio) xuio->xu_ext.xu_zc.xu_zc_rw
108 #endif /* _SYS_UIO_H */