From: Ben Gras Date: Wed, 3 Jun 2009 15:28:13 +0000 (+0000) Subject: only switch pagetable if necessary and it's different for copying messages X-Git-Tag: v3.1.4~13 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=9d56ac3fc9832c3657891ec4aa6680c5a891df78;p=minix.git only switch pagetable if necessary and it's different for copying messages --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 44896b90f..1c3f6d6c6 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -704,11 +704,14 @@ u32_t read_cr3(void) phys_bytes arch_switch_copymsg(struct proc *rp, message *m, phys_bytes lin) { 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); ptproc = rp; } r = phys_copy(vir2phys(m), lin, sizeof(message)); + if(u) { unlock; } } /*===========================================================================*