/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident "$Header: strpipe.h 1.3 89/08/07 $"

#ifndef	_SYS_STRPIPE_H_

/* $Log:	strpipe.h,v $
 */

/*
 * sp_rdq and sp_ordq are locked by strpipe_lock.
 * sp_flag and sp_synch are used in conjunction with sp_lock.
 * If necesary to hold BOTH strpipe_lock and sp_lock, strpipe_lock
 * must be acquired first (deadlock avoidance).
 */
struct strpipe {
	queue_t *sp_rdq;		/* this stream's read queue */
	queue_t *sp_ordq;		/* this stream's read queue */
	struct sp_synch *sp_master;	/* pointer to the state for 
					 * a connected pair of pipes.
					 */
};

struct sp_synch {
	lock_t	sp_lock;		/* lock to coordinate two q's */
	char	sp_flag;		/* state flag */
};

/*
 * flags for use in sp_flag
 */
#define SP_BUSY	1

/*
 * interrupt priority level to run streams pipe at.
 */
#define SPL_SPX		SPLSTR

extern struct strpipe strpipe_sp[];
extern struct sp_synch strpipe_sy[];
extern strpipe_cnt;


#define	_SYS_STRPIPE_H_
#endif	/* _SYS_STRPIPE_H_ */
