1*b819cea2SGordon Ross /* 2*b819cea2SGordon Ross * CDDL HEADER START 3*b819cea2SGordon Ross * 4*b819cea2SGordon Ross * The contents of this file are subject to the terms of the 5*b819cea2SGordon Ross * Common Development and Distribution License (the "License"). 6*b819cea2SGordon Ross * You may not use this file except in compliance with the License. 7*b819cea2SGordon Ross * 8*b819cea2SGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*b819cea2SGordon Ross * or http://www.opensolaris.org/os/licensing. 10*b819cea2SGordon Ross * See the License for the specific language governing permissions 11*b819cea2SGordon Ross * and limitations under the License. 12*b819cea2SGordon Ross * 13*b819cea2SGordon Ross * When distributing Covered Code, include this CDDL HEADER in each 14*b819cea2SGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*b819cea2SGordon Ross * If applicable, add the following below this CDDL HEADER, with the 16*b819cea2SGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying 17*b819cea2SGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner] 18*b819cea2SGordon Ross * 19*b819cea2SGordon Ross * CDDL HEADER END 20*b819cea2SGordon Ross */ 21*b819cea2SGordon Ross /* 22*b819cea2SGordon Ross * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 23*b819cea2SGordon Ross * Use is subject to license terms. 24*b819cea2SGordon Ross */ 25*b819cea2SGordon Ross /* 26*b819cea2SGordon Ross * Copyright 2013 Nexenta Systems, Inc. All rights reserved. 27*b819cea2SGordon Ross */ 28*b819cea2SGordon Ross 29*b819cea2SGordon Ross #ifndef _SYS_TASKQ_IMPL_H 30*b819cea2SGordon Ross #define _SYS_TASKQ_IMPL_H 31*b819cea2SGordon Ross 32*b819cea2SGordon Ross #include <sys/taskq.h> 33*b819cea2SGordon Ross #include <sys/inttypes.h> 34*b819cea2SGordon Ross #include <sys/vmem.h> 35*b819cea2SGordon Ross #include <sys/list.h> 36*b819cea2SGordon Ross #include <sys/kstat.h> 37*b819cea2SGordon Ross 38*b819cea2SGordon Ross #ifdef __cplusplus 39*b819cea2SGordon Ross extern "C" { 40*b819cea2SGordon Ross #endif 41*b819cea2SGordon Ross 42*b819cea2SGordon Ross typedef struct taskq_ent { 43*b819cea2SGordon Ross struct taskq_ent *tqent_next; 44*b819cea2SGordon Ross struct taskq_ent *tqent_prev; 45*b819cea2SGordon Ross task_func_t *tqent_func; 46*b819cea2SGordon Ross void *tqent_arg; 47*b819cea2SGordon Ross uintptr_t tqent_flags; 48*b819cea2SGordon Ross } taskq_ent_t; 49*b819cea2SGordon Ross 50*b819cea2SGordon Ross #define TQENT_FLAG_PREALLOC 0x1 /* taskq_dispatch_ent used */ 51*b819cea2SGordon Ross 52*b819cea2SGordon Ross /* Special form of taskq dispatch that uses preallocated entries. */ 53*b819cea2SGordon Ross void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t, taskq_ent_t *); 54*b819cea2SGordon Ross 55*b819cea2SGordon Ross #ifdef __cplusplus 56*b819cea2SGordon Ross } 57*b819cea2SGordon Ross #endif 58*b819cea2SGordon Ross 59*b819cea2SGordon Ross #endif /* _SYS_TASKQ_IMPL_H */ 60