qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 05/22] ppc/xics: introduce a QOM interface to


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH v2 05/22] ppc/xics: introduce a QOM interface to handle ICSs
Date: Thu, 23 Feb 2017 13:18:16 +1100
User-agent: Mutt/1.7.1 (2016-10-04)

On Thu, Feb 16, 2017 at 02:47:28PM +0100, Cédric Le Goater wrote:
> This QOM interface provides two simple handlers. One is to get an ICS
> object from an irq number and a second to resend the irqs when needed.

Maybe call this XICSFabric rather than XicsInterface.  While it's an
interface from the QOM point-of-view, that doesn't really describe
where it sits in the hardware model, and it's the ics and icp objects
which provide all the interfaces which are visible to the guest or to
interrupt generating devices.

Apart from that,

Reviewed-by: David Gibson <address@hidden>

> Signed-off-by: Cédric Le Goater <address@hidden>
> ---
>  hw/intc/xics.c        |  7 +++++++
>  include/hw/ppc/xics.h | 18 ++++++++++++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index b1294417a0ae..3e80d2d0f0d9 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -726,6 +726,12 @@ static const TypeInfo ics_base_info = {
>      .class_size = sizeof(ICSStateClass),
>  };
>  
> +static const TypeInfo xics_interface_info = {
> +    .name = TYPE_XICS_INTERFACE,
> +    .parent = TYPE_INTERFACE,
> +    .class_size = sizeof(XICSInterfaceClass),
> +};
> +
>  /*
>   * Exported functions
>   */
> @@ -766,6 +772,7 @@ static void xics_register_types(void)
>      type_register_static(&ics_simple_info);
>      type_register_static(&ics_base_info);
>      type_register_static(&icp_info);
> +    type_register_static(&xics_interface_info);
>  }
>  
>  type_init(xics_register_types)
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 6d443ce09dba..fe2bb5c8ef54 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -177,6 +177,24 @@ struct ICSIRQState {
>      uint8_t flags;
>  };
>  
> +typedef struct XICSInterface {
> +    Object parent;
> +} XICSInterface;
> +
> +#define TYPE_XICS_INTERFACE "xics-interface"
> +#define XICS_INTERFACE(obj)                                     \
> +    OBJECT_CHECK(XICSInterface, (obj), TYPE_XICS_INTERFACE)
> +#define XICS_INTERFACE_CLASS(klass)                                     \
> +    OBJECT_CLASS_CHECK(XICSInterfaceClass, (klass), TYPE_XICS_INTERFACE)
> +#define XICS_INTERFACE_GET_CLASS(obj)                                   \
> +    OBJECT_GET_CLASS(XICSInterfaceClass, (obj), TYPE_XICS_INTERFACE)
> +
> +typedef struct XICSInterfaceClass {
> +    InterfaceClass parent;
> +    ICSState *(*ics_get)(XICSInterface *xi, int irq);
> +    void (*ics_resend)(XICSInterface *xi);
> +} XICSInterfaceClass;
> +
>  #define XICS_IRQS_SPAPR               1024
>  
>  qemu_irq xics_get_qirq(XICSState *icp, int irq);

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]