| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: privcmd.c,v 1.54 2020/04/07 08:14:42 jdolecek Exp $ */ | | 1 | /* $NetBSD: privcmd.c,v 1.55 2020/04/19 20:07:53 jdolecek Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2004 Christian Limpach. | | 4 | * Copyright (c) 2004 Christian Limpach. |
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 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.54 2020/04/07 08:14:42 jdolecek Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.55 2020/04/19 20:07:53 jdolecek Exp $"); |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/systm.h> | | 33 | #include <sys/systm.h> |
34 | #include <sys/vnode.h> | | 34 | #include <sys/vnode.h> |
35 | #include <sys/dirent.h> | | 35 | #include <sys/dirent.h> |
36 | #include <sys/stat.h> | | 36 | #include <sys/stat.h> |
37 | #include <sys/proc.h> | | 37 | #include <sys/proc.h> |
38 | | | 38 | |
39 | #include <miscfs/specfs/specdev.h> | | 39 | #include <miscfs/specfs/specdev.h> |
40 | #include <miscfs/kernfs/kernfs.h> | | 40 | #include <miscfs/kernfs/kernfs.h> |
41 | | | 41 | |
42 | #include <uvm/uvm.h> | | 42 | #include <uvm/uvm.h> |
43 | #include <uvm/uvm_fault.h> | | 43 | #include <uvm/uvm_fault.h> |
| @@ -430,27 +430,27 @@ privcmd_ioctl(void *v) | | | @@ -430,27 +430,27 @@ privcmd_ioctl(void *v) |
430 | | | 430 | |
431 | if (error != 0) | | 431 | if (error != 0) |
432 | return error; | | 432 | return error; |
433 | | | 433 | |
434 | break; | | 434 | break; |
435 | } | | 435 | } |
436 | default: | | 436 | default: |
437 | error = EINVAL; | | 437 | error = EINVAL; |
438 | } | | 438 | } |
439 | | | 439 | |
440 | return error; | | 440 | return error; |
441 | } | | 441 | } |
442 | | | 442 | |
443 | static struct uvm_pagerops privpgops = { | | 443 | static const struct uvm_pagerops privpgops = { |
444 | .pgo_reference = privpgop_reference, | | 444 | .pgo_reference = privpgop_reference, |
445 | .pgo_detach = privpgop_detach, | | 445 | .pgo_detach = privpgop_detach, |
446 | .pgo_fault = privpgop_fault, | | 446 | .pgo_fault = privpgop_fault, |
447 | }; | | 447 | }; |
448 | | | 448 | |
449 | static void | | 449 | static void |
450 | privpgop_reference(struct uvm_object *uobj) | | 450 | privpgop_reference(struct uvm_object *uobj) |
451 | { | | 451 | { |
452 | rw_enter(uobj->vmobjlock, RW_WRITER); | | 452 | rw_enter(uobj->vmobjlock, RW_WRITER); |
453 | uobj->uo_refs++; | | 453 | uobj->uo_refs++; |
454 | rw_exit(uobj->vmobjlock); | | 454 | rw_exit(uobj->vmobjlock); |
455 | } | | 455 | } |
456 | | | 456 | |