Print this page
3946 ::gcore
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>


   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   "%Z%%M% %I%     %E% SMI"
  31 
  32 #include <sys/synch.h>
  33 #include <sys/ucontext.h>
  34 
  35 #ifdef  __cplusplus
  36 extern "C" {
  37 #endif
  38 
  39 /*
  40  * lwp create flags
  41  */
  42 #define LWP_DAEMON      0x00000020
  43 #define LWP_DETACHED    0x00000040
  44 #define LWP_SUSPENDED   0x00000080
  45 
  46 /*
  47  * Definitions for user programs calling into the _lwp interface.
  48  */
  49 struct lwpinfo {
  50         timestruc_t lwp_utime;
  51         timestruc_t lwp_stime;
  52         long        lwpinfo_pad[64];
  53 };
  54 
  55 #if defined(_SYSCALL32)
  56 
  57 /* Kernel's view of user ILP32 lwpinfo structure */
  58 
  59 struct lwpinfo32 {
  60         timestruc32_t   lwp_utime;
  61         timestruc32_t   lwp_stime;
  62         int32_t         lwpinfo_pad[64];
  63 };
  64 
  65 #endif  /* _SYSCALL32 */
  66 


  67 #define _LWP_FSBASE     0
  68 #define _LWP_GSBASE     1
  69 
  70 #define _LWP_SETPRIVATE 0
  71 #define _LWP_GETPRIVATE 1
  72 
  73 #ifndef _KERNEL
  74 
  75 typedef uint_t lwpid_t;
  76 
  77 int             _lwp_kill(lwpid_t, int);
  78 int             _lwp_info(struct lwpinfo *);
  79 lwpid_t         _lwp_self(void);
  80 int             _lwp_suspend(lwpid_t);
  81 int             _lwp_continue(lwpid_t);
  82 
  83 #endif  /* _KERNEL */
  84 
  85 #ifdef  __cplusplus
  86 }
  87 #endif
  88 
  89 #endif  /* _SYS_LWP_H */


   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  * Copyright (c) 2013 by Delphix. All rights reserved.
  28  */
  29 
  30 #ifndef _SYS_LWP_H
  31 #define _SYS_LWP_H
  32 


  33 #include <sys/synch.h>
  34 #include <sys/ucontext.h>
  35 
  36 #ifdef  __cplusplus
  37 extern "C" {
  38 #endif
  39 
  40 /*
  41  * lwp create flags
  42  */
  43 #define LWP_DAEMON      0x00000020
  44 #define LWP_DETACHED    0x00000040
  45 #define LWP_SUSPENDED   0x00000080
  46 
  47 /*
  48  * Definitions for user programs calling into the _lwp interface.
  49  */
  50 struct lwpinfo {
  51         timestruc_t lwp_utime;
  52         timestruc_t lwp_stime;
  53         long        lwpinfo_pad[64];
  54 };
  55 
  56 #if defined(_SYSCALL32)
  57 
  58 /* Kernel's view of user ILP32 lwpinfo structure */
  59 
  60 struct lwpinfo32 {
  61         timestruc32_t   lwp_utime;
  62         timestruc32_t   lwp_stime;
  63         int32_t         lwpinfo_pad[64];
  64 };
  65 
  66 #endif  /* _SYSCALL32 */
  67 
  68 typedef uint_t lwpid_t;
  69 
  70 #define _LWP_FSBASE     0
  71 #define _LWP_GSBASE     1
  72 
  73 #define _LWP_SETPRIVATE 0
  74 #define _LWP_GETPRIVATE 1
  75 
  76 #ifndef _KERNEL
  77 


  78 int             _lwp_kill(lwpid_t, int);
  79 int             _lwp_info(struct lwpinfo *);
  80 lwpid_t         _lwp_self(void);
  81 int             _lwp_suspend(lwpid_t);
  82 int             _lwp_continue(lwpid_t);
  83 
  84 #endif  /* _KERNEL */
  85 
  86 #ifdef  __cplusplus
  87 }
  88 #endif
  89 
  90 #endif  /* _SYS_LWP_H */