dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / kernel / fs / sockfs / sodirect.h
blob7bbaf7c209c8babf7267e04e73f0fb8565c71ba2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1983, 1984, 1985, 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
33 * All Rights Reserved
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
37 * contributors.
40 #ifndef _SOCKFS_SODIRECT_H
41 #define _SOCKFS_SODIRECT_H
44 * Sodirect; used to support asynchronous DMA hardware
45 * (e.g. Intel's I/OAT).
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
52 typedef struct sodirect_s {
53 boolean_t sod_enabled; /* sodirect_t enabled */
54 mblk_t *sod_uioafh; /* To be freed list head, or NULL */
55 mblk_t *sod_uioaft; /* To be freed list tail */
56 uioa_t sod_uioa; /* Pending uio_t for uioa_t use */
57 } sodirect_t;
60 * Usefull macros:
62 #define SOD_DISABLE(sodp) { \
63 (sodp)->sod_enabled = B_FALSE; \
66 #define SOD_SOTOSODP(so) ((sonode_t *)so)->so_direct
68 #define SOD_UIOAFINI(sodp) { \
69 if ((sodp)->sod_uioa.uioa_state & UIOA_ENABLED) { \
70 (sodp)->sod_uioa.uioa_state &= UIOA_CLR; \
71 (sodp)->sod_uioa.uioa_state |= UIOA_FINI; \
72 } \
75 struct sonode;
76 struct sodirect_s;
78 extern uio_t *sod_rcv_init(struct sonode *, int, struct uio **);
79 extern int sod_rcv_done(struct sonode *, struct uio *, struct uio *);
81 extern void sod_uioa_mblk_init(struct sodirect_s *, mblk_t *, size_t);
82 extern void sod_uioa_so_init(struct sonode *, struct sodirect_s *,
83 struct uio *);
84 extern ssize_t sod_uioa_mblk(struct sonode *, mblk_t *);
85 extern void sod_uioa_mblk_done(struct sodirect_s *, mblk_t *);
87 extern int sod_init(void);
88 extern void sod_sock_init(struct sonode *);
89 extern void sod_sock_fini(struct sonode *);
91 #ifdef __cplusplus
93 #endif
95 #endif /* _SOCKFS_SODIRECT_H */