summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-11-11 19:18:52 +0000
committerdim <dim@FreeBSD.org>2010-11-11 19:18:52 +0000
commit2c7257916febea8b75c0dd26b35c761f32102153 (patch)
treed4abe4c95ec205487b18900f5e8744a6719d57b6
parent2175fbcfd1c7c37de76d66e618c6ea099fdc40b5 (diff)
downloadFreeBSD-src-2c7257916febea8b75c0dd26b35c761f32102153.zip
FreeBSD-src-2c7257916febea8b75c0dd26b35c761f32102153.tar.gz
Use the same treatment as in linker_set.h for the __start and __stop
symbols of the set_vnet and set_pcpu sections, so those symbols will always be emitted in kernel modules, if they use vnet.h or pcpu.h. Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and associated macros invisible to userland, to prevent it picking up these symbols. Reviewed by: kib
-rw-r--r--sys/net/vnet.h2
-rw-r--r--sys/sys/pcpu.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index 0baac27..1c8d1fe 100644
--- a/sys/net/vnet.h
+++ b/sys/net/vnet.h
@@ -95,7 +95,9 @@ struct vnet {
* Location of the kernel's 'set_vnet' linker set.
*/
extern uintptr_t *__start_set_vnet;
+__GLOBL(__start_set_vnet);
extern uintptr_t *__stop_set_vnet;
+__GLOBL(__stop_set_vnet);
#define VNET_START (uintptr_t)&__start_set_vnet
#define VNET_STOP (uintptr_t)&__stop_set_vnet
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index 75017d6..b029e12 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -42,11 +42,15 @@
#include <sys/resource.h>
#include <machine/pcpu.h>
+#ifdef _KERNEL
+
/*
* Define a set for pcpu data.
*/
extern uintptr_t *__start_set_pcpu;
+__GLOBL(__start_set_pcpu);
extern uintptr_t *__stop_set_pcpu;
+__GLOBL(__stop_set_pcpu);
/*
* Array of dynamic pcpu base offsets. Indexed by id.
@@ -127,6 +131,8 @@ extern uintptr_t dpcpu_off[];
} \
} while(0)
+#endif /* _KERNEL */
+
/*
* XXXUPS remove as soon as we have per cpu variable
* linker sets and can define rm_queue in _rm_lock.h
OpenPOWER on IntegriCloud