mmu_oea.c (8fd7d6577916b57274307607d91b8820c213ca19) | mmu_oea.c (c47dd3db8cf22114267360dddb4b0334b997db0c) |
---|---|
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 --- 104 unchanged lines hidden (view full) --- 113 * are currently using which maps, and to when physical maps must be made 114 * correct. 115 */ 116 117#include "opt_kstack_pages.h" 118 119#include <sys/param.h> 120#include <sys/kernel.h> | 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 --- 104 unchanged lines hidden (view full) --- 113 * are currently using which maps, and to when physical maps must be made 114 * correct. 115 */ 116 117#include "opt_kstack_pages.h" 118 119#include <sys/param.h> 120#include <sys/kernel.h> |
121#include <sys/queue.h> 122#include <sys/cpuset.h> |
|
121#include <sys/ktr.h> 122#include <sys/lock.h> 123#include <sys/msgbuf.h> 124#include <sys/mutex.h> 125#include <sys/proc.h> | 123#include <sys/ktr.h> 124#include <sys/lock.h> 125#include <sys/msgbuf.h> 126#include <sys/mutex.h> 127#include <sys/proc.h> |
128#include <sys/sched.h> |
|
126#include <sys/sysctl.h> 127#include <sys/systm.h> 128#include <sys/vmmeter.h> 129 130#include <dev/ofw/openfirm.h> 131 132#include <vm/vm.h> 133#include <vm/vm_param.h> --- 699 unchanged lines hidden (view full) --- 833 moea_vsid_bitmap[0] |= 1; 834 835 /* 836 * Initialize the kernel pmap (which is statically allocated). 837 */ 838 PMAP_LOCK_INIT(kernel_pmap); 839 for (i = 0; i < 16; i++) 840 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; | 129#include <sys/sysctl.h> 130#include <sys/systm.h> 131#include <sys/vmmeter.h> 132 133#include <dev/ofw/openfirm.h> 134 135#include <vm/vm.h> 136#include <vm/vm_param.h> --- 699 unchanged lines hidden (view full) --- 836 moea_vsid_bitmap[0] |= 1; 837 838 /* 839 * Initialize the kernel pmap (which is statically allocated). 840 */ 841 PMAP_LOCK_INIT(kernel_pmap); 842 for (i = 0; i < 16; i++) 843 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; |
841 kernel_pmap->pm_active = ~0; | 844 CPU_FILL(&kernel_pmap->pm_active); |
842 843 /* 844 * Set up the Open Firmware mappings 845 */ 846 if ((chosen = OF_finddevice("/chosen")) == -1) 847 panic("moea_bootstrap: can't find /chosen"); 848 OF_getprop(chosen, "mmu", &mmui, 4); 849 if ((mmu = OF_instance_to_package(mmui)) == -1) --- 105 unchanged lines hidden (view full) --- 955 956 /* 957 * Load all the data we need up front to encourage the compiler to 958 * not issue any loads while we have interrupts disabled below. 959 */ 960 pm = &td->td_proc->p_vmspace->vm_pmap; 961 pmr = pm->pmap_phys; 962 | 845 846 /* 847 * Set up the Open Firmware mappings 848 */ 849 if ((chosen = OF_finddevice("/chosen")) == -1) 850 panic("moea_bootstrap: can't find /chosen"); 851 OF_getprop(chosen, "mmu", &mmui, 4); 852 if ((mmu = OF_instance_to_package(mmui)) == -1) --- 105 unchanged lines hidden (view full) --- 958 959 /* 960 * Load all the data we need up front to encourage the compiler to 961 * not issue any loads while we have interrupts disabled below. 962 */ 963 pm = &td->td_proc->p_vmspace->vm_pmap; 964 pmr = pm->pmap_phys; 965 |
963 pm->pm_active |= PCPU_GET(cpumask); | 966 sched_pin(); 967 CPU_OR(&pm->pm_active, PCPU_PTR(cpumask)); 968 sched_unpin(); |
964 PCPU_SET(curpmap, pmr); 965} 966 967void 968moea_deactivate(mmu_t mmu, struct thread *td) 969{ 970 pmap_t pm; 971 972 pm = &td->td_proc->p_vmspace->vm_pmap; | 969 PCPU_SET(curpmap, pmr); 970} 971 972void 973moea_deactivate(mmu_t mmu, struct thread *td) 974{ 975 pmap_t pm; 976 977 pm = &td->td_proc->p_vmspace->vm_pmap; |
973 pm->pm_active &= ~PCPU_GET(cpumask); | 978 sched_pin(); 979 CPU_NAND(&pm->pm_active, PCPU_PTR(cpumask)); 980 sched_unpin(); |
974 PCPU_SET(curpmap, NULL); 975} 976 977void 978moea_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) 979{ 980 struct pvo_entry *pvo; 981 --- 1542 unchanged lines hidden --- | 981 PCPU_SET(curpmap, NULL); 982} 983 984void 985moea_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) 986{ 987 struct pvo_entry *pvo; 988 --- 1542 unchanged lines hidden --- |