| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pmap.c,v 1.119 2011/04/14 16:00:21 yamt Exp $ */ | | 1 | /* $NetBSD: pmap.c,v 1.120 2011/04/27 07:42:11 plunky Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2007 Manuel Bouyer. | | 4 | * Copyright (c) 2007 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -132,27 +132,27 @@ | | | @@ -132,27 +132,27 @@ |
132 | * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson | | 132 | * Hibler/Jolitz pmap, as modified for FreeBSD by John S. Dyson |
133 | * and David Greenman. | | 133 | * and David Greenman. |
134 | * | | 134 | * |
135 | * [3] the Mach pmap. this pmap, from CMU, seems to have migrated | | 135 | * [3] the Mach pmap. this pmap, from CMU, seems to have migrated |
136 | * between several processors. the VAX version was done by | | 136 | * between several processors. the VAX version was done by |
137 | * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 | | 137 | * Avadis Tevanian, Jr., and Michael Wayne Young. the i386 |
138 | * version was done by Lance Berc, Mike Kupfer, Bob Baron, | | 138 | * version was done by Lance Berc, Mike Kupfer, Bob Baron, |
139 | * David Golub, and Richard Draves. the alpha version was | | 139 | * David Golub, and Richard Draves. the alpha version was |
140 | * done by Alessandro Forin (CMU/Mach) and Chris Demetriou | | 140 | * done by Alessandro Forin (CMU/Mach) and Chris Demetriou |
141 | * (NetBSD/alpha). | | 141 | * (NetBSD/alpha). |
142 | */ | | 142 | */ |
143 | | | 143 | |
144 | #include <sys/cdefs.h> | | 144 | #include <sys/cdefs.h> |
145 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.119 2011/04/14 16:00:21 yamt Exp $"); | | 145 | __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.120 2011/04/27 07:42:11 plunky Exp $"); |
146 | | | 146 | |
147 | #include "opt_user_ldt.h" | | 147 | #include "opt_user_ldt.h" |
148 | #include "opt_lockdebug.h" | | 148 | #include "opt_lockdebug.h" |
149 | #include "opt_multiprocessor.h" | | 149 | #include "opt_multiprocessor.h" |
150 | #include "opt_xen.h" | | 150 | #include "opt_xen.h" |
151 | #if !defined(__x86_64__) | | 151 | #if !defined(__x86_64__) |
152 | #include "opt_kstack_dr0.h" | | 152 | #include "opt_kstack_dr0.h" |
153 | #endif /* !defined(__x86_64__) */ | | 153 | #endif /* !defined(__x86_64__) */ |
154 | | | 154 | |
155 | #include <sys/param.h> | | 155 | #include <sys/param.h> |
156 | #include <sys/systm.h> | | 156 | #include <sys/systm.h> |
157 | #include <sys/proc.h> | | 157 | #include <sys/proc.h> |
158 | #include <sys/pool.h> | | 158 | #include <sys/pool.h> |
| @@ -757,27 +757,27 @@ pmap_unmap_apdp(void) | | | @@ -757,27 +757,27 @@ pmap_unmap_apdp(void) |
757 | for (i = 0; i < PDP_SIZE; i++) { | | 757 | for (i = 0; i < PDP_SIZE; i++) { |
758 | pmap_pte_set(APDP_PDE+i, 0); | | 758 | pmap_pte_set(APDP_PDE+i, 0); |
759 | #if defined (XEN) && defined (PAE) | | 759 | #if defined (XEN) && defined (PAE) |
760 | /* clear shadow entries too */ | | 760 | /* clear shadow entries too */ |
761 | pmap_pte_set(APDP_PDE_SHADOW+i, 0); | | 761 | pmap_pte_set(APDP_PDE_SHADOW+i, 0); |
762 | #endif | | 762 | #endif |
763 | } | | 763 | } |
764 | } | | 764 | } |
765 | | | 765 | |
766 | /* | | 766 | /* |
767 | * Add a reference to the specified pmap. | | 767 | * Add a reference to the specified pmap. |
768 | */ | | 768 | */ |
769 | | | 769 | |
770 | inline void | | 770 | void |
771 | pmap_reference(struct pmap *pmap) | | 771 | pmap_reference(struct pmap *pmap) |
772 | { | | 772 | { |
773 | | | 773 | |
774 | atomic_inc_uint(&pmap->pm_obj[0].uo_refs); | | 774 | atomic_inc_uint(&pmap->pm_obj[0].uo_refs); |
775 | } | | 775 | } |
776 | | | 776 | |
777 | /* | | 777 | /* |
778 | * pmap_map_ptes: map a pmap's PTEs into KVM and lock them in | | 778 | * pmap_map_ptes: map a pmap's PTEs into KVM and lock them in |
779 | * | | 779 | * |
780 | * => we lock enough pmaps to keep things locked in | | 780 | * => we lock enough pmaps to keep things locked in |
781 | * => must be undone with pmap_unmap_ptes before returning | | 781 | * => must be undone with pmap_unmap_ptes before returning |
782 | */ | | 782 | */ |
783 | | | 783 | |