Message ID | 1467046452-1261-6-git-send-email-julien.grall@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 27.06.16 at 18:54, <julien.grall@arm.com> wrote: > The two new defines will be a typesafe version of resp. INVALID_GFN and > INVALID_MFN. > > Signed-off-by: Julien Grall <julien.grall@arm.com> Ultimately we'll likely want it the other way around naming-wise, but I understand that's far beyond what this series can and should do. Acked-by: Jan Beulich <jbeulich@suse.com>
On 28/06/2016 08:16, Jan Beulich wrote: >>>> On 27.06.16 at 18:54, <julien.grall@arm.com> wrote: >> The two new defines will be a typesafe version of resp. INVALID_GFN and >> INVALID_MFN. >> >> Signed-off-by: Julien Grall <julien.grall@arm.com> > Ultimately we'll likely want it the other way around naming-wise, > but I understand that's far beyond what this series can and should > do. There are plenty of uses of INVALID_{M,G}FN which are not part of {m,g}fn_t, such as in the hypercall API. I am not sure that it is realistic to change INVALID_{M,G}FN to be boxed types. ~Andrew
>>> On 28.06.16 at 09:29, <andrew.cooper3@citrix.com> wrote: > On 28/06/2016 08:16, Jan Beulich wrote: >>>>> On 27.06.16 at 18:54, <julien.grall@arm.com> wrote: >>> The two new defines will be a typesafe version of resp. INVALID_GFN and >>> INVALID_MFN. >>> >>> Signed-off-by: Julien Grall <julien.grall@arm.com> >> Ultimately we'll likely want it the other way around naming-wise, >> but I understand that's far beyond what this series can and should >> do. > > There are plenty of uses of INVALID_{M,G}FN which are not part of > {m,g}fn_t, such as in the hypercall API. I am not sure that it is > realistic to change INVALID_{M,G}FN to be boxed types. I can't spot any such use in the public interface. And I also can't see anything wrong with perhaps a few instances of e.g. mfn_x(INVALID_MFN) remaining long term. Jan
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index afbb1a1..978a62e 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -56,6 +56,7 @@ TYPE_SAFE(unsigned long, mfn); #define PRI_mfn "05lx" #define INVALID_MFN (~0UL) +#define INVALID_MFN_T _mfn(INVALID_MFN) #ifndef mfn_t #define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */ @@ -85,6 +86,7 @@ static inline bool_t mfn_eq(mfn_t x, mfn_t y) TYPE_SAFE(unsigned long, gfn); #define PRI_gfn "05lx" #define INVALID_GFN (~0UL) +#define INVALID_GFN_T _gfn(INVALID_GFN) #ifndef gfn_t #define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
The two new defines will be a typesafe version of resp. INVALID_GFN and INVALID_MFN. Signed-off-by: Julien Grall <julien.grall@arm.com> --- Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: George Dunlap <George.Dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Tim Deegan <tim@xen.org> Cc: Wei Liu <wei.liu2@citrix.com> Changes in v4: - Patch added --- xen/include/xen/mm.h | 2 ++ 1 file changed, 2 insertions(+)