From: Ben Gras Date: Mon, 8 Jun 2009 04:39:26 +0000 (+0000) Subject: allow empty senda X-Git-Tag: v3.1.4~7 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.pdf?a=commitdiff_plain;h=782133423efb8104ae2c7592d183f51a4fa05591;p=minix.git allow empty senda --- diff --git a/kernel/arch/i386/exception.c b/kernel/arch/i386/exception.c index 28593a19a..1a68a243f 100755 --- a/kernel/arch/i386/exception.c +++ b/kernel/arch/i386/exception.c @@ -44,7 +44,11 @@ void pagefault(vir_bytes old_eip, struct proc *pr, int trap_errno, vmassert(pr->p_seg.p_cr3 == read_cr3()); } else { u32_t cr3; - lock; + int u = 0; + if(!intr_disabled()) { + lock; + u = 1; + } cr3 = read_cr3(); vmassert(ptproc); if(ptproc->p_seg.p_cr3 != cr3) { @@ -58,7 +62,9 @@ void pagefault(vir_bytes old_eip, struct proc *pr, int trap_errno, vm_print(cr3); vm_print(ptproc->p_seg.p_cr3); } - unlock; + if(u) { + unlock; + } } test_eip = k_reenter ? old_eip : pr->p_reg.pc; diff --git a/kernel/proc.c b/kernel/proc.c index 789965d22..2bf4cb7a0 100755 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -732,13 +732,6 @@ size_t size; vir_bytes table_v = (vir_bytes) table; vir_bytes linaddr; - if(!(linaddr = umap_local(caller_ptr, D, (vir_bytes) table, - size * sizeof(*table)))) { - printf("mini_senda: umap_local failed; 0x%lx len 0x%lx\n", - table, size * sizeof(*table)); - return EFAULT; - } - privp= priv(caller_ptr); if (!(privp->s_flags & SYS_PROC)) { @@ -757,6 +750,13 @@ size_t size; return OK; } + if(!(linaddr = umap_local(caller_ptr, D, (vir_bytes) table, + size * sizeof(*table)))) { + printf("mini_senda: umap_local failed; 0x%lx len 0x%lx\n", + table, size * sizeof(*table)); + return EFAULT; + } + /* Limit size to something reasonable. An arbitrary choice is 16 * times the number of process table entries. *