summaryrefslogtreecommitdiffstats
path: root/sys/net/vnet.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-11-22 19:32:54 +0000
committerdim <dim@FreeBSD.org>2010-11-22 19:32:54 +0000
commitfb307d7d1de2e083e767df27714dca5352792ac3 (patch)
treeddc86814ee8f35466e619bb63b8f15b41185074e /sys/net/vnet.h
parentb040c9742c99e20eb9926995bea03ad4f3e849c8 (diff)
downloadFreeBSD-src-fb307d7d1de2e083e767df27714dca5352792ac3.zip
FreeBSD-src-fb307d7d1de2e083e767df27714dca5352792ac3.tar.gz
After some off-list discussion, revert a number of changes to the
DPCPU_DEFINE and VNET_DEFINE macros, as these cause problems for various people working on the affected files. A better long-term solution is still being considered. This reversal may give some modules empty set_pcpu or set_vnet sections, but these are harmless. Changes reverted: ------------------------------------------------------------------------ r215318 | dim | 2010-11-14 21:40:55 +0100 (Sun, 14 Nov 2010) | 4 lines Instead of unconditionally emitting .globl's for the __start_set_xxx and __stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu sections are actually defined. ------------------------------------------------------------------------ r215317 | dim | 2010-11-14 21:38:11 +0100 (Sun, 14 Nov 2010) | 3 lines Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughout the tree. ------------------------------------------------------------------------ r215316 | dim | 2010-11-14 21:23:02 +0100 (Sun, 14 Nov 2010) | 2 lines Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.
Diffstat (limited to 'sys/net/vnet.h')
-rw-r--r--sys/net/vnet.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index beecd43..76123c7 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
@@ -193,14 +195,9 @@ extern struct sx vnet_sxlock;
*/
#define VNET_NAME(n) vnet_entry_##n
#define VNET_DECLARE(t, n) extern t VNET_NAME(n)
-#define VNET_DEFINE(t, n) \
- __GLOBL("__start_" VNET_SETNAME); \
- __GLOBL("__stop_" VNET_SETNAME); \
- t VNET_NAME(n) __section(VNET_SETNAME) __used
-#define STATIC_VNET_DEFINE(t, n) \
- VNET_DEFINE(static t, n)
-#define _VNET_PTR(b, n) \
- (__typeof(VNET_NAME(n))*)((b) + (uintptr_t)&VNET_NAME(n))
+#define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used
+#define _VNET_PTR(b, n) (__typeof(VNET_NAME(n))*) \
+ ((b) + (uintptr_t)&VNET_NAME(n))
#define _VNET(b, n) (*_VNET_PTR(b, n))
@@ -374,11 +371,10 @@ do { \
* Versions of the VNET macros that compile to normal global variables and
* standard sysctl definitions.
*/
-#define VNET_NAME(n) n
-#define VNET_DECLARE(t, n) extern t n
-#define VNET_DEFINE(t, n) t n
-#define STATIC_VNET_DEFINE(t, n) static t n
-#define _VNET_PTR(b, n) &VNET_NAME(n)
+#define VNET_NAME(n) n
+#define VNET_DECLARE(t, n) extern t n
+#define VNET_DEFINE(t, n) t n
+#define _VNET_PTR(b, n) &VNET_NAME(n)
/*
* Virtualized global variable accessor macros.
OpenPOWER on IntegriCloud