summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorUlf Carlsson <md1ulfc@mdstud.chalmers.se>2000-05-25 19:33:16 +0000
committerUlf Carlsson <md1ulfc@mdstud.chalmers.se>2000-05-25 19:33:16 +0000
commite3f4987b05b99df724313e4906971e0c2392e9d5 (patch)
tree045335cf3c152e6d43e590662217c2cdb4bf0a74 /include
parent243287e7620e395edf940f61c5dcc6fa606a150f (diff)
First cut of TLB handlers in assembler. I'm not using
the context register as it should be used, but let's look into that later. If there is a problem with the code it will crash after right after freeing unused kernel memery. I have this code tested on both UP and SMP though.
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips64/mmu_context.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/asm-mips64/mmu_context.h b/include/asm-mips64/mmu_context.h
index eeb8d9091..7f70157c4 100644
--- a/include/asm-mips64/mmu_context.h
+++ b/include/asm-mips64/mmu_context.h
@@ -17,6 +17,8 @@
#include <asm/pgalloc.h>
#include <asm/processor.h>
+extern unsigned long pgd_current[];
+
#ifndef CONFIG_SMP
#define CPU_CONTEXT(cpu, mm) (mm)->context
#else
@@ -85,7 +87,9 @@ extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
if ((CPU_CONTEXT(cpu, next) ^ ASID_CACHE(cpu)) & ASID_VERSION_MASK)
get_new_cpu_mmu_context(next, cpu);
- set_entryhi(CPU_CONTEXT(cpu, next));
+ set_entryhi(CPU_CONTEXT(cpu, next) & 0xff);
+ set_context((unsigned long) smp_processor_id() << (23 + 3));
+ pgd_current[smp_processor_id()] = next->pgd;
}
/*
@@ -110,7 +114,9 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)
/* Unconditionally get a new ASID. */
get_new_cpu_mmu_context(next, smp_processor_id());
- set_entryhi(CPU_CONTEXT(smp_processor_id(), next));
+ set_entryhi(CPU_CONTEXT(smp_processor_id(), next) & 0xff);
+ set_context((unsigned long) smp_processor_id() << (23 + 3));
+ pgd_current[smp_processor_id()] = next->pgd;
}
#endif /* _ASM_MMU_CONTEXT_H */