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 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _SYS_LX_PID_H
27 #define _SYS_LX_PID_H
28
29 #pragma ident "%Z%%M% %I% %E% SMI"
30
31 #include <sys/note.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef _KERNEL
38 struct lx_pid {
39 pid_t s_pid; /* the solaris pid and ... */
40 id_t s_tid; /* ... tid pair */
41 pid_t l_pid; /* the corresponding linux pid */
42 time_t l_start; /* birthday of this pid */
43 struct pid *l_pidp;
44 struct lx_pid *stol_next; /* link in stol hash table */
45 struct lx_pid *ltos_next; /* link in ltos hash table */
46 };
47
48 extern int lx_pid_assign(kthread_t *);
49 extern void lx_pid_reassign(kthread_t *);
50 extern void lx_pid_rele(pid_t, id_t);
51 extern pid_t lx_lpid_to_spair(pid_t, pid_t *, id_t *);
52 extern pid_t lx_lwp_ppid(klwp_t *, pid_t *, id_t *);
53 extern void lx_pid_init(void);
54 extern void lx_pid_fini(void);
55 #endif
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif /* _SYS_LX_PID_H */