| @@ -1,64 +1,65 @@ | | | @@ -1,64 +1,65 @@ |
1 | .\" $NetBSD: kcpuset.9,v 1.3 2012/07/07 21:26:36 rmind Exp $ */ | | 1 | .\" $NetBSD: kcpuset.9,v 1.4 2012/09/16 22:22:45 rmind Exp $ */ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2011 Jukka Ruohonen <jruohonen.iki.fi> | | 3 | .\" Copyright (c) 2011 Jukka Ruohonen <jruohonen.iki.fi> |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Redistribution and use in source and binary forms, with or without | | 6 | .\" Redistribution and use in source and binary forms, with or without |
7 | .\" modification, are permitted provided that the following conditions | | 7 | .\" modification, are permitted provided that the following conditions |
8 | .\" are met: | | 8 | .\" are met: |
9 | .\" | | 9 | .\" |
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. |
15 | .\" | | 15 | .\" |
16 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 16 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
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 | .Dd July 7, 2012 | | 28 | .Dd September 16, 2012 |
29 | .Dt KCPUSET 9 | | 29 | .Dt KCPUSET 9 |
30 | .Os | | 30 | .Os |
31 | .Sh NAME | | 31 | .Sh NAME |
32 | .Nm kcpuset , | | 32 | .Nm kcpuset , |
33 | .Nm kcpuset_create , | | 33 | .Nm kcpuset_create , |
34 | .Nm kcpuset_destroy , | | 34 | .Nm kcpuset_destroy , |
35 | .Nm kcpuset_copy , | | 35 | .Nm kcpuset_copy , |
36 | .Nm kcpuset_use , | | 36 | .Nm kcpuset_use , |
37 | .Nm kcpuset_unuse , | | 37 | .Nm kcpuset_unuse , |
38 | .Nm kcpuset_copyin , | | 38 | .Nm kcpuset_copyin , |
39 | .Nm kcpuset_copyout , | | 39 | .Nm kcpuset_copyout , |
40 | .Nm kcpuset_zero , | | 40 | .Nm kcpuset_zero , |
41 | .Nm kcpuset_fill , | | 41 | .Nm kcpuset_fill , |
42 | .Nm kcpuset_set , | | 42 | .Nm kcpuset_set , |
43 | .Nm kcpuset_clear , | | 43 | .Nm kcpuset_clear , |
44 | .Nm kcpuset_isset , | | 44 | .Nm kcpuset_isset , |
45 | .Nm kcpuset_isotherset , | | 45 | .Nm kcpuset_isotherset , |
46 | .Nm kcpuset_iszero , | | 46 | .Nm kcpuset_iszero , |
47 | .Nm kcpuset_match , | | 47 | .Nm kcpuset_match , |
48 | .Nm kcpuset_merge , | | 48 | .Nm kcpuset_merge , |
49 | .Nm kcpuset_countset , | | 49 | .Nm kcpuset_countset , |
50 | .Nm kcpuset_atomic_set , | | 50 | .Nm kcpuset_atomic_set , |
51 | .Nm kcpuset_atomic_clear | | 51 | .Nm kcpuset_atomic_clear |
| | | 52 | .Nm kcpuset_export_32 |
52 | .Nd dynamic kernel CPU sets | | 53 | .Nd dynamic kernel CPU sets |
53 | .Sh SYNOPSIS | | 54 | .Sh SYNOPSIS |
54 | .In sys/kcpuset.h | | 55 | .In sys/kcpuset.h |
55 | .Ft void | | 56 | .Ft void |
56 | .Fn kcpuset_create "kcpuset_t **retkcp" "bool zero" | | 57 | .Fn kcpuset_create "kcpuset_t **retkcp" "bool zero" |
57 | .Ft void | | 58 | .Ft void |
58 | .Fn kcpuset_destroy "kcpuset_t *kcp" | | 59 | .Fn kcpuset_destroy "kcpuset_t *kcp" |
59 | .Ft void | | 60 | .Ft void |
60 | .Fn kcpuset_copy "kcpuset_t *dkcp" "kcpuset_t *skcp" | | 61 | .Fn kcpuset_copy "kcpuset_t *dkcp" "kcpuset_t *skcp" |
61 | .Ft void | | 62 | .Ft void |
62 | .Fn kcpuset_use "kcpuset_t *kcp" | | 63 | .Fn kcpuset_use "kcpuset_t *kcp" |
63 | .Ft void | | 64 | .Ft void |
64 | .Fn kcpuset_unuse "kcpuset_t *kcp" "kcpuset_t **lst" | | 65 | .Fn kcpuset_unuse "kcpuset_t *kcp" "kcpuset_t **lst" |
| @@ -80,26 +81,28 @@ | | | @@ -80,26 +81,28 @@ |
80 | .Fn kcpuset_isotherset "kcpuset_t * kcp" "cpuid_t cpu" | | 81 | .Fn kcpuset_isotherset "kcpuset_t * kcp" "cpuid_t cpu" |
81 | .Ft bool | | 82 | .Ft bool |
82 | .Fn kcpuset_iszero "kcpuset_t *kcp" | | 83 | .Fn kcpuset_iszero "kcpuset_t *kcp" |
83 | .Ft bool | | 84 | .Ft bool |
84 | .Fn kcpuset_match "const kcpuset_t *kcp1" "const kcpuset_t *kcp2" | | 85 | .Fn kcpuset_match "const kcpuset_t *kcp1" "const kcpuset_t *kcp2" |
85 | .Ft void | | 86 | .Ft void |
86 | .Fn kcpuset_merge "kcpuset_t *kcp1" "kcpuset_t *kcp2" | | 87 | .Fn kcpuset_merge "kcpuset_t *kcp1" "kcpuset_t *kcp2" |
87 | .Ft int | | 88 | .Ft int |
88 | .Fn kcpuset_countset "kcpuset_t *kcp1" | | 89 | .Fn kcpuset_countset "kcpuset_t *kcp1" |
89 | .Ft void | | 90 | .Ft void |
90 | .Fn kcpuset_atomic_set "kcpuset_t *kcp" "cpuid_t cpu" | | 91 | .Fn kcpuset_atomic_set "kcpuset_t *kcp" "cpuid_t cpu" |
91 | .Ft void | | 92 | .Ft void |
92 | .Fn kcpuset_atomic_clear "kcpuset_t *kcp" "cpuid_t cpu" | | 93 | .Fn kcpuset_atomic_clear "kcpuset_t *kcp" "cpuid_t cpu" |
| | | 94 | .Ft void |
| | | 95 | .Fn kcpuset_export_u32 "const kcpuset_t *kcp" "uint32_t *bitfield" "size_t len" |
93 | .Sh DESCRIPTION | | 96 | .Sh DESCRIPTION |
94 | The machine-independent | | 97 | The machine-independent |
95 | .Nm | | 98 | .Nm |
96 | subsystem provides support for dynamic processor sets. | | 99 | subsystem provides support for dynamic processor sets. |
97 | Conceptually | | 100 | Conceptually |
98 | .Nm | | 101 | .Nm |
99 | can be understood to be the kernel equivalent of the user space | | 102 | can be understood to be the kernel equivalent of the user space |
100 | .Xr cpuset 3 | | 103 | .Xr cpuset 3 |
101 | interface. | | 104 | interface. |
102 | .Sh FUNCTIONS | | 105 | .Sh FUNCTIONS |
103 | .Bl -tag -width compact | | 106 | .Bl -tag -width compact |
104 | .It Fn kcpuset_create "retkcp" "zero" | | 107 | .It Fn kcpuset_create "retkcp" "zero" |
105 | The | | 108 | The |
| @@ -221,26 +224,36 @@ The | | | @@ -221,26 +224,36 @@ The |
221 | function operates as | | 224 | function operates as |
222 | .Fn kcpuset_set , | | 225 | .Fn kcpuset_set , |
223 | but the operation is atomic; see | | 226 | but the operation is atomic; see |
224 | .Xr atomic_ops 3 | | 227 | .Xr atomic_ops 3 |
225 | for more details. | | 228 | for more details. |
226 | .It Fn kcpuset_atomic_clear "kcp" "cpu" | | 229 | .It Fn kcpuset_atomic_clear "kcp" "cpu" |
227 | Removes | | 230 | Removes |
228 | .Fa cpu | | 231 | .Fa cpu |
229 | from the | | 232 | from the |
230 | .Tn CPU | | 233 | .Tn CPU |
231 | set | | 234 | set |
232 | .Fa kcp | | 235 | .Fa kcp |
233 | atomically. | | 236 | atomically. |
| | | 237 | .Fn kcpuset_export_u32 "kcp" "bitfield" "len" |
| | | 238 | Exports the CPU set |
| | | 239 | .Fa kcp |
| | | 240 | into a format of 32-bit integer array, |
| | | 241 | specified by |
| | | 242 | .Fa bitfield |
| | | 243 | and length in bytes by |
| | | 244 | .Fa len . |
| | | 245 | An integers is in the host byte-order and represents a bit field. |
| | | 246 | The first bit at index zero represents CPU number 0, and so on. |
234 | .El | | 247 | .El |
235 | .Sh CODE REFERENCES | | 248 | .Sh CODE REFERENCES |
236 | The | | 249 | The |
237 | .Nm | | 250 | .Nm |
238 | subsystem is implemented within | | 251 | subsystem is implemented within |
239 | .Pa sys/kern/subr_kcpuset.c . | | 252 | .Pa sys/kern/subr_kcpuset.c . |
240 | .Sh SEE ALSO | | 253 | .Sh SEE ALSO |
241 | .Xr cpuset 3 | | 254 | .Xr cpuset 3 |
242 | .Sh HISTORY | | 255 | .Sh HISTORY |
243 | The | | 256 | The |
244 | .Nm | | 257 | .Nm |
245 | subsystem first appeared in | | 258 | subsystem first appeared in |
246 | .Nx 6.0 . | | 259 | .Nx 6.0 . |