b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * CDDL HEADER START
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * The contents of this file are subject to the terms of the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Common Development and Distribution License (the "License").
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * You may not use this file except in compliance with the License.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * See the License for the specific language governing permissions
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * and limitations under the License.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * When distributing Covered Code, include this CDDL HEADER in each
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * If applicable, add the following below this CDDL HEADER, with the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * CDDL HEADER END
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Use is subject to license terms.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#include <sys/signal.h> /* expected by including code */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * The thread object, its states, and the methods by which it
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * is accessed.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Values that t_state may assume. Note that t_state cannot have more
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * than one of these flags set at a time.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define TS_RUN 0x02 /* Runnable, but not yet on a processor */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define TS_ONPROC 0x04 /* Thread is being run on a processor */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define TS_ZOMB 0x08 /* Thread has died but hasn't been reaped */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define TS_STOPPED 0x10 /* Stopped, initial state */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define TS_WAIT 0x20 /* Waiting to become runnable */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* ctxop_t */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* afd_t needed by sys/file.h via sys/t_lock.h */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross/* Definition for kernel thread identifier type */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossextern kthread_t *_curthread(void); /* returns thread pointer */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define curthread (_curthread()) /* current thread pointer */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define curproc (_curproc()) /* current proc pointer */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#define curzone (_curzone()) /* current zone pointer */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rossextern kthread_t *zthread_create(caddr_t, size_t, void (*)(), void *, size_t,
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross#endif /* _SYS_THREAD_H */