Print this page
8115 parallel zfs mount
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libfakekernel/common/sys/proc.h
+++ new/usr/src/lib/libfakekernel/common/sys/proc.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
25 + * Copyright 2017 RackTop Systems.
25 26 */
26 27
27 28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 29 /* All Rights Reserved */
29 30
30 31 #ifndef _SYS_PROC_H
31 32 #define _SYS_PROC_H
32 33
33 34 #include <sys/time.h>
34 35 #include <sys/thread.h>
35 36 #include <sys/cred.h>
36 37 #include <sys/debug.h>
37 38 #include <sys/signal.h>
38 39 #include <sys/list.h>
39 40 #include <sys/avl.h>
40 41 #include <sys/refstr.h>
41 42
42 43 #ifdef __cplusplus
43 44 extern "C" {
44 45 #endif
45 46
46 47 struct pool;
47 48 struct task;
48 49 struct zone;
49 50
50 51 /*
51 52 * One structure allocated per active process. It contains all
52 53 * data needed about the process while the process may be swapped
53 54 * out. Other per-process data (user.h) is also inside the proc structure.
54 55 * Lightweight-process data (lwp.h) and the kernel stack may be swapped out.
55 56 */
56 57 typedef struct proc {
57 58
58 59 struct cred *p_cred; /* process credentials */
59 60
60 61 struct pid *p_pidp; /* process ID info */
61 62 struct pid *p_pgidp; /* process group ID info */
62 63
63 64 /*
64 65 * Per process lwp and kernel thread stuff
65 66 */
66 67
67 68 struct zone *p_zone; /* zone in which process lives */
68 69
69 70 int do_not_use[10];
70 71 int p_user[10]; /* (see sys/user.h) */
71 72 } proc_t;
72 73
73 74 #define PROC_T /* headers relying on proc_t are OK */
74 75
75 76 /* process ID info */
76 77
77 78 struct pid {
78 79 unsigned int pid_prinactive :1;
79 80 unsigned int pid_pgorphaned :1;
80 81 unsigned int pid_padding :6; /* used to be pid_ref, now an int */
81 82 unsigned int pid_prslot :24;
82 83 pid_t pid_id;
83 84 struct proc *pid_pglink;
84 85 struct proc *pid_pgtail;
85 86 struct pid *pid_link;
86 87 uint_t pid_ref;
87 88 };
88 89
89 90 #define p_pgrp p_pgidp->pid_id
90 91 #define p_pid p_pidp->pid_id
91 92 #define p_slot p_pidp->pid_prslot
92 93 #define p_detached p_pgidp->pid_pgorphaned
93 94
94 95 #define PID_HOLD(pidp) ASSERT(MUTEX_HELD(&pidlock)); \
95 96 ++(pidp)->pid_ref;
96 97 #define PID_RELE(pidp) ASSERT(MUTEX_HELD(&pidlock)); \
97 98 (pidp)->pid_ref > 1 ? \
98 99 --(pidp)->pid_ref : pid_rele(pidp);
99 100
100 101 /*
101 102 * Structure containing persistent process lock. The structure and
102 103 * macro allow "mutex_enter(&p->p_lock)" to continue working.
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
103 104 */
104 105 struct plock {
105 106 kmutex_t pl_lock;
106 107 };
107 108 #define p_lock p_lockp->pl_lock
108 109
109 110 extern proc_t p0; /* process 0 */
110 111 extern struct plock p0lock; /* p0's plock */
111 112 extern struct pid pid0; /* p0's pid */
112 113
114 +extern int issig(int);
115 +#define ISSIG(thr, why) issig(why)
113 116
117 +/* Reasons for calling issig() */
118 +
119 +#define FORREAL 0 /* Usual side-effects */
120 +#define JUSTLOOKING 1 /* Don't stop the process */
121 +
122 +extern void tsd_create(uint_t *, void (*)(void *));
123 +extern void tsd_destroy(uint_t *);
124 +extern void *tsd_get(uint_t);
125 +extern int tsd_set(uint_t, void *);
126 +
114 127 /*
115 128 * This is normally in sunddi.h but
116 129 * I didn't want to drag that in here.
117 130 */
118 131 pid_t
119 132 ddi_get_pid(void);
120 133
121 134 #ifdef __cplusplus
122 135 }
123 136 #endif
124 137
125 138 #endif /* _SYS_PROC_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX