📄 queue.h
字号:
#ifdef __KERNEL__extern mblk_t * lis_getq(queue_t *q);#endif /* __KERNEL__ *//* putq- put a message into a queue * */#ifdef __KERNEL__extern int lis_putq(queue_t *q, mblk_t *mp);#endif /* __KERNEL__ *//* putbq - return a message to a queue * */#ifdef __KERNEL__extern int lis_putbq(queue_t *q, mblk_t *mp);#endif /* __KERNEL__ *//*insq - insert nmp before emp. If emp is NULL, insert at end * of queue. If the insertion is out-of-order, the insert fails. * Returns 1 on success; 0 otherwise. * */#ifdef __KERNEL__extern int lis_insq(queue_t *q, mblk_t *emp, mblk_t *mp);#endif /* __KERNEL__ *//* rmvq - remove a message from a queue. If the message * does not exist, panic. * */#ifdef __KERNEL__extern void lis_rmvq(queue_t *q, mblk_t *mp);#endif /* __KERNEL__ *//* lis_qenable - schedule a queue for service * */#ifdef __KERNEL__extern void lis_qenable(queue_t *q);#endif /* __KERNEL__ *//* lis_setq - Set queue variables * */#ifdef __KERNEL__extern void lis_setq(queue_t * q, struct qinit *rinit, struct qinit *winit);#endif /* __KERNEL__ *//* lis_flushband - flush messages in a specified priority band. * flag can be FLUSHDATA (flush only M_DATA, M_DELAY, * M_PROTO, M_PCPROTO) or FLUSHALL. * */#ifdef __KERNEL__extern void lis_flushband(queue_t *q, unsigned char band, int flag);#endif /* __KERNEL__ *//* lis_flushq - free messages from a queue, enabling upstream/downstream * service routines if applicable. The flag is the same as for * lis_flushband. * */#ifdef __KERNEL__extern void lis_flushq(queue_t *q, int flag);#endif /* __KERNEL__ *//* putctl - allocate a message block, set the type, * and put it on a queue. Returns 1 on success; * 0 if the allocation failed or type is one of * M_DATA, M_PROTO or M_PCPROTO * */#ifdef __KERNEL__extern int lis_putctl(queue_t *q, int type, char *file_name, int line_nr);extern int lis_putnextctl(queue_t *q, int type, char *file_name, int line_nr);#endif /* __KERNEL__ *//* lis_putctl1 - as for lis_putctl, but with a one byte parameter * */#ifdef __KERNEL__extern intlis_putctl1(queue_t *q, int type, int param, char *file_name, int line_nr);extern intlis_putnextctl1(queue_t *q, int type, int param, char *file_name, int line_nr);#endif /* __KERNEL__ *//* lis_qsize - returns the number of messages on a queue * */#ifdef __KERNEL__extern int lis_qsize(queue_t *q);#define qsize lis_qsize#endif /* __KERNEL__ *//* lis_strqget - get information about a (band of a) queue. * Valid values for what are QHIWAT, QLOWAT, QMAXPSZ, * QMINPSZ, QCOUNT, QFIRST, QLAST, QFLAG. * Returns 0 on success. * */#ifdef __KERNEL__extern int lis_strqget(queue_t *q, qfields_t what, unsigned char band, long *val);#endif /* __KERNEL__ *//* lis_strqset - change information about a (band of a) queue. * Valid values for what are QHIWAT, QLOWAT, QMAXPSZ, * QMINPSZ. * Returns 0 on success. * */#ifdef __KERNEL__extern intlis_strqset(queue_t *q, qfields_t what, unsigned char band, long val);#endif /* __KERNEL__ */#ifdef __KERNEL__/* * Note: Any routines that manipulate q_flag field of a queue need * to use the "safe" versions for interrupt protection. */extern void lis_safe_noenable(queue_t *q, char *f, int l);extern void lis_safe_enableok(queue_t *q, char *f, int l);#define lis_noenable(q) lis_safe_noenable(q, __FILE__, __LINE__)#define lis_enableok(q) lis_safe_enableok(q, __FILE__, __LINE__)extern int lis_safe_canenable(queue_t *q, char *f, int l);#define lis_canenable(q) lis_safe_canenable(q, __FILE__, __LINE__)extern queue_t *lis_safe_OTHERQ(queue_t *q, char *f, int l);extern queue_t *lis_safe_RD(queue_t *q, char *f, int l);extern queue_t *lis_safe_WR(queue_t *q, char *f, int l);extern int lis_safe_SAMESTR(queue_t *q, char *f, int l);#define LIS_OTHERQ(q) lis_safe_OTHERQ(q, __FILE__, __LINE__)#define LIS_RD(q) lis_safe_RD(q, __FILE__, __LINE__)#define LIS_WR(q) lis_safe_WR(q, __FILE__, __LINE__)#define LIS_SAMESTR(q) lis_safe_SAMESTR(q, __FILE__, __LINE__)extern void lis_safe_putnext(queue_t *q, mblk_t *mp, char *f, int l);extern void lis_safe_qreply(queue_t *q, mblk_t *mp, char *f, int l);#define lis_putnext(q,mp) lis_safe_putnext(q, mp, __FILE__, __LINE__)#define lis_qreply(q,mp) lis_safe_qreply(q, mp, __FILE__, __LINE__)#endif /* __KERNEL__ *//* Count messages on a queue */#ifdef __KERNEL__extern int lis_qsize(queue_t *); #endif /* __KERNEL__ *//* Insert message(3) after message(2) or at start */#ifdef __KERNEL__extern void lis_appq(queue_t *, mblk_t *, mblk_t *);#endif /* __KERNEL__ *//* ------------------------------------------------------------------- */#ifdef __KERNEL__/* The functions below are to achieve mutual exclusion on the queue * They use the q_wait wait queue to sleep and the q_lock char to * flag the lock. * you should use only lis_{lock,unlock}_queue(). * the others are for internal use. */void lis_qprocson(queue_t *rdq) ; /* SVR4 routine */void lis_qprocsoff(queue_t *rdq) ; /* SVR4 routine */#if 0 /* DMG save these until MP version */extern voidlis_sleep_on_queue(queue_t * q);#define lis_wait_on_queue(q) \ { \ if (q->q_lock) \ lis_sleep_on_queue(q); \ }#define lis_lock_queue(q) \ { \ lis_wait_on_queue(q); \ q->q_lock=1; \ }#define lis_unlock_queue(q) \ { \ q->q_lock=0; \ wake_up(&q->q_wait); \ }#endif/* ------------------------------------------------------------------- *//* lis_bcanput - search the stream starting from q until a service * routine is found, if any, and test the found queue for * flow control at a specified band. Schedule backenabling * if flow controlled. * For band==0 this is equivalent to canput. Returns 0 if * flow controlled; 1 otherwise. * * test for flow cntl in band * returns STR_OK if msg can be put(), STR_ERR (0) if not. * */extern int lis_bcanput(queue_t *q, unsigned char band);/* ------------------------------------------------------------------- *//* lis_bcanputnext - search the stream starting from the queue after q * until a service routine is found. * * This is equivalent to lis_bcanput(q->q_next, band). It is * a routine in AT&T's MP DKI. * * returns STR_OK if msg can be put(), STR_ERR (0) if not. * */extern int lis_bcanputnext(queue_t *q, unsigned char band);/* ------------------------------------------------------------------- *//* lis_bcanputnext_anyband - search the stream starting from the queue after q * until a service routine is found. Return true if there is some * non-zero qband in that queue that can be written into. * * returns STR_OK if msg can be put(), STR_ERR (0) if not. * */extern int lis_bcanputnext_anyband(queue_t *q);/* ------------------------------------------------------------------- *//* lis_qcountstrm - return the accumulated q_count fields of all the * queues hooked together in this stream. * This routine also sets the QCLOSING flag for each * queue that it encounters. It is used only by the * close logic to drain queues. */extern int lis_qcountstrm(queue_t *q) ;#endif /* __KERNEL__ *//* ------------------------------------------------------------------- */#endif /*!_QUEUE_H*//*----------------------------------------------------------------------# Local Variables: ***# change-log-default-name: "~/src/prj/streams/src/NOTES" ***# End: *** ----------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -