| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.286 2014/04/12 09:09:47 skrll Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.287 2014/04/12 16:03:59 matt Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 2003 Wasabi Systems, Inc. | | 4 | * Copyright 2003 Wasabi Systems, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Written by Steve C. Woodford for Wasabi Systems, Inc. | | 7 | * Written by Steve C. Woodford for Wasabi Systems, Inc. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -206,27 +206,27 @@ | | | @@ -206,27 +206,27 @@ |
206 | #include <sys/kmem.h> | | 206 | #include <sys/kmem.h> |
207 | #include <sys/cdefs.h> | | 207 | #include <sys/cdefs.h> |
208 | #include <sys/cpu.h> | | 208 | #include <sys/cpu.h> |
209 | #include <sys/sysctl.h> | | 209 | #include <sys/sysctl.h> |
210 | #include <sys/bus.h> | | 210 | #include <sys/bus.h> |
211 | #include <sys/atomic.h> | | 211 | #include <sys/atomic.h> |
212 | #include <sys/kernhist.h> | | 212 | #include <sys/kernhist.h> |
213 | | | 213 | |
214 | #include <uvm/uvm.h> | | 214 | #include <uvm/uvm.h> |
215 | | | 215 | |
216 | #include <arm/locore.h> | | 216 | #include <arm/locore.h> |
217 | //#include <arm/arm32/katelib.h> | | 217 | //#include <arm/arm32/katelib.h> |
218 | | | 218 | |
219 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.286 2014/04/12 09:09:47 skrll Exp $"); | | 219 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.287 2014/04/12 16:03:59 matt Exp $"); |
220 | | | 220 | |
221 | //#define PMAP_DEBUG | | 221 | //#define PMAP_DEBUG |
222 | #ifdef PMAP_DEBUG | | 222 | #ifdef PMAP_DEBUG |
223 | | | 223 | |
224 | /* XXX need to get rid of all refs to this */ | | 224 | /* XXX need to get rid of all refs to this */ |
225 | int pmap_debug_level = 0; | | 225 | int pmap_debug_level = 0; |
226 | | | 226 | |
227 | /* | | 227 | /* |
228 | * for switching to potentially finer grained debugging | | 228 | * for switching to potentially finer grained debugging |
229 | */ | | 229 | */ |
230 | #define PDB_FOLLOW 0x0001 | | 230 | #define PDB_FOLLOW 0x0001 |
231 | #define PDB_INIT 0x0002 | | 231 | #define PDB_INIT 0x0002 |
232 | #define PDB_ENTER 0x0004 | | 232 | #define PDB_ENTER 0x0004 |
| @@ -3838,27 +3838,28 @@ pmap_kremove(vaddr_t va, vsize_t len) | | | @@ -3838,27 +3838,28 @@ pmap_kremove(vaddr_t va, vsize_t len) |
3838 | if (l2pte_valid_p(opte)) { | | 3838 | if (l2pte_valid_p(opte)) { |
3839 | #ifdef PMAP_CACHE_VIVT | | 3839 | #ifdef PMAP_CACHE_VIVT |
3840 | cpu_dcache_wbinv_range(va, PAGE_SIZE); | | 3840 | cpu_dcache_wbinv_range(va, PAGE_SIZE); |
3841 | #endif | | 3841 | #endif |
3842 | cpu_tlb_flushD_SE(va); | | 3842 | cpu_tlb_flushD_SE(va); |
3843 | } | | 3843 | } |
3844 | if (opte) { | | 3844 | if (opte) { |
3845 | l2pte_reset(ptep); | | 3845 | l2pte_reset(ptep); |
3846 | mappings += PAGE_SIZE / L2_S_SIZE; | | 3846 | mappings += PAGE_SIZE / L2_S_SIZE; |
3847 | } | | 3847 | } |
3848 | va += PAGE_SIZE; | | 3848 | va += PAGE_SIZE; |
3849 | ptep += PAGE_SIZE / L2_S_SIZE; | | 3849 | ptep += PAGE_SIZE / L2_S_SIZE; |
3850 | } | | 3850 | } |
3851 | KDASSERT(mappings <= l2b->l2b_occupancy); | | 3851 | KDASSERTMSG(mappings <= l2b->l2b_occupancy, "%u %u", |
| | | 3852 | mappings, l2b->l2b_occupancy); |
3852 | l2b->l2b_occupancy -= mappings; | | 3853 | l2b->l2b_occupancy -= mappings; |
3853 | PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep)); | | 3854 | PTE_SYNC_RANGE(sptep, (u_int)(ptep - sptep)); |
3854 | #ifdef UVMHIST | | 3855 | #ifdef UVMHIST |
3855 | total_mappings += mappings; | | 3856 | total_mappings += mappings; |
3856 | #endif | | 3857 | #endif |
3857 | } | | 3858 | } |
3858 | cpu_cpwait(); | | 3859 | cpu_cpwait(); |
3859 | UVMHIST_LOG(maphist, " <--- done (%u mappings removed)", | | 3860 | UVMHIST_LOG(maphist, " <--- done (%u mappings removed)", |
3860 | total_mappings, 0, 0, 0); | | 3861 | total_mappings, 0, 0, 0); |
3861 | } | | 3862 | } |
3862 | | | 3863 | |
3863 | bool | | 3864 | bool |
3864 | pmap_extract(pmap_t pm, vaddr_t va, paddr_t *pap) | | 3865 | pmap_extract(pmap_t pm, vaddr_t va, paddr_t *pap) |