1/* 2 * CDDL HEADER START 3 * 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. 7 * 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. 12 * 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] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#ifndef _SYS_LWP_H 28#define _SYS_LWP_H 29 30#pragma ident "@(#)lwp.h 1.36 08/05/31 SMI" 31 32#if !defined(__APPLE__) 33#include <sys/synch.h> 34#include <sys/ucontext.h> 35#else /* is Apple Mac OS X */ 36 37#ifdef KERNEL 38#ifndef _KERNEL 39#define _KERNEL /* Solaris vs. Darwin */ 40#endif 41#endif 42 43#include "darwin_shim.h" /* In lieu of Solaris <sys/synch.h> and <sys/ucontext.h> */ 44#endif /* __APPLE__ */ 45 46#ifdef __cplusplus 47extern "C" { 48#endif 49 50/* 51 * lwp create flags 52 */ 53#define LWP_DAEMON 0x00000020 54#define LWP_DETACHED 0x00000040 55#define LWP_SUSPENDED 0x00000080 56 57/* 58 * Definitions for user programs calling into the _lwp interface. 59 */ 60struct lwpinfo { 61 timestruc_t lwp_utime; 62 timestruc_t lwp_stime; 63 long lwpinfo_pad[64]; 64}; 65 66#if defined(_SYSCALL32) 67 68/* Kernel's view of user ILP32 lwpinfo structure */ 69 70struct lwpinfo32 { 71 timestruc32_t lwp_utime; 72 timestruc32_t lwp_stime; 73 int32_t lwpinfo_pad[64]; 74}; 75 76#endif /* _SYSCALL32 */ 77 78#define _LWP_FSBASE 0 79#define _LWP_GSBASE 1 80 81#define _LWP_SETPRIVATE 0 82#define _LWP_GETPRIVATE 1 83 84#ifndef _KERNEL 85 86typedef uint_t lwpid_t; 87 88int _lwp_kill(lwpid_t, int); 89int _lwp_info(struct lwpinfo *); 90lwpid_t _lwp_self(void); 91int _lwp_suspend(lwpid_t); 92int _lwp_continue(lwpid_t); 93 94#endif /* _KERNEL */ 95 96#ifdef __cplusplus 97} 98#endif 99 100#endif /* _SYS_LWP_H */ 101