summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm_amd64.c2
-rw-r--r--lib/libkvm/kvm_i386.c2
-rw-r--r--lib/libkvm/kvm_proc.c16
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c
index e8e3cf3..764a2d1 100644
--- a/lib/libkvm/kvm_amd64.c
+++ b/lib/libkvm/kvm_amd64.c
@@ -108,7 +108,7 @@ _kvm_initvtop(kvm_t *kd) {
_kvm_err(kd, kd->program, "cannot read IdlePTD");
return (-1);
}
- if ((vm->PTD = _kvm_malloc(kd, NBPG /*sizeof(struct pde)*/)) != 0) {
+ if ((vm->PTD = _kvm_malloc(kd, PAGE_SIZE /*sizeof(struct pde)*/)) != 0) {
_kvm_err(kd, kd->program, "cannot allocate vm->PTD");
}
if (KREAD(kd, (u_long)nlist[1].n_value, &vm->PTD)) {
diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c
index e8e3cf3..764a2d1 100644
--- a/lib/libkvm/kvm_i386.c
+++ b/lib/libkvm/kvm_i386.c
@@ -108,7 +108,7 @@ _kvm_initvtop(kvm_t *kd) {
_kvm_err(kd, kd->program, "cannot read IdlePTD");
return (-1);
}
- if ((vm->PTD = _kvm_malloc(kd, NBPG /*sizeof(struct pde)*/)) != 0) {
+ if ((vm->PTD = _kvm_malloc(kd, PAGE_SIZE /*sizeof(struct pde)*/)) != 0) {
_kvm_err(kd, kd->program, "cannot allocate vm->PTD");
}
if (KREAD(kd, (u_long)nlist[1].n_value, &vm->PTD)) {
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 042e90f..fe36f3e 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -413,17 +413,17 @@ kvm_argv(kd, p, addr, narg, maxcnt)
* arrays are left pointing to the collected strings.
*/
if (kd->argspc == 0) {
- kd->argspc = (char *)_kvm_malloc(kd, NBPG);
+ kd->argspc = (char *)_kvm_malloc(kd, PAGE_SIZE);
if (kd->argspc == 0)
return (0);
- kd->arglen = NBPG;
+ kd->arglen = PAGE_SIZE;
}
/*
* kd->argbuf : used to pull in pages from the target process.
* the strings are copied out of here.
*/
if (kd->argbuf == 0) {
- kd->argbuf = (char *)_kvm_malloc(kd, NBPG);
+ kd->argbuf = (char *)_kvm_malloc(kd, PAGE_SIZE);
if (kd->argbuf == 0)
return (0);
}
@@ -454,22 +454,22 @@ kvm_argv(kd, p, addr, narg, maxcnt)
while (argv < kd->argv + narg && *argv != 0) {
/* get the address that the current argv string is on */
- addr = (u_long)*argv & ~(NBPG - 1);
+ addr = (u_long)*argv & ~(PAGE_SIZE - 1);
/* is it the same page as the last one? */
if (addr != oaddr) {
- if (kvm_uread(kd, p, addr, kd->argbuf, NBPG) !=
- NBPG)
+ if (kvm_uread(kd, p, addr, kd->argbuf, PAGE_SIZE) !=
+ PAGE_SIZE)
return (0);
oaddr = addr;
}
/* offset within the page... kd->argbuf */
- addr = (u_long)*argv & (NBPG - 1);
+ addr = (u_long)*argv & (PAGE_SIZE - 1);
/* cp = start of string, cc = count of chars in this chunk */
cp = kd->argbuf + addr;
- cc = NBPG - addr;
+ cc = PAGE_SIZE - addr;
/* dont get more than asked for by user process */
if (maxcnt > 0 && cc > maxcnt - len)
OpenPOWER on IntegriCloud