Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm
In directory usw-pr-cvs1:/tmp/cvs-serv17853/include/asm-vax/mm
Modified Files:
mmu_context.h
Log Message:
DA: woops .. forgot to set thread p0/p1 br/lr.. probably have somewhere else
to do is.. not sure if this is the correct spot ..
Index: mmu_context.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/mm/mmu_context.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mmu_context.h 2001/05/19 12:04:25 1.2
+++ mmu_context.h 2001/06/09 18:00:25 1.3
@@ -1,3 +1,6 @@
+/* Copyright (C) May 2001 - Dave Airlie - Vax project - ai...@li...
+ derived I'm sure from somewhere ... */
+
#ifndef _ASM_VAX_MMU_CONTEXT_H
#define _ASM_VAX_MMU_CONTEXT_H
@@ -14,19 +17,32 @@
{
}
+/*
+ * switch_mm implementation
+ * copy the thread P0/P1 registers into the corresponding CPU registers
+ * - not sure if this is complete - D.A. May 2001
+ */
+
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk, unsigned cpu)
{
- if (prev!=next) {
- clear_bit(cpu, &prev->cpu_vm_mask);
- __mtpr(next->pgd[0].br, PR_P0BR);
- __mtpr((next->pgd[0].lr * 8 | 0x04000000), PR_P0LR);
- __mtpr(next->pgd[1].br, PR_P1BR);
- __mtpr((next->pgd[1].lr * 8), PR_P1LR);
- flush_tlb_all();
+ if (prev!=next) {
+ clear_bit(cpu, &prev->cpu_vm_mask);
+
+ tsk->thread.pcb.p0br = (next->pgd[0]).br;
+ tsk->thread.pcb.p0lr = (next->pgd[0]).lr * 8 | 0x04000000;
+ tsk->thread.pcb.p1br = (next->pgd[1]).br;
+ tsk->thread.pcb.p1lr = (next->pgd[1]).lr * 8;
+
+ __mtpr(next->pgd[0].br, PR_P0BR);
+ __mtpr((next->pgd[0].lr * 8), PR_P0LR);
+ __mtpr(next->pgd[1].br, PR_P1BR);
+ __mtpr((next->pgd[1].lr * 8), PR_P1LR);
- }
- set_bit(cpu, &next->cpu_vm_mask);
+ flush_tlb_all();
+ }
+ set_bit(cpu, &next->cpu_vm_mask);
+
}
extern inline void activate_mm(struct mm_struct *prev,
|