[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v5 4/7] xen: introduce mfn_init macro



To be used in constant initializations of mfn_t variables, such as:

static mfn_t node = mfn_init(MM_ADDR);

It is necessary because static inline functions cannot be used as static
initializers.

Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/include/xen/mm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 054d02e..692967e 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -77,6 +77,12 @@ TYPE_SAFE(unsigned long, mfn);
 #undef mfn_x
 #endif
 
+#ifndef NDEBUG
+#define mfn_init(x) { x }
+#else
+#define mfn_init(x) x
+#endif
+
 static inline mfn_t mfn_add(mfn_t mfn, unsigned long i)
 {
     return _mfn(mfn_x(mfn) + i);
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.