only switch pagetable if necessary and it's different for copying messages

This commit is contained in:
Ben Gras 2009-06-03 15:28:13 +00:00
parent 37cd6bc06c
commit 9d56ac3fc9

View File

@ -704,11 +704,14 @@ u32_t read_cr3(void)
phys_bytes arch_switch_copymsg(struct proc *rp, message *m, phys_bytes lin) phys_bytes arch_switch_copymsg(struct proc *rp, message *m, phys_bytes lin)
{ {
phys_bytes r; phys_bytes r;
if(rp->p_seg.p_cr3) { int u = 0;
if(!intr_disabled()) { lock; u = 1; }
if(rp->p_seg.p_cr3 && ptproc != rp) {
vm_set_cr3(rp->p_seg.p_cr3); vm_set_cr3(rp->p_seg.p_cr3);
ptproc = rp; ptproc = rp;
} }
r = phys_copy(vir2phys(m), lin, sizeof(message)); r = phys_copy(vir2phys(m), lin, sizeof(message));
if(u) { unlock; }
} }
/*===========================================================================* /*===========================================================================*