summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-11-14 20:14:25 +0000
committerdim <dim@FreeBSD.org>2010-11-14 20:14:25 +0000
commit756e9f53779b25e86ec78fa8ea80b869110fb7e5 (patch)
treee7ef401664063000bd5a4405863bbb31f320b00d /lib/libkvm
parent6a94c7762a006a9c28315abb507ae2508bf3d458 (diff)
downloadFreeBSD-src-756e9f53779b25e86ec78fa8ea80b869110fb7e5.zip
FreeBSD-src-756e9f53779b25e86ec78fa8ea80b869110fb7e5.tar.gz
Similar to sys/net/vnet.h, define the linker set name for sys/sys/pcpu.h
as a macro, and use it instead of literal strings.
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm.c7
-rw-r--r--lib/libkvm/kvm_pcpu.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index 37f6a72..b6d3bcd 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94";
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/linker.h>
+#include <sys/pcpu.h>
#include <net/vnet.h>
@@ -433,7 +434,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize)
if (error > 0 && _kvm_dpcpu_initialized(kd, initialize))
error = kvm_fdnlist_prefix(kd, nl, error,
- "pcpu_entry_", _kvm_dpcpu_validaddr);
+ DPCPU_SYMPREFIX, _kvm_dpcpu_validaddr);
return (error);
}
@@ -473,7 +474,7 @@ again:
p->n_value =
_kvm_vnet_validaddr(kd, lookup.symvalue);
else if (_kvm_dpcpu_initialized(kd, initialize) &&
- !strcmp(prefix, "pcpu_entry_"))
+ !strcmp(prefix, DPCPU_SYMPREFIX))
p->n_value =
_kvm_dpcpu_validaddr(kd, lookup.symvalue);
else
@@ -495,7 +496,7 @@ again:
}
if (error && _kvm_dpcpu_initialized(kd, initialize) && !tried_dpcpu) {
tried_dpcpu = 1;
- prefix = "pcpu_entry_";
+ prefix = DPCPU_SYMPREFIX;
goto again;
}
diff --git a/lib/libkvm/kvm_pcpu.c b/lib/libkvm/kvm_pcpu.c
index 484d2ea..d896c4f 100644
--- a/lib/libkvm/kvm_pcpu.c
+++ b/lib/libkvm/kvm_pcpu.c
@@ -197,9 +197,9 @@ _kvm_dpcpu_init(kvm_t *kd)
{
struct nlist nl[] = {
#define NLIST_START_SET_PCPU 0
- { "___start_set_pcpu" },
+ { "___start_" DPCPU_SETNAME },
#define NLIST_STOP_SET_PCPU 1
- { "___stop_set_pcpu" },
+ { "___stop_" DPCPU_SETNAME },
#define NLIST_DPCPU_OFF 2
{ "_dpcpu_off" },
#define NLIST_MP_MAXCPUS 3
OpenPOWER on IntegriCloud