aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorskv <skv@FreeBSD.org>2008-02-14 02:58:47 +0800
committerskv <skv@FreeBSD.org>2008-02-14 02:58:47 +0800
commitce2914490b7b98aa2eb1ec340ef01dc2fd4dba5b (patch)
treeb4a48baff21bb6aaf3174f6c08fd2fb3c5735bb3 /sysutils
parent95725b900f171b56a5b4787ab711f605ad0802e5 (diff)
downloadfreebsd-ports-gnome-ce2914490b7b98aa2eb1ec340ef01dc2fd4dba5b.tar.gz
freebsd-ports-gnome-ce2914490b7b98aa2eb1ec340ef01dc2fd4dba5b.tar.zst
freebsd-ports-gnome-ce2914490b7b98aa2eb1ec340ef01dc2fd4dba5b.zip
Unbreak build on 7.x
PR: ports/119704 Submitted by: pluknet <pluknet xx gmail.com>
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/pmap/Makefile7
-rw-r--r--sysutils/pmap/files/patch-pmap_helper.c70
2 files changed, 76 insertions, 1 deletions
diff --git a/sysutils/pmap/Makefile b/sysutils/pmap/Makefile
index ac92071cd200..ccd3a5977a03 100644
--- a/sysutils/pmap/Makefile
+++ b/sysutils/pmap/Makefile
@@ -7,6 +7,7 @@
PORTNAME= pmap
PORTVERSION= 20060622
+PORTREVISION= 1
CATEGORIES= sysutils kld
MASTER_SITES= ${MASTER_SITE_LOCAL:S!$!skv/!} \
ftp://ftp.wuppy.net.ru/pub/FreeBSD/local/pmap/
@@ -16,15 +17,19 @@ COMMENT= Detailed process memory display
NO_PACKAGE= Depends on kernel
+KMODDIR= /boot/modules
+
PLIST_SUB= KMODDIR=${KMODDIR}
WRKSRC= ${WRKDIR}/${PORTNAME}
+MAKE_ENV+= KMODDIR=${KMODDIR}
+
MAN8= pmap.8
MANCOMPRESSED= maybe
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 700000
+.if ${OSVERSION} >= 800000
BROKEN= Currently does not support -CURRENT
.endif
diff --git a/sysutils/pmap/files/patch-pmap_helper.c b/sysutils/pmap/files/patch-pmap_helper.c
new file mode 100644
index 000000000000..167c68ca4147
--- /dev/null
+++ b/sysutils/pmap/files/patch-pmap_helper.c
@@ -0,0 +1,70 @@
+--- pmap_helper/pmap_helper.c.orig 2006-06-22 15:55:17.000000000 +0400
++++ pmap_helper/pmap_helper.c 2008-01-16 04:00:46.000000000 +0300
+@@ -43,6 +43,7 @@
+ #include <sys/lock.h>
+ #include <sys/vnode.h>
+ #include <sys/malloc.h>
++#include <sys/sysproto.h>
+
+ #include <vm/vm.h>
+ #include <vm/pmap.h>
+@@ -77,7 +78,6 @@
+ struct proc *p;
+ static struct vm_map *map;
+ struct vm_map_entry *entry;
+- pmap_t pmap;
+ int nmaps = 0;
+ int error;
+ struct pmh pmh;
+@@ -91,17 +91,16 @@
+ return EINVAL;
+
+ p = pfind(pmh.pid); /* XXX Locks p! */
++ PROC_UNLOCK(p); /* locked by pfind(9) */
++
+ if (p == NULL)
+ return ESRCH;
+
+ /* map points to description of MI virtual address space */
+ map = &p->p_vmspace->vm_map;
+
+- if (map != &curthread->td_proc->p_vmspace->vm_map)
+- vm_map_lock_read(map);
++ vm_map_lock_read(map);
+
+- /* pmap points to private physiscal map for whole process space */
+- pmap = vmspace_pmap(p->p_vmspace);
+ error = 0;
+
+ for (entry = map->header.next; entry != &map->header;
+@@ -129,7 +128,7 @@
+ addr = entry->start;
+ /* estimate number of phys. resident pages in map */
+ while (addr < entry->end) {
+- if (pmap_extract(pmap, addr))
++ if (pmap_extract(map->pmap, addr))
+ resident++;
+ addr += PAGE_SIZE;
+ }
+@@ -163,7 +162,9 @@
+ free(freepath, M_TEMP);
+ }
+ }
++ vm_map_unlock_read(map);
+ error = copyout(&pmhm, &pmh.maps[nmaps], sizeof pmh.maps[nmaps]);
++ vm_map_lock_read(map);
+ if (error)
+ break;
+ nmaps++;
+@@ -171,10 +172,7 @@
+ break;
+ }
+
+- if (map != &curthread->td_proc->p_vmspace->vm_map)
+- vm_map_unlock_read(map);
+-
+- PROC_UNLOCK(p); /* locked by pfind(9) */
++ vm_map_unlock_read(map);
+
+ if (error == 0)
+ error = copyout(&nmaps, &uap->pmh->nmaps, sizeof uap->pmh->nmaps);