[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/15] xen/asm-generic: introduce generic device.h



On Mon, 2023-11-13 at 17:43 +0100, Jan Beulich wrote:
> On 10.11.2023 17:30, Oleksii Kurochko wrote:
> > --- /dev/null
> > +++ b/xen/include/asm-generic/device.h
> > @@ -0,0 +1,140 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_DEVICE_H__
> > +#define __ASM_GENERIC_DEVICE_H__
> > +
> > +enum device_type
> > +{
> > +    DEV_DT,
> > +#ifdef HAS_PCI
> > +    DEV_PCI,
> > +#endif
> > +};
> > +
> > +struct dev_archdata {
> > +    void *iommu;    /* IOMMU private data */
> > +};
> > +
> > +/* struct device - The basic device structure */
> > +struct device
> > +{
> > +    enum device_type type;
> > +#ifdef CONFIG_HAS_DEVICE_TREE
> > +    struct dt_device_node *of_node; /* Used by drivers imported
> > from Linux */
> > +#endif
> 
> There's just this instance where HAS_DEVICE_TREE is checked. Why not
> elsewhere?
> Imo, if you really want this header in asm-generic/, then it wants to
> be truly
> generic (i.e. not implying DT just like you're not implying PCI or
> ACPI).
Mostly copied this file from Arm and only that one part was #ifdef-ed
with HAS_DEVICE_TREE.
But it makes sense to #ifdef DEV_DT, inclusion of <xen/device_tree.h>
and definiotn of dev_is_dt() macros.

I'll made the changes in next version of patch series.

Thanks for comments.

~ Oleksii



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.