From ac6ba8bd4ad22b0e246b65d836b6664c89cc4c4c Mon Sep 17 00:00:00 2001 From: Benno Rice Date: Thu, 28 Feb 2002 11:55:44 +0000 Subject: [PATCH] - Modify pmap_activate so it only marks the pmap as active. - Add a pmap_deactivate function. --- sys/powerpc/aim/mmu_oea.c | 12 ++++++++++++ sys/powerpc/include/pmap.h | 1 + sys/powerpc/powerpc/mmu_oea.c | 12 ++++++++++++ sys/powerpc/powerpc/pmap.c | 12 ++++++++++++ 4 files changed, 37 insertions(+) diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 741faf4766e..20f9bae9b21 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -750,7 +750,9 @@ pmap_activate(struct thread *td) /* * XXX: Address this again later? + * NetBSD only change the segment registers on return to userland. */ +#if 0 critical_enter(); for (i = 0; i < 16; i++) { @@ -759,6 +761,16 @@ pmap_activate(struct thread *td) __asm __volatile("sync; isync"); critical_exit(); +#endif +} + +void +pmap_deactivate(struct thread *td) +{ + pmap_t pm; + + pm = &td->td_proc->p_vmspace->vm_pmap; + pm->pm_active &= ~(PCPU_GET(cpumask)); } vm_offset_t diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index 080c5a3fb9a..841e55a6a78 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -69,6 +69,7 @@ extern struct pmap kernel_pmap_store; #ifdef _KERNEL void pmap_bootstrap(vm_offset_t, vm_offset_t); +void pmap_deactivate(struct thread *); vm_offset_t pmap_kextract(vm_offset_t); int pmap_pte_spill(vm_offset_t); diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index 741faf4766e..20f9bae9b21 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -750,7 +750,9 @@ pmap_activate(struct thread *td) /* * XXX: Address this again later? + * NetBSD only change the segment registers on return to userland. */ +#if 0 critical_enter(); for (i = 0; i < 16; i++) { @@ -759,6 +761,16 @@ pmap_activate(struct thread *td) __asm __volatile("sync; isync"); critical_exit(); +#endif +} + +void +pmap_deactivate(struct thread *td) +{ + pmap_t pm; + + pm = &td->td_proc->p_vmspace->vm_pmap; + pm->pm_active &= ~(PCPU_GET(cpumask)); } vm_offset_t diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index 741faf4766e..20f9bae9b21 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -750,7 +750,9 @@ pmap_activate(struct thread *td) /* * XXX: Address this again later? + * NetBSD only change the segment registers on return to userland. */ +#if 0 critical_enter(); for (i = 0; i < 16; i++) { @@ -759,6 +761,16 @@ pmap_activate(struct thread *td) __asm __volatile("sync; isync"); critical_exit(); +#endif +} + +void +pmap_deactivate(struct thread *td) +{ + pmap_t pm; + + pm = &td->td_proc->p_vmspace->vm_pmap; + pm->pm_active &= ~(PCPU_GET(cpumask)); } vm_offset_t -- 2.45.2