| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uvm_device.c,v 1.66 2017/10/28 00:37:13 pgoyette Exp $ */ | | 1 | /* $NetBSD: uvm_device.c,v 1.67 2019/12/01 16:44:11 ad Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1997 Charles D. Cranor and Washington University. | | 4 | * Copyright (c) 1997 Charles D. Cranor and Washington University. |
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. |
| @@ -22,49 +22,49 @@ | | | @@ -22,49 +22,49 @@ |
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 | * from: Id: uvm_device.c,v 1.1.2.9 1998/02/06 05:11:47 chs Exp | | 27 | * from: Id: uvm_device.c,v 1.1.2.9 1998/02/06 05:11:47 chs Exp |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | /* | | 30 | /* |
31 | * uvm_device.c: the device pager. | | 31 | * uvm_device.c: the device pager. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #include <sys/cdefs.h> | | 34 | #include <sys/cdefs.h> |
35 | __KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.66 2017/10/28 00:37:13 pgoyette Exp $"); | | 35 | __KERNEL_RCSID(0, "$NetBSD: uvm_device.c,v 1.67 2019/12/01 16:44:11 ad Exp $"); |
36 | | | 36 | |
37 | #include "opt_uvmhist.h" | | 37 | #include "opt_uvmhist.h" |
38 | | | 38 | |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/systm.h> | | 40 | #include <sys/systm.h> |
41 | #include <sys/conf.h> | | 41 | #include <sys/conf.h> |
42 | #include <sys/proc.h> | | 42 | #include <sys/proc.h> |
43 | #include <sys/kmem.h> | | 43 | #include <sys/kmem.h> |
44 | | | 44 | |
45 | #include <uvm/uvm.h> | | 45 | #include <uvm/uvm.h> |
46 | #include <uvm/uvm_device.h> | | 46 | #include <uvm/uvm_device.h> |
47 | #include <uvm/uvm_pmap.h> | | 47 | #include <uvm/uvm_pmap.h> |
48 | | | 48 | |
49 | /* | | 49 | /* |
50 | * private global data structure | | 50 | * private global data structure |
51 | * | | 51 | * |
52 | * we keep a list of active device objects in the system. | | 52 | * we keep a list of active device objects in the system. |
53 | */ | | 53 | */ |
54 | | | 54 | |
55 | LIST_HEAD(udv_list_struct, uvm_device); | | 55 | LIST_HEAD(udv_list_struct, uvm_device); |
56 | static struct udv_list_struct udv_list; | | 56 | static struct udv_list_struct udv_list; |
57 | static kmutex_t udv_lock; | | 57 | static kmutex_t udv_lock __cacheline_aligned; |
58 | | | 58 | |
59 | /* | | 59 | /* |
60 | * functions | | 60 | * functions |
61 | */ | | 61 | */ |
62 | | | 62 | |
63 | static void udv_init(void); | | 63 | static void udv_init(void); |
64 | static void udv_reference(struct uvm_object *); | | 64 | static void udv_reference(struct uvm_object *); |
65 | static void udv_detach(struct uvm_object *); | | 65 | static void udv_detach(struct uvm_object *); |
66 | static int udv_fault(struct uvm_faultinfo *, vaddr_t, | | 66 | static int udv_fault(struct uvm_faultinfo *, vaddr_t, |
67 | struct vm_page **, int, int, vm_prot_t, | | 67 | struct vm_page **, int, int, vm_prot_t, |
68 | int); | | 68 | int); |
69 | | | 69 | |
70 | /* | | 70 | /* |