| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.272 2014/03/30 15:55:08 matt Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.273 2014/03/31 01:49:04 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.272 2014/03/30 15:55:08 matt Exp $"); | | 219 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.273 2014/03/31 01:49:04 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 |
| @@ -1597,27 +1597,27 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 | | | @@ -1597,27 +1597,27 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 |
1597 | if (l2b->l2b_occupancy > 0 || pm == pmap_kernel()) | | 1597 | if (l2b->l2b_occupancy > 0 || pm == pmap_kernel()) |
1598 | return; | | 1598 | return; |
1599 | | | 1599 | |
1600 | /* | | 1600 | /* |
1601 | * There are no more valid mappings in this level 2 page table. | | 1601 | * There are no more valid mappings in this level 2 page table. |
1602 | * Go ahead and NULL-out the pointer in the bucket, then | | 1602 | * Go ahead and NULL-out the pointer in the bucket, then |
1603 | * free the page table. | | 1603 | * free the page table. |
1604 | */ | | 1604 | */ |
1605 | const size_t l1slot = l2b->l2b_l1slot; | | 1605 | const size_t l1slot = l2b->l2b_l1slot; |
1606 | pt_entry_t * const ptep = l2b->l2b_kva; | | 1606 | pt_entry_t * const ptep = l2b->l2b_kva; |
1607 | l2b->l2b_kva = NULL; | | 1607 | l2b->l2b_kva = NULL; |
1608 | | | 1608 | |
1609 | pd_entry_t * const pdep = pmap_l1_kva(pm) + l1slot; | | 1609 | pd_entry_t * const pdep = pmap_l1_kva(pm) + l1slot; |
1610 | pd_entry_t pde = *pdep; | | 1610 | pd_entry_t pde __diagused = *pdep; |
1611 | | | 1611 | |
1612 | #ifdef ARM_MMU_EXTENDED | | 1612 | #ifdef ARM_MMU_EXTENDED |
1613 | /* | | 1613 | /* |
1614 | * Invalidate the L1 slot. | | 1614 | * Invalidate the L1 slot. |
1615 | */ | | 1615 | */ |
1616 | KASSERT((pde & L1_TYPE_MASK) == L1_TYPE_C); | | 1616 | KASSERT((pde & L1_TYPE_MASK) == L1_TYPE_C); |
1617 | #else | | 1617 | #else |
1618 | /* | | 1618 | /* |
1619 | * If the L1 slot matches the pmap's domain number, then invalidate it. | | 1619 | * If the L1 slot matches the pmap's domain number, then invalidate it. |
1620 | */ | | 1620 | */ |
1621 | if ((pde & (L1_C_DOM_MASK|L1_TYPE_MASK)) | | 1621 | if ((pde & (L1_C_DOM_MASK|L1_TYPE_MASK)) |
1622 | == (L1_C_DOM(pmap_domain(pm))|L1_TYPE_C)) { | | 1622 | == (L1_C_DOM(pmap_domain(pm))|L1_TYPE_C)) { |
1623 | #endif | | 1623 | #endif |