From: Julien Grall Date: Tue, 27 Jun 2017 09:33:20 +0000 (+0100) Subject: xen/mm: Introduce {G,M}FN_INVALID_INITIALIZER X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1872 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bbbe89351275ed6ac09207fe9aeb80b606af1a4d;p=xen.git xen/mm: Introduce {G,M}FN_INVALID_INITIALIZER The current implementation of {G,M}FN_INVALID cannot be used to initialize global variable because the initializer element is not a constant. Due to a bug in GCC 4.9 and older ([1]), it is not easy to find a common value to initialize a variable and directly passed as an argument. Introduce 2 news define {G,M}FN_INVALID_INITIALIZER to be used for initializing a variable. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64856 Signed-off-by: Julien Grall Acked-by: Tim Deegan --- diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 0050fba498..503b92e4b0 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -57,6 +57,11 @@ TYPE_SAFE(unsigned long, mfn); #define PRI_mfn "05lx" #define INVALID_MFN _mfn(~0UL) +/* + * To be used for global variable initialization. This workaround a bug + * in GCC < 5.0. + */ +#define INVALID_MFN_INITIALIZER { ~0UL } #ifndef mfn_t #define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */ @@ -90,6 +95,11 @@ static inline bool_t mfn_eq(mfn_t x, mfn_t y) TYPE_SAFE(unsigned long, gfn); #define PRI_gfn "05lx" #define INVALID_GFN _gfn(~0UL) +/* + * To be used for global variable initialization. This workaround a bug + * in GCC < 5.0 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64856 + */ +#define INVALID_GFN_INITIALIZER { ~0UL } #ifndef gfn_t #define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */