1/*
2 * Copyright (c) 2001 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Matt Thomas <matt@3am-software.com> of Allegro Networks, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 78 unchanged lines hidden (view full) ---
87 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
88 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
89 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
90 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91 */
92
93#ifndef lint
94static const char rcsid[] =
95 "$FreeBSD: head/sys/powerpc/aim/mmu_oea.c 92521 2002-03-17 23:58:12Z benno $";
96#endif /* not lint */
97
98/*
99 * Manages physical address maps.
100 *
101 * In addition to hardware address maps, this module is called upon to
102 * provide software-use-only maps which may or may not be stored in the
103 * same form as hardware maps. These pseudo-maps are used to store
--- 140 unchanged lines hidden (view full) ---
244 LIST_HEAD_INITIALIZER(pmap_pvo_kunmanaged); /* list of unmanaged pages */
245struct pvo_head pmap_pvo_unmanaged =
246 LIST_HEAD_INITIALIZER(pmap_pvo_unmanaged); /* list of unmanaged pages */
247
248vm_zone_t pmap_upvo_zone; /* zone for pvo entries for unmanaged pages */
249vm_zone_t pmap_mpvo_zone; /* zone for pvo entries for managed pages */
250struct vm_object pmap_upvo_zone_obj;
251struct vm_object pmap_mpvo_zone_obj;
252
253#define PMAP_PVO_SIZE 1024
254static struct pvo_entry *pmap_bpvo_pool;
255static int pmap_bpvo_pool_index;
256static int pmap_bpvo_pool_count;
257
258#define VSID_NBPW (sizeof(u_int32_t) * 8)
259static u_int pmap_vsid_bitmap[NPMAPS / VSID_NBPW];
--- 47 unchanged lines hidden (view full) ---
307 vm_offset_t, vm_offset_t, u_int, int);
308static void pmap_pvo_remove(struct pvo_entry *, int);
309static struct pvo_entry *pmap_pvo_find_va(pmap_t, vm_offset_t, int *);
310static struct pte *pmap_pvo_to_pte(const struct pvo_entry *, int);
311
312/*
313 * Utility routines.
314 */
315static struct pvo_entry *pmap_rkva_alloc(void);
316static void pmap_pa_map(struct pvo_entry *, vm_offset_t,
317 struct pte *, int *);
318static void pmap_pa_unmap(struct pvo_entry *, struct pte *, int *);
319static void pmap_syncicache(vm_offset_t, vm_size_t);
320static boolean_t pmap_query_bit(vm_page_t, int);
321static boolean_t pmap_clear_bit(vm_page_t, int);
322static void tlbia(void);
--- 606 unchanged lines hidden (view full) ---
929}
930
931void
932pmap_init2(void)
933{
934
935 CTR(KTR_PMAP, "pmap_init2");
936
937 pmap_upvo_zone = zinit("UPVO entry", sizeof (struct pvo_entry),
938 0, 0, 0);
939 pmap_mpvo_zone = zinit("MPVO entry", sizeof(struct pvo_entry),
940 PMAP_PVO_SIZE, ZONE_INTERRUPT, 1);
941 pmap_initialized = TRUE;
942}
943
944boolean_t
945pmap_is_modified(vm_page_t m)
946{
947 TODO;
948 return (0);
--- 900 unchanged lines hidden (view full) ---
1849 if (pvo->pvo_pte.pte_hi & PTE_VALID) {
1850 panic("pmap_pvo_to_pte: pvo %p has invalid pte %p in "
1851 "pmap_pteg_table but valid in pvo", pvo, pt);
1852 }
1853
1854 return (NULL);
1855}
1856
1857/*
1858 * XXX: THIS STUFF SHOULD BE IN pte.c?
1859 */
1860int
1861pmap_pte_spill(vm_offset_t addr)
1862{
1863 struct pvo_entry *source_pvo, *victim_pvo;
1864 struct pvo_entry *pvo;
--- 236 unchanged lines hidden ---
2 * Copyright (c) 2001 The NetBSD Foundation, Inc.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to The NetBSD Foundation
6 * by Matt Thomas <matt@3am-software.com> of Allegro Networks, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 78 unchanged lines hidden (view full) ---
87 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
88 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
89 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
90 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
91 */
92
93#ifndef lint
94static const char rcsid[] =
95 "$FreeBSD: head/sys/powerpc/aim/mmu_oea.c 92521 2002-03-17 23:58:12Z benno $";
96#endif /* not lint */
97
98/*
99 * Manages physical address maps.
100 *
101 * In addition to hardware address maps, this module is called upon to
102 * provide software-use-only maps which may or may not be stored in the
103 * same form as hardware maps. These pseudo-maps are used to store
--- 140 unchanged lines hidden (view full) ---
244 LIST_HEAD_INITIALIZER(pmap_pvo_kunmanaged); /* list of unmanaged pages */
245struct pvo_head pmap_pvo_unmanaged =
246 LIST_HEAD_INITIALIZER(pmap_pvo_unmanaged); /* list of unmanaged pages */
247
248vm_zone_t pmap_upvo_zone; /* zone for pvo entries for unmanaged pages */
249vm_zone_t pmap_mpvo_zone; /* zone for pvo entries for managed pages */
250struct vm_object pmap_upvo_zone_obj;
251struct vm_object pmap_mpvo_zone_obj;
252
253#define PMAP_PVO_SIZE 1024
254static struct pvo_entry *pmap_bpvo_pool;
255static int pmap_bpvo_pool_index;
256static int pmap_bpvo_pool_count;
257
258#define VSID_NBPW (sizeof(u_int32_t) * 8)
259static u_int pmap_vsid_bitmap[NPMAPS / VSID_NBPW];
--- 47 unchanged lines hidden (view full) ---
307 vm_offset_t, vm_offset_t, u_int, int);
308static void pmap_pvo_remove(struct pvo_entry *, int);
309static struct pvo_entry *pmap_pvo_find_va(pmap_t, vm_offset_t, int *);
310static struct pte *pmap_pvo_to_pte(const struct pvo_entry *, int);
311
312/*
313 * Utility routines.
314 */
315static struct pvo_entry *pmap_rkva_alloc(void);
316static void pmap_pa_map(struct pvo_entry *, vm_offset_t,
317 struct pte *, int *);
318static void pmap_pa_unmap(struct pvo_entry *, struct pte *, int *);
319static void pmap_syncicache(vm_offset_t, vm_size_t);
320static boolean_t pmap_query_bit(vm_page_t, int);
321static boolean_t pmap_clear_bit(vm_page_t, int);
322static void tlbia(void);
--- 606 unchanged lines hidden (view full) ---
929}
930
931void
932pmap_init2(void)
933{
934
935 CTR(KTR_PMAP, "pmap_init2");
936
937 pmap_upvo_zone = zinit("UPVO entry", sizeof (struct pvo_entry),
938 0, 0, 0);
939 pmap_mpvo_zone = zinit("MPVO entry", sizeof(struct pvo_entry),
940 PMAP_PVO_SIZE, ZONE_INTERRUPT, 1);
941 pmap_initialized = TRUE;
942}
943
944boolean_t
945pmap_is_modified(vm_page_t m)
946{
947 TODO;
948 return (0);
--- 900 unchanged lines hidden (view full) ---
1849 if (pvo->pvo_pte.pte_hi & PTE_VALID) {
1850 panic("pmap_pvo_to_pte: pvo %p has invalid pte %p in "
1851 "pmap_pteg_table but valid in pvo", pvo, pt);
1852 }
1853
1854 return (NULL);
1855}
1856
1857/*
1858 * XXX: THIS STUFF SHOULD BE IN pte.c?
1859 */
1860int
1861pmap_pte_spill(vm_offset_t addr)
1862{
1863 struct pvo_entry *source_pvo, *victim_pvo;
1864 struct pvo_entry *pvo;
--- 236 unchanged lines hidden ---