mmu_oea64.c (415a54c8c555f36cb409c6848f09bd0e4bc960e4) mmu_oea64.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 <sys/kdb.h>
131
132#include <dev/ofw/openfirm.h>
133

--- 706 unchanged lines hidden (view full) ---

840 pcpup->pc_slb[i].slbe = 0;
841 }
842 #else
843 for (i = 0; i < 16; i++)
844 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i;
845 #endif
846
847 kernel_pmap->pmap_phys = kernel_pmap;
129#include <sys/sysctl.h>
130#include <sys/systm.h>
131#include <sys/vmmeter.h>
132
133#include <sys/kdb.h>
134
135#include <dev/ofw/openfirm.h>
136

--- 706 unchanged lines hidden (view full) ---

843 pcpup->pc_slb[i].slbe = 0;
844 }
845 #else
846 for (i = 0; i < 16; i++)
847 kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i;
848 #endif
849
850 kernel_pmap->pmap_phys = kernel_pmap;
848 kernel_pmap->pm_active = ~0;
851 CPU_FILL(&kernel_pmap->pm_active);
849
850 PMAP_LOCK_INIT(kernel_pmap);
851
852 /*
853 * Now map in all the other buffers we allocated earlier
854 */
855
856 moea64_setup_direct_map(mmup, kernelstart, kernelend);

--- 151 unchanged lines hidden (view full) ---

1008 * space can be accessed in any way.
1009 */
1010void
1011moea64_activate(mmu_t mmu, struct thread *td)
1012{
1013 pmap_t pm;
1014
1015 pm = &td->td_proc->p_vmspace->vm_pmap;
852
853 PMAP_LOCK_INIT(kernel_pmap);
854
855 /*
856 * Now map in all the other buffers we allocated earlier
857 */
858
859 moea64_setup_direct_map(mmup, kernelstart, kernelend);

--- 151 unchanged lines hidden (view full) ---

1011 * space can be accessed in any way.
1012 */
1013void
1014moea64_activate(mmu_t mmu, struct thread *td)
1015{
1016 pmap_t pm;
1017
1018 pm = &td->td_proc->p_vmspace->vm_pmap;
1016 pm->pm_active |= PCPU_GET(cpumask);
1019 sched_pin();
1020 CPU_OR(&pm->pm_active, PCPU_PTR(cpumask));
1021 sched_unpin();
1017
1018 #ifdef __powerpc64__
1019 PCPU_SET(userslb, pm->pm_slb);
1020 #else
1021 PCPU_SET(curpmap, pm->pmap_phys);
1022 #endif
1023}
1024
1025void
1026moea64_deactivate(mmu_t mmu, struct thread *td)
1027{
1028 pmap_t pm;
1029
1030 pm = &td->td_proc->p_vmspace->vm_pmap;
1022
1023 #ifdef __powerpc64__
1024 PCPU_SET(userslb, pm->pm_slb);
1025 #else
1026 PCPU_SET(curpmap, pm->pmap_phys);
1027 #endif
1028}
1029
1030void
1031moea64_deactivate(mmu_t mmu, struct thread *td)
1032{
1033 pmap_t pm;
1034
1035 pm = &td->td_proc->p_vmspace->vm_pmap;
1031 pm->pm_active &= ~(PCPU_GET(cpumask));
1036 sched_pin();
1037 CPU_NAND(&pm->pm_active, PCPU_PTR(cpumask));
1038 sched_unpin();
1032 #ifdef __powerpc64__
1033 PCPU_SET(userslb, NULL);
1034 #else
1035 PCPU_SET(curpmap, NULL);
1036 #endif
1037}
1038
1039void

--- 1558 unchanged lines hidden ---
1039 #ifdef __powerpc64__
1040 PCPU_SET(userslb, NULL);
1041 #else
1042 PCPU_SET(curpmap, NULL);
1043 #endif
1044}
1045
1046void

--- 1558 unchanged lines hidden ---