From 9d56ac3fc9832c3657891ec4aa6680c5a891df78 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 3 Jun 2009 15:28:13 +0000 Subject: [PATCH] only switch pagetable if necessary and it's different for copying messages --- kernel/arch/i386/memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } } /*===========================================================================* -- 2.44.0