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 <[email protected]> CC: Andrew Cooper <[email protected]> CC: George Dunlap <[email protected]> CC: Ian Jackson <[email protected]> CC: Jan Beulich <[email protected]> CC: Julien Grall <[email protected]> CC: Konrad Rzeszutek Wilk <[email protected]> CC: Stefano Stabellini <[email protected]> CC: Tim Deegan <[email protected]> CC: Wei Liu <[email protected]> --- 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 [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
