aboutsummaryrefslogtreecommitdiff
path: root/sys/net/vnet.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2010-11-14 20:23:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2010-11-14 20:23:02 +0000
commit47d46d92c221c8a81f9182b93559bebb618c137a (patch)
treefacb20a04756e19b653bcb1e38f135b0e153eab6 /sys/net/vnet.h
parent5f67450d3ad3e3a3b3452fd91a7511d9e75fa74f (diff)
downloadsrc-47d46d92c221c8a81f9182b93559bebb618c137a.tar.gz
src-47d46d92c221c8a81f9182b93559bebb618c137a.zip
Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.
Notes
Notes: svn path=/head/; revision=215316
Diffstat (limited to 'sys/net/vnet.h')
-rw-r--r--sys/net/vnet.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index 76123c7e4b88..1453194ae959 100644
--- a/sys/net/vnet.h
+++ b/sys/net/vnet.h
@@ -196,8 +196,10 @@ 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) t VNET_NAME(n) __section(VNET_SETNAME) __used
-#define _VNET_PTR(b, n) (__typeof(VNET_NAME(n))*) \
- ((b) + (uintptr_t)&VNET_NAME(n))
+#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(b, n) (*_VNET_PTR(b, n))
@@ -371,10 +373,11 @@ 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 _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 STATIC_VNET_DEFINE(t, n) static t n
+#define _VNET_PTR(b, n) &VNET_NAME(n)
/*
* Virtualized global variable accessor macros.