| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uvm_map.c,v 1.338 2016/06/01 00:49:44 christos Exp $ */ | | 1 | /* $NetBSD: uvm_map.c,v 1.339 2016/06/18 14:56:03 martin 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 | * Copyright (c) 1991, 1993, The Regents of the University of California. | | 5 | * Copyright (c) 1991, 1993, The Regents of the University of California. |
6 | * | | 6 | * |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * This code is derived from software contributed to Berkeley by | | 9 | * This code is derived from software contributed to Berkeley by |
10 | * The Mach Operating System project at Carnegie-Mellon University. | | 10 | * The Mach Operating System project at Carnegie-Mellon University. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -56,27 +56,27 @@ | | | @@ -56,27 +56,27 @@ |
56 | * School of Computer Science | | 56 | * School of Computer Science |
57 | * Carnegie Mellon University | | 57 | * Carnegie Mellon University |
58 | * Pittsburgh PA 15213-3890 | | 58 | * Pittsburgh PA 15213-3890 |
59 | * | | 59 | * |
60 | * any improvements or extensions that they make and grant Carnegie the | | 60 | * any improvements or extensions that they make and grant Carnegie the |
61 | * rights to redistribute these changes. | | 61 | * rights to redistribute these changes. |
62 | */ | | 62 | */ |
63 | | | 63 | |
64 | /* | | 64 | /* |
65 | * uvm_map.c: uvm map operations | | 65 | * uvm_map.c: uvm map operations |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.338 2016/06/01 00:49:44 christos Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.339 2016/06/18 14:56:03 martin Exp $"); |
70 | | | 70 | |
71 | #include "opt_ddb.h" | | 71 | #include "opt_ddb.h" |
72 | #include "opt_uvmhist.h" | | 72 | #include "opt_uvmhist.h" |
73 | #include "opt_uvm.h" | | 73 | #include "opt_uvm.h" |
74 | #include "opt_sysv.h" | | 74 | #include "opt_sysv.h" |
75 | | | 75 | |
76 | #include <sys/param.h> | | 76 | #include <sys/param.h> |
77 | #include <sys/systm.h> | | 77 | #include <sys/systm.h> |
78 | #include <sys/mman.h> | | 78 | #include <sys/mman.h> |
79 | #include <sys/proc.h> | | 79 | #include <sys/proc.h> |
80 | #include <sys/pool.h> | | 80 | #include <sys/pool.h> |
81 | #include <sys/kernel.h> | | 81 | #include <sys/kernel.h> |
82 | #include <sys/mount.h> | | 82 | #include <sys/mount.h> |
| @@ -2100,28 +2100,30 @@ nextgap: | | | @@ -2100,28 +2100,30 @@ nextgap: |
2100 | entry = entry->next; | | 2100 | entry = entry->next; |
2101 | if (entry == &map->header) { | | 2101 | if (entry == &map->header) { |
2102 | UVMHIST_LOG(maphist, "<- failed (off end)", | | 2102 | UVMHIST_LOG(maphist, "<- failed (off end)", |
2103 | 0,0,0,0); | | 2103 | 0,0,0,0); |
2104 | goto notfound; | | 2104 | goto notfound; |
2105 | } | | 2105 | } |
2106 | } | | 2106 | } |
2107 | } | | 2107 | } |
2108 | | | 2108 | |
2109 | found: | | 2109 | found: |
2110 | SAVE_HINT(map, map->hint, entry); | | 2110 | SAVE_HINT(map, map->hint, entry); |
2111 | *result = hint; | | 2111 | *result = hint; |
2112 | UVMHIST_LOG(maphist,"<- got it! (result=%#lx)", hint, 0,0,0); | | 2112 | UVMHIST_LOG(maphist,"<- got it! (result=%#lx)", hint, 0,0,0); |
2113 | KASSERT( topdown || hint >= orig_hint); | | 2113 | KASSERTMSG( topdown || hint >= orig_hint, "hint: %jx, orig_hint: %jx", |
2114 | KASSERT(!topdown || hint <= orig_hint); | | 2114 | (uintmax_t)hint, (uintmax_t)orig_hint); |
| | | 2115 | KASSERTMSG(!topdown || hint <= orig_hint, "hint: %jx, orig_hint: %jx", |
| | | 2116 | (uintmax_t)hint, (uintmax_t)orig_hint); |
2115 | KASSERT(entry->end <= hint); | | 2117 | KASSERT(entry->end <= hint); |
2116 | KASSERT(hint + length <= entry->next->start); | | 2118 | KASSERT(hint + length <= entry->next->start); |
2117 | return (entry); | | 2119 | return (entry); |
2118 | | | 2120 | |
2119 | wraparound: | | 2121 | wraparound: |
2120 | UVMHIST_LOG(maphist, "<- failed (wrap around)", 0,0,0,0); | | 2122 | UVMHIST_LOG(maphist, "<- failed (wrap around)", 0,0,0,0); |
2121 | | | 2123 | |
2122 | return (NULL); | | 2124 | return (NULL); |
2123 | | | 2125 | |
2124 | notfound: | | 2126 | notfound: |
2125 | UVMHIST_LOG(maphist, "<- failed (notfound)", 0,0,0,0); | | 2127 | UVMHIST_LOG(maphist, "<- failed (notfound)", 0,0,0,0); |
2126 | | | 2128 | |
2127 | return (NULL); | | 2129 | return (NULL); |