8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / sys / squeue.h
blob6e998cf4b43cfefa271e7e063468e8773593a2d3
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
22 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _SYS_SQUEUE_H
26 #define _SYS_SQUEUE_H
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #include <sys/types.h>
33 #include <sys/processor.h>
34 #include <sys/stream.h>
36 struct squeue_s;
37 typedef struct squeue_s squeue_t;
39 #define SET_SQUEUE(mp, proc, arg) { \
40 ASSERT((mp)->b_prev == NULL); \
41 ASSERT((mp)->b_next == NULL); \
42 (mp)->b_queue = (queue_t *)(proc); \
43 (mp)->b_prev = (mblk_t *)(arg); \
46 #define SQ_FILL 0x0001
47 #define SQ_NODRAIN 0x0002
48 #define SQ_PROCESS 0x0004
50 #define SQUEUE_ENTER(sqp, head, tail, cnt, ira, flag, tag) { \
51 squeue_enter(sqp, head, tail, cnt, ira, flag, tag); \
54 #define SQUEUE_ENTER_ONE(sqp, mp, proc, arg, ira, flag, tag) { \
55 SET_SQUEUE(mp, proc, arg); \
56 SQUEUE_ENTER(sqp, mp, mp, 1, ira, flag, tag); \
60 * May be called only by a thread executing in the squeue. The thread must
61 * not continue to execute any code needing squeue protection after calling
62 * this macro. Please see the comments in squeue.c for more details.
64 #define SQUEUE_SWITCH(connp, new_sqp) \
65 (connp)->conn_sqp = new_sqp;
68 * Facility-special private data in squeues.
70 typedef enum {
71 SQPRIVATE_TCP,
72 SQPRIVATE_MAX
73 } sqprivate_t;
75 struct ip_recv_attr_s;
76 extern void squeue_init(void);
77 extern squeue_t *squeue_create(clock_t, pri_t);
78 extern void squeue_bind(squeue_t *, processorid_t);
79 extern void squeue_unbind(squeue_t *);
80 extern void squeue_enter(squeue_t *, mblk_t *, mblk_t *,
81 uint32_t, struct ip_recv_attr_s *, int, uint8_t);
82 extern uintptr_t *squeue_getprivate(squeue_t *, sqprivate_t);
84 struct conn_s;
85 extern int squeue_synch_enter(struct conn_s *, mblk_t *);
86 extern void squeue_synch_exit(struct conn_s *);
88 #ifdef __cplusplus
90 #endif
92 #endif /* _SYS_SQUEUE_H */