7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _SYS_PORT_KERNEL_H
28 #define _SYS_PORT_KERNEL_H
29
30 #pragma ident "%Z%%M% %I% %E% SMI"
31
32 #include <sys/vnode.h>
33 #include <sys/list.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /*
40 * Note:
41 * The contents of this file are private to the implementation of the
42 * Solaris system and event ports subsystem and are subject to change
43 * at any time without notice.
44 */
45
46 #ifdef _KERNEL
47
48 /*
49 * The port_kevent_t struct represents the kernel internal port event.
50 * Every event is associated to a port (portkev_port).
51 */
151 int port_associate_ksource(int, int, struct port_source **,
152 void (*)(void *, int, pid_t, int), void *arg,
153 int (*)(port_kevent_t *, int, int, uintptr_t, void *));
154 int port_dissociate_ksource(int, int, struct port_source *);
155
156 /* event management */
157 int port_alloc_event(int, int, int, port_kevent_t **);
158 int port_pollwkup(struct port *);
159 void port_pollwkdone(struct port *);
160 void port_send_event(port_kevent_t *);
161 void port_free_event(port_kevent_t *);
162 void port_init_event(port_kevent_t *, uintptr_t, void *,
163 int (*)(void *, int *, pid_t, int, void *), void *);
164 int port_dup_event(port_kevent_t *, port_kevent_t **, int);
165 int port_associate_fd(struct port *, int, uintptr_t, int, void *);
166 int port_dissociate_fd(struct port *, uintptr_t);
167 int port_associate_fop(struct port *, int, uintptr_t, int, void *);
168 int port_dissociate_fop(struct port *, uintptr_t);
169
170 /* misc functions */
171 void port_free_event_local(port_kevent_t *, int counter);
172 int port_alloc_event_local(struct port *, int, int, port_kevent_t **);
173 void port_close_pfd(struct portfd *);
174
175 #endif /* _KERNEL */
176
177 #ifdef __cplusplus
178 }
179 #endif
180
181 #endif /* _SYS_PORT_KERNEL_H */
|
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright 2020 Joyent, Inc.
29 */
30
31 #ifndef _SYS_PORT_KERNEL_H
32 #define _SYS_PORT_KERNEL_H
33
34 #include <sys/vnode.h>
35 #include <sys/list.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /*
42 * Note:
43 * The contents of this file are private to the implementation of the
44 * Solaris system and event ports subsystem and are subject to change
45 * at any time without notice.
46 */
47
48 #ifdef _KERNEL
49
50 /*
51 * The port_kevent_t struct represents the kernel internal port event.
52 * Every event is associated to a port (portkev_port).
53 */
153 int port_associate_ksource(int, int, struct port_source **,
154 void (*)(void *, int, pid_t, int), void *arg,
155 int (*)(port_kevent_t *, int, int, uintptr_t, void *));
156 int port_dissociate_ksource(int, int, struct port_source *);
157
158 /* event management */
159 int port_alloc_event(int, int, int, port_kevent_t **);
160 int port_pollwkup(struct port *);
161 void port_pollwkdone(struct port *);
162 void port_send_event(port_kevent_t *);
163 void port_free_event(port_kevent_t *);
164 void port_init_event(port_kevent_t *, uintptr_t, void *,
165 int (*)(void *, int *, pid_t, int, void *), void *);
166 int port_dup_event(port_kevent_t *, port_kevent_t **, int);
167 int port_associate_fd(struct port *, int, uintptr_t, int, void *);
168 int port_dissociate_fd(struct port *, uintptr_t);
169 int port_associate_fop(struct port *, int, uintptr_t, int, void *);
170 int port_dissociate_fop(struct port *, uintptr_t);
171
172 /* misc functions */
173 void port_free_event_local(port_kevent_t *, boolean_t);
174 int port_alloc_event_local(struct port *, int, int, port_kevent_t **);
175 void port_close_pfd(struct portfd *);
176
177 #endif /* _KERNEL */
178
179 #ifdef __cplusplus
180 }
181 #endif
182
183 #endif /* _SYS_PORT_KERNEL_H */
|