[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC XEN v1 01/14] xen: arm: Add gic_hw_desc
On Tue, 2015-12-15 at 16:15 +0000, Stefano Stabellini wrote: > On Wed, 9 Dec 2015, Ian Campbell wrote: > > Because the enum gic_version values do not correspond to the gic > > version (in order to allow space for variants such as GICv2m, although > > that is currently not present) logging the raw value is not terribly > > useful. Provide gic_hw_desc which provides a string describing each > > GIC version. > > > > Will be used in a later patch. > > > > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> > > --- > > Âxen/arch/arm/gic.cÂÂÂÂÂÂÂÂ| 14 ++++++++++++++ > > Âxen/include/asm-arm/gic.h |ÂÂ1 + > > Â2 files changed, 15 insertions(+) > > > > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c > > index 1e1e5ba..bea39d6 100644 > > --- a/xen/arch/arm/gic.c > > +++ b/xen/arch/arm/gic.c > > @@ -62,6 +62,20 @@ enum gic_version gic_hw_version(void) > > ÂÂÂÂreturn gic_hw_ops->info->hw_version; > > Â} > > Â > > +const char *gic_hw_desc(enum gic_version v) > > +{ > > +ÂÂÂÂswitch (v) { > > +ÂÂÂÂcase GIC_V2: return "GIC v2"; > > +ÂÂÂÂcase GIC_V3: return "GIC v3"; > > +ÂÂÂÂ} > > + > > +ÂÂÂÂ/* > > +ÂÂÂÂÂ* The compiler ought to gripe if the above doesn't cover all enum > > +ÂÂÂÂÂ* gic_version, in case some version doesn't. > > +ÂÂÂÂÂ*/ > > +ÂÂÂÂreturn "Unknown"; > > default: ? Deliberately not, since that would quash the expected compiler warning. > > In any case > > Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> Thanks. > > > > +} > > + > > Âunsigned int gic_number_lines(void) > > Â{ > > ÂÂÂÂÂreturn gic_hw_ops->info->nr_lines; > > diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h > > index 42a2eec..818384b 100644 > > --- a/xen/include/asm-arm/gic.h > > +++ b/xen/include/asm-arm/gic.h > > @@ -221,6 +221,7 @@ enum gic_version { > > Â}; > > Â > > Âextern enum gic_version gic_hw_version(void); > > +extern const char *gic_hw_desc(enum gic_version v); > > Â > > Â/* Program the GIC to route an interrupt */ > > Âextern void gic_route_irq_to_xen(struct irq_desc *desc, const > > cpumask_t *cpu_mask, _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |