| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.111 2009/01/01 04:10:25 tsutsui Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.112 2009/01/01 08:11:45 tsutsui Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe. | | 8 | * by Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -90,27 +90,27 @@ | | | @@ -90,27 +90,27 @@ |
90 | * of virtual-to-physical mappings must be done as | | 90 | * of virtual-to-physical mappings must be done as |
91 | * requested. | | 91 | * requested. |
92 | * | | 92 | * |
93 | * In order to cope with hardware architectures which | | 93 | * In order to cope with hardware architectures which |
94 | * make virtual-to-physical map invalidates expensive, | | 94 | * make virtual-to-physical map invalidates expensive, |
95 | * this module may delay invalidate or reduced protection | | 95 | * this module may delay invalidate or reduced protection |
96 | * operations until such time as they are actually | | 96 | * operations until such time as they are actually |
97 | * necessary. This module is given full information as | | 97 | * necessary. This module is given full information as |
98 | * to which processors are currently using which maps, | | 98 | * to which processors are currently using which maps, |
99 | * and to when physical maps must be made correct. | | 99 | * and to when physical maps must be made correct. |
100 | */ | | 100 | */ |
101 | | | 101 | |
102 | #include <sys/cdefs.h> | | 102 | #include <sys/cdefs.h> |
103 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.111 2009/01/01 04:10:25 tsutsui Exp $"); | | 103 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.112 2009/01/01 08:11:45 tsutsui Exp $"); |
104 | | | 104 | |
105 | #include <sys/param.h> | | 105 | #include <sys/param.h> |
106 | #include <sys/systm.h> | | 106 | #include <sys/systm.h> |
107 | #include <sys/proc.h> | | 107 | #include <sys/proc.h> |
108 | #include <sys/malloc.h> | | 108 | #include <sys/malloc.h> |
109 | #include <sys/user.h> | | 109 | #include <sys/user.h> |
110 | | | 110 | |
111 | #include <uvm/uvm.h> | | 111 | #include <uvm/uvm.h> |
112 | | | 112 | |
113 | #include <machine/pte.h> | | 113 | #include <machine/pte.h> |
114 | #include <machine/cpu.h> | | 114 | #include <machine/cpu.h> |
115 | #include <machine/vmparam.h> | | 115 | #include <machine/vmparam.h> |
116 | | | 116 | |
| @@ -306,32 +306,26 @@ static void pmap_changebit(vaddr_t, int, | | | @@ -306,32 +306,26 @@ static void pmap_changebit(vaddr_t, int, |
306 | struct pv_entry * pmap_alloc_pv(void); | | 306 | struct pv_entry * pmap_alloc_pv(void); |
307 | void pmap_free_pv(struct pv_entry *); | | 307 | void pmap_free_pv(struct pv_entry *); |
308 | void pmap_pinit(pmap_t); | | 308 | void pmap_pinit(pmap_t); |
309 | void pmap_release(pmap_t); | | 309 | void pmap_release(pmap_t); |
310 | static void pmap_remove_mapping(pmap_t, vaddr_t, pt_entry_t *, int); | | 310 | static void pmap_remove_mapping(pmap_t, vaddr_t, pt_entry_t *, int); |
311 | | | 311 | |
312 | void pmap_collect1(pmap_t, paddr_t, paddr_t); | | 312 | void pmap_collect1(pmap_t, paddr_t, paddr_t); |
313 | | | 313 | |
314 | /* pmap_remove_mapping flags */ | | 314 | /* pmap_remove_mapping flags */ |
315 | #define PRM_TFLUSH 0x01 | | 315 | #define PRM_TFLUSH 0x01 |
316 | #define PRM_CFLUSH 0x02 | | 316 | #define PRM_CFLUSH 0x02 |
317 | #define PRM_KEEPPTPAGE 0x04 | | 317 | #define PRM_KEEPPTPAGE 0x04 |
318 | | | 318 | |
319 | /* | | | |
320 | * All those kernel PT submaps that BSD is so fond of | | | |
321 | */ | | | |
322 | void *CADDR1, *CADDR2; | | | |
323 | char *vmmap; | | | |
324 | | | | |
325 | #define PAGE_IS_MANAGED(pa) (pmap_initialized \ | | 319 | #define PAGE_IS_MANAGED(pa) (pmap_initialized \ |
326 | && vm_physseg_find(atop((pa)), NULL) != -1) | | 320 | && vm_physseg_find(atop((pa)), NULL) != -1) |
327 | | | 321 | |
328 | static inline struct pv_entry *pa_to_pvh(paddr_t pa); | | 322 | static inline struct pv_entry *pa_to_pvh(paddr_t pa); |
329 | static inline char *pa_to_attribute(paddr_t pa); | | 323 | static inline char *pa_to_attribute(paddr_t pa); |
330 | | | 324 | |
331 | static inline struct pv_entry * | | 325 | static inline struct pv_entry * |
332 | pa_to_pvh(paddr_t pa) | | 326 | pa_to_pvh(paddr_t pa) |
333 | { | | 327 | { |
334 | int bank, pg = 0; /* XXX gcc4 -Wuninitialized */ | | 328 | int bank, pg = 0; /* XXX gcc4 -Wuninitialized */ |
335 | | | 329 | |
336 | bank = vm_physseg_find(atop((pa)), &pg); | | 330 | bank = vm_physseg_find(atop((pa)), &pg); |
337 | return &vm_physmem[bank].pmseg.pvent[pg]; | | 331 | return &vm_physmem[bank].pmseg.pvent[pg]; |