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 2007 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_KLWP_H 30*b819cea2SGordon Ross #define _SYS_KLWP_H 31*b819cea2SGordon Ross 32*b819cea2SGordon Ross #include <sys/types.h> 33*b819cea2SGordon Ross #include <sys/condvar.h> 34*b819cea2SGordon Ross #include <sys/thread.h> 35*b819cea2SGordon Ross #include <sys/signal.h> 36*b819cea2SGordon Ross 37*b819cea2SGordon Ross #ifdef __cplusplus 38*b819cea2SGordon Ross extern "C" { 39*b819cea2SGordon Ross #endif 40*b819cea2SGordon Ross 41*b819cea2SGordon Ross /* 42*b819cea2SGordon Ross * The light-weight process object and the methods by which it 43*b819cea2SGordon Ross * is accessed. 44*b819cea2SGordon Ross */ 45*b819cea2SGordon Ross 46*b819cea2SGordon Ross #define MAXSYSARGS 8 /* Maximum # of arguments passed to a syscall */ 47*b819cea2SGordon Ross 48*b819cea2SGordon Ross /* lwp_eosys values */ 49*b819cea2SGordon Ross #define NORMALRETURN 0 /* normal return; adjusts PC, registers */ 50*b819cea2SGordon Ross #define JUSTRETURN 1 /* just return, leave registers alone */ 51*b819cea2SGordon Ross 52*b819cea2SGordon Ross typedef struct _klwp *klwp_id_t; 53*b819cea2SGordon Ross 54*b819cea2SGordon Ross typedef struct _klwp { 55*b819cea2SGordon Ross /* 56*b819cea2SGordon Ross * linkage 57*b819cea2SGordon Ross */ 58*b819cea2SGordon Ross struct _kthread *lwp_thread; 59*b819cea2SGordon Ross struct proc *lwp_procp; 60*b819cea2SGordon Ross 61*b819cea2SGordon Ross } klwp_t; 62*b819cea2SGordon Ross 63*b819cea2SGordon Ross /* lwp states */ 64*b819cea2SGordon Ross #define LWP_USER 0x01 /* Running in user mode */ 65*b819cea2SGordon Ross #define LWP_SYS 0x02 /* Running in kernel mode */ 66*b819cea2SGordon Ross 67*b819cea2SGordon Ross #if defined(_KERNEL) 68*b819cea2SGordon Ross extern volatile int lwp_default_stksize; 69*b819cea2SGordon Ross extern klwp_t lwp0; 70*b819cea2SGordon Ross 71*b819cea2SGordon Ross /* where newly-created lwps normally start */ 72*b819cea2SGordon Ross extern void lwp_rtt(void); 73*b819cea2SGordon Ross 74*b819cea2SGordon Ross #endif /* _KERNEL */ 75*b819cea2SGordon Ross 76*b819cea2SGordon Ross #ifdef __cplusplus 77*b819cea2SGordon Ross } 78*b819cea2SGordon Ross #endif 79*b819cea2SGordon Ross 80*b819cea2SGordon Ross #endif /* _SYS_KLWP_H */ 81