[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v10 2/6] xen: introduce DEFINE_SYMBOL
>>> On 25.02.19 at 21:50, <sstabellini@xxxxxxxxxx> wrote: > --- a/xen/include/xen/compiler.h > +++ b/xen/include/xen/compiler.h > @@ -99,6 +99,38 @@ > __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ > (typeof(ptr)) (__ptr + (off)); }) > > + > +/* > + * Declare start and end array variables in C corresponding to existing > + * linker symbols. You validly say "declare" here, so why ... > + * Two static inline functions are declared to do comparisons and > + * subtractions between these variables. > + * > + * The end variable is declared with a different type to make sure that > + * the static inline functions cannot be misused. > + */ > +#define DEFINE_SYMBOL(type, name, start_name, end_name) > \ ... do you use DEFINE here? How about DECLARE_ARRAY_BOUNDS(tag, name) using tag ## _t as type, tag ## _lt etc as function names, and name ## _start / name ## _end as start / end symbols. To accommodate things like _etext, the above could in fact expand to DECLARE_BOUNDS(tag, name ## _start, name ## _end) allowing this second macro then to also be used like DECLARE_BOUNDS(text, _stext, _etext). Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |