Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2009 16:20:46 +0000 (UTC)
From:      Stacey Son <sson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192902 - head/sys/dev/ksyms
Message-ID:  <200905271620.n4RGKk9e003133@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sson
Date: Wed May 27 16:20:46 2009
New Revision: 192902
URL: http://svn.freebsd.org/changeset/base/192902

Log:
  Change from using vm_map_delete() to vm_map_remove().
  
  Approved by:	gnn (mentor)
  Obtained from:	kib

Modified:
  head/sys/dev/ksyms/ksyms.c

Modified: head/sys/dev/ksyms/ksyms.c
==============================================================================
--- head/sys/dev/ksyms/ksyms.c	Wed May 27 16:16:56 2009	(r192901)
+++ head/sys/dev/ksyms/ksyms.c	Wed May 27 16:20:46 2009	(r192902)
@@ -395,29 +395,15 @@ static int
 ksyms_unmap(struct thread *td, vm_offset_t addr, size_t sz)
 {
 	vm_map_t map;
-	int error;
 	vm_size_t size;
     
 	map = &td->td_proc->p_vmspace->vm_map;
-
 	size = (vm_size_t) round_page(sz);	
 
-	/* check for address wrap-around */
-	if (addr + size < addr || addr < vm_map_min(map) || 
-	    addr + size > vm_map_max(map))
-		return (EINVAL);
-
-	vm_map_lock(map);
-	/* make sure the pages are mapped */
-	if (!vm_map_check_protection(map, addr, addr + size, VM_PROT_NONE)) {
-		vm_map_unlock(map);
+	if (!vm_map_remove(map, addr, addr + size))
 		return (EINVAL);
-	}
-
-	error = vm_map_delete(map, addr, addr + size);
-	vm_map_unlock(map);
 
-	return (error);
+	return (0);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905271620.n4RGKk9e003133>