From: Erik van der Kouwe Date: Thu, 9 Jun 2011 05:06:34 +0000 (+0000) Subject: Remove unused duplicate grant code in umap X-Git-Tag: v3.2.0~540 X-Git-Url: http://zhaoyanbai.com/repos/doc/roff.7.html?a=commitdiff_plain;h=b08dff601192ce08c265e7a2f1eab3ab39d8b198;p=minix.git Remove unused duplicate grant code in umap --- diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index f8c1d25d9..39c3f28f8 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -350,10 +350,6 @@ vir_bytes bytes; /* # of bytes to be copied */ vir_bytes linear; u32_t phys = 0; - if(seg == MEM_GRANT) { - return umap_grant(rp, (cp_grant_id_t) vir_addr, bytes); - } - if(!(linear = umap_local(rp, seg, vir_addr, bytes))) { printf("SYSTEM:umap_virtual: umap_local failed\n"); phys = 0; diff --git a/kernel/proto.h b/kernel/proto.h index 925839099..5356ac7b0 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -84,7 +84,6 @@ _PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) ); _PROTOTYPE( void system_init, (void) ); #define numap_local(proc_nr, vir_addr, bytes) \ umap_local(proc_addr(proc_nr), D, (vir_addr), (bytes)) -_PROTOTYPE( phys_bytes umap_grant, (struct proc *, cp_grant_id_t, vir_bytes)); _PROTOTYPE( void clear_endpoint, (struct proc *rc) ); _PROTOTYPE( void clear_ipc_refs, (struct proc *rc, int caller_ret) ); _PROTOTYPE( phys_bytes umap_bios, (vir_bytes vir_addr, vir_bytes bytes)); diff --git a/kernel/system.c b/kernel/system.c index c40a5016c..ce10b9a8b 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -478,45 +478,6 @@ vir_bytes bytes; /* # of bytes to be copied */ } #endif -/*===========================================================================* - * umap_grant * - *===========================================================================*/ -PUBLIC phys_bytes umap_grant(rp, grant, bytes) -struct proc *rp; /* pointer to proc table entry for process */ -cp_grant_id_t grant; /* grant no. */ -vir_bytes bytes; /* size */ -{ - int proc_nr; - vir_bytes offset, ret; - endpoint_t granter; - - /* See if the grant in that process is sensible, and - * find out the virtual address and (optionally) new - * process for that address. - * - * Then convert that process to a slot number. - */ - if(verify_grant(rp->p_endpoint, ANY, grant, bytes, 0, 0, - &offset, &granter) != OK) { - printf("SYSTEM: umap_grant: verify_grant failed\n"); - return 0; - } - - if(!isokendpt(granter, &proc_nr)) { - printf("SYSTEM: umap_grant: isokendpt failed\n"); - return 0; - } - - /* Do the mapping from virtual to physical. */ - ret = umap_virtual(proc_addr(proc_nr), D, offset, bytes); - if(!ret) { - printf("SYSTEM:umap_grant:umap_virtual failed; grant %s:%d -> %s: vir 0x%lx\n", - rp->p_name, grant, - proc_addr(proc_nr)->p_name, offset); - } - return ret; -} - /*===========================================================================* * clear_ipc * *===========================================================================*/