/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PORT_KERNEL_H
#define _SYS_PORT_KERNEL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Note:
* The contents of this file are private to the implementation of the
* Solaris system and event ports subsystem and are subject to change
* at any time without notice.
*/
#ifdef _KERNEL
/*
* The port_kevent_t struct represents the kernel internal port event.
* Every event is associated to a port (portkev_port).
*/
typedef struct port_kevent {
/* portkev_flags */
/* flags : port_alloc_event() */
#define PORT_ALLOC_DEFAULT 0
/* flags : callback function */
/*
* port_source_t represents a source associated with a port.
* The portsrc_close() function is required to notify the source when
* a port is closed.
*/
typedef struct port_source {
int portsrc_source;
/*
* PORT_SOURCE_FILE cache structure.
*/
/*
* One cache for each port that uses PORT_SOURCE_FILE.
*/
typedef struct portfop_cache {
/*
* PORT_SOURCE_FD cache per port.
* One cache for each port that uses PORT_SOURCE_FD.
* pc_lock must be the first element of port_fdcache_t to keep it
* synchronized with the offset of pc_lock in pollcache_t (see pollrelock()).
*/
typedef struct port_fdcache {
/*
* Structure of port_ksource_tab[] table.
* The port_ksource_tab[] is required to allow kernel sources to become
* associated with a port at the time of port creation. This feature is
* required to avoid performance degradation in sub-systems, specially when
* they should need to check the association on every event activity.
*/
typedef struct port_ksource {
int pks_source;
void *pks_closearg;
void *pks_portsrc;
/* event port and source management */
int port_associate_ksource(int, int, struct port_source **,
int (*)(port_kevent_t *, int, int, uintptr_t, void *));
int port_dissociate_ksource(int, int, struct port_source *);
/* event management */
int port_alloc_event(int, int, int, port_kevent_t **);
int port_pollwkup(struct port *);
void port_pollwkdone(struct port *);
void port_send_event(port_kevent_t *);
void port_free_event(port_kevent_t *);
int (*)(void *, int *, pid_t, int, void *), void *);
/* misc functions */
void port_close_pfd(struct portfd *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PORT_KERNEL_H */