G/C M_EMULDATAdiff -r1.33 -r1.34 src/sys/kern/kern_pmf.c
(rmind)
--- src/sys/kern/kern_pmf.c 2010/02/24 22:38:09 1.33
+++ src/sys/kern/kern_pmf.c 2011/04/27 00:36:47 1.34
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kern_pmf.c,v 1.33 2010/02/24 22:38:09 dyoung Exp $ */ | 1 | /* $NetBSD: kern_pmf.c,v 1.34 2011/04/27 00:36:47 rmind Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.33 2010/02/24 22:38:09 dyoung Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.34 2011/04/27 00:36:47 rmind Exp $"); | |
31 | 31 | |||
32 | #include <sys/types.h> | 32 | #include <sys/types.h> | |
33 | #include <sys/param.h> | 33 | #include <sys/param.h> | |
34 | #include <sys/kmem.h> | 34 | #include <sys/kmem.h> | |
35 | #include <sys/buf.h> | 35 | #include <sys/buf.h> | |
36 | #include <sys/callout.h> | 36 | #include <sys/callout.h> | |
37 | #include <sys/kernel.h> | 37 | #include <sys/kernel.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/pmf.h> | 39 | #include <sys/pmf.h> | |
40 | #include <sys/queue.h> | 40 | #include <sys/queue.h> | |
41 | #include <sys/sched.h> | 41 | #include <sys/sched.h> | |
42 | #include <sys/syscallargs.h> /* for sys_sync */ | 42 | #include <sys/syscallargs.h> /* for sys_sync */ | |
43 | #include <sys/workqueue.h> | 43 | #include <sys/workqueue.h> | |
@@ -72,26 +72,27 @@ int pmf_debug_transition; | @@ -72,26 +72,27 @@ int pmf_debug_transition; | |||
72 | #define PMF_TRANSITION_PRINTF(x) if (pmf_debug_transition) printf x | 72 | #define PMF_TRANSITION_PRINTF(x) if (pmf_debug_transition) printf x | |
73 | #define PMF_TRANSITION_PRINTF2(y,x) if (pmf_debug_transition>y) printf x | 73 | #define PMF_TRANSITION_PRINTF2(y,x) if (pmf_debug_transition>y) printf x | |
74 | #else | 74 | #else | |
75 | #define PMF_SUSPENSOR_PRINTF(x) do { } while (0) | 75 | #define PMF_SUSPENSOR_PRINTF(x) do { } while (0) | |
76 | #define PMF_SUSPEND_PRINTF(x) do { } while (0) | 76 | #define PMF_SUSPEND_PRINTF(x) do { } while (0) | |
77 | #define PMF_EVENT_PRINTF(x) do { } while (0) | 77 | #define PMF_EVENT_PRINTF(x) do { } while (0) | |
78 | #define PMF_IDLE_PRINTF(x) do { } while (0) | 78 | #define PMF_IDLE_PRINTF(x) do { } while (0) | |
79 | #define PMF_TRANSITION_PRINTF(x) do { } while (0) | 79 | #define PMF_TRANSITION_PRINTF(x) do { } while (0) | |
80 | #define PMF_TRANSITION_PRINTF2(y,x) do { } while (0) | 80 | #define PMF_TRANSITION_PRINTF2(y,x) do { } while (0) | |
81 | #endif | 81 | #endif | |
82 | 82 | |||
83 | /* #define PMF_DEBUG */ | 83 | /* #define PMF_DEBUG */ | |
84 | 84 | |||
85 | #include <sys/mallocvar.h> | |||
85 | MALLOC_DEFINE(M_PMF, "pmf", "device pmf messaging memory"); | 86 | MALLOC_DEFINE(M_PMF, "pmf", "device pmf messaging memory"); | |
86 | 87 | |||
87 | static prop_dictionary_t pmf_platform = NULL; | 88 | static prop_dictionary_t pmf_platform = NULL; | |
88 | static struct workqueue *pmf_event_workqueue; | 89 | static struct workqueue *pmf_event_workqueue; | |
89 | static struct workqueue *pmf_suspend_workqueue; | 90 | static struct workqueue *pmf_suspend_workqueue; | |
90 | 91 | |||
91 | typedef struct pmf_event_handler { | 92 | typedef struct pmf_event_handler { | |
92 | TAILQ_ENTRY(pmf_event_handler) pmf_link; | 93 | TAILQ_ENTRY(pmf_event_handler) pmf_link; | |
93 | pmf_generic_event_t pmf_event; | 94 | pmf_generic_event_t pmf_event; | |
94 | void (*pmf_handler)(device_t); | 95 | void (*pmf_handler)(device_t); | |
95 | device_t pmf_device; | 96 | device_t pmf_device; | |
96 | bool pmf_global; | 97 | bool pmf_global; | |
97 | } pmf_event_handler_t; | 98 | } pmf_event_handler_t; |
--- src/sys/kern/kern_proc.c 2011/04/18 00:26:11 1.175
+++ src/sys/kern/kern_proc.c 2011/04/27 00:36:47 1.176
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: kern_proc.c,v 1.175 2011/04/18 00:26:11 rmind Exp $ */ | 1 | /* $NetBSD: kern_proc.c,v 1.176 2011/04/27 00:36:47 rmind Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | |
9 | * NASA Ames Research Center, and by Andrew Doran. | 9 | * NASA Ames Research Center, and by Andrew Doran. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -52,27 +52,27 @@ | @@ -52,27 +52,27 @@ | |||
52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | * | 60 | * | |
61 | * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 | 61 | * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #include <sys/cdefs.h> | 64 | #include <sys/cdefs.h> | |
65 | __KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.175 2011/04/18 00:26:11 rmind Exp $"); | 65 | __KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.176 2011/04/27 00:36:47 rmind Exp $"); | |
66 | 66 | |||
67 | #ifdef _KERNEL_OPT | 67 | #ifdef _KERNEL_OPT | |
68 | #include "opt_kstack.h" | 68 | #include "opt_kstack.h" | |
69 | #include "opt_maxuprc.h" | 69 | #include "opt_maxuprc.h" | |
70 | #include "opt_dtrace.h" | 70 | #include "opt_dtrace.h" | |
71 | #include "opt_compat_netbsd32.h" | 71 | #include "opt_compat_netbsd32.h" | |
72 | #endif | 72 | #endif | |
73 | 73 | |||
74 | #include <sys/param.h> | 74 | #include <sys/param.h> | |
75 | #include <sys/systm.h> | 75 | #include <sys/systm.h> | |
76 | #include <sys/kernel.h> | 76 | #include <sys/kernel.h> | |
77 | #include <sys/proc.h> | 77 | #include <sys/proc.h> | |
78 | #include <sys/resourcevar.h> | 78 | #include <sys/resourcevar.h> | |
@@ -194,28 +194,26 @@ struct proc proc0 = { | @@ -194,28 +194,26 @@ struct proc proc0 = { | |||
194 | .p_cwdi = &cwdi0, | 194 | .p_cwdi = &cwdi0, | |
195 | .p_limit = &limit0, | 195 | .p_limit = &limit0, | |
196 | .p_fd = &filedesc0, | 196 | .p_fd = &filedesc0, | |
197 | .p_vmspace = &vmspace0, | 197 | .p_vmspace = &vmspace0, | |
198 | .p_stats = &pstat0, | 198 | .p_stats = &pstat0, | |
199 | .p_sigacts = &sigacts0, | 199 | .p_sigacts = &sigacts0, | |
200 | }; | 200 | }; | |
201 | kauth_cred_t cred0; | 201 | kauth_cred_t cred0; | |
202 | 202 | |||
203 | int nofile = NOFILE; | 203 | int nofile = NOFILE; | |
204 | int maxuprc = MAXUPRC; | 204 | int maxuprc = MAXUPRC; | |
205 | int cmask = CMASK; | 205 | int cmask = CMASK; | |
206 | 206 | |||
207 | MALLOC_DEFINE(M_EMULDATA, "emuldata", "Per-process emulation data"); | |||
208 | ||||
209 | static int sysctl_doeproc(SYSCTLFN_PROTO); | 207 | static int sysctl_doeproc(SYSCTLFN_PROTO); | |
210 | static int sysctl_kern_proc_args(SYSCTLFN_PROTO); | 208 | static int sysctl_kern_proc_args(SYSCTLFN_PROTO); | |
211 | static void fill_kproc2(struct proc *, struct kinfo_proc2 *, bool); | 209 | static void fill_kproc2(struct proc *, struct kinfo_proc2 *, bool); | |
212 | 210 | |||
213 | /* | 211 | /* | |
214 | * The process list descriptors, used during pid allocation and | 212 | * The process list descriptors, used during pid allocation and | |
215 | * by sysctl. No locking on this data structure is needed since | 213 | * by sysctl. No locking on this data structure is needed since | |
216 | * it is completely static. | 214 | * it is completely static. | |
217 | */ | 215 | */ | |
218 | const struct proclist_desc proclists[] = { | 216 | const struct proclist_desc proclists[] = { | |
219 | { &allproc }, | 217 | { &allproc }, | |
220 | { &zombproc }, | 218 | { &zombproc }, | |
221 | { NULL }, | 219 | { NULL }, |
--- src/sys/netbt/bluetooth.h 2011/03/16 21:35:30 1.10
+++ src/sys/netbt/bluetooth.h 2011/04/27 00:36:48 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bluetooth.h,v 1.10 2011/03/16 21:35:30 plunky Exp $ */ | 1 | /* $NetBSD: bluetooth.h,v 1.11 2011/04/27 00:36:48 rmind Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2005 Iain Hibbert. | 4 | * Copyright (c) 2005 Iain Hibbert. | |
5 | * Copyright (c) 2006 Itronix Inc. | 5 | * Copyright (c) 2006 Itronix Inc. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -93,26 +93,27 @@ struct sockaddr_bt { | @@ -93,26 +93,27 @@ struct sockaddr_bt { | |||
93 | uint8_t bt_len; | 93 | uint8_t bt_len; | |
94 | sa_family_t bt_family; | 94 | sa_family_t bt_family; | |
95 | bdaddr_t bt_bdaddr; | 95 | bdaddr_t bt_bdaddr; | |
96 | uint16_t bt_psm; | 96 | uint16_t bt_psm; | |
97 | uint8_t bt_channel; | 97 | uint8_t bt_channel; | |
98 | uint8_t bt_zero[5]; | 98 | uint8_t bt_zero[5]; | |
99 | }; | 99 | }; | |
100 | 100 | |||
101 | /* Note: this is actually 6 bytes including terminator */ | 101 | /* Note: this is actually 6 bytes including terminator */ | |
102 | #define BDADDR_ANY ((const bdaddr_t *) "\000\000\000\000\000") | 102 | #define BDADDR_ANY ((const bdaddr_t *) "\000\000\000\000\000") | |
103 | 103 | |||
104 | #ifdef _KERNEL | 104 | #ifdef _KERNEL | |
105 | 105 | |||
106 | #include <sys/mallocvar.h> | |||
106 | MALLOC_DECLARE(M_BLUETOOTH); | 107 | MALLOC_DECLARE(M_BLUETOOTH); | |
107 | 108 | |||
108 | /* | 109 | /* | |
109 | * Bluetooth Protocol API callback methods | 110 | * Bluetooth Protocol API callback methods | |
110 | */ | 111 | */ | |
111 | struct mbuf; | 112 | struct mbuf; | |
112 | struct btproto { | 113 | struct btproto { | |
113 | void (*connecting)(void *); | 114 | void (*connecting)(void *); | |
114 | void (*connected)(void *); | 115 | void (*connected)(void *); | |
115 | void (*disconnected)(void *, int); | 116 | void (*disconnected)(void *, int); | |
116 | void *(*newconn)(void *, struct sockaddr_bt *, struct sockaddr_bt *); | 117 | void *(*newconn)(void *, struct sockaddr_bt *, struct sockaddr_bt *); | |
117 | void (*complete)(void *, int); | 118 | void (*complete)(void *, int); | |
118 | void (*linkmode)(void *, int); | 119 | void (*linkmode)(void *, int); |
--- src/sys/sys/proc.h 2011/04/18 00:26:11 1.304
+++ src/sys/sys/proc.h 2011/04/27 00:36:48 1.305
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: proc.h,v 1.304 2011/04/18 00:26:11 rmind Exp $ */ | 1 | /* $NetBSD: proc.h,v 1.305 2011/04/27 00:36:48 rmind Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Andrew Doran. | 8 | * by Andrew Doran. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -401,28 +401,26 @@ struct proc { | @@ -401,28 +401,26 @@ struct proc { | |||
401 | LIST_HEAD(proclist, proc); /* A list of processes */ | 401 | LIST_HEAD(proclist, proc); /* A list of processes */ | |
402 | 402 | |||
403 | /* | 403 | /* | |
404 | * This structure associates a proclist with its lock. | 404 | * This structure associates a proclist with its lock. | |
405 | */ | 405 | */ | |
406 | struct proclist_desc { | 406 | struct proclist_desc { | |
407 | struct proclist *pd_list; /* The list */ | 407 | struct proclist *pd_list; /* The list */ | |
408 | /* | 408 | /* | |
409 | * XXX Add a pointer to the proclist's lock eventually. | 409 | * XXX Add a pointer to the proclist's lock eventually. | |
410 | */ | 410 | */ | |
411 | }; | 411 | }; | |
412 | 412 | |||
413 | #ifdef _KERNEL | 413 | #ifdef _KERNEL | |
414 | #include <sys/mallocvar.h> | |||
415 | MALLOC_DECLARE(M_EMULDATA); | |||
416 | 414 | |||
417 | /* | 415 | /* | |
418 | * We use process IDs <= PID_MAX until there are > 16k processes. | 416 | * We use process IDs <= PID_MAX until there are > 16k processes. | |
419 | * NO_PGID is used to represent "no process group" for a tty. | 417 | * NO_PGID is used to represent "no process group" for a tty. | |
420 | */ | 418 | */ | |
421 | #define PID_MAX 30000 | 419 | #define PID_MAX 30000 | |
422 | #define NO_PGID ((pid_t)-1) | 420 | #define NO_PGID ((pid_t)-1) | |
423 | 421 | |||
424 | #define SESS_LEADER(p) ((p)->p_session->s_leader == (p)) | 422 | #define SESS_LEADER(p) ((p)->p_session->s_leader == (p)) | |
425 | 423 | |||
426 | /* | 424 | /* | |
427 | * Flags passed to fork1(). | 425 | * Flags passed to fork1(). | |
428 | */ | 426 | */ |