Message ID | d4ac0761d5d0cac80fec7e107d7066dfa7e37a9f.1439858176.git.alistair.francis@xilinx.com |
---|---|
State | New |
Headers | show |
On 08/17/2015 05:40 PM, Alistair Francis wrote: > Pull the AHCI state structure out into the header. This allows > other containers to access the struct. This is required to add > the device to modern SoC containers. > > Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> > Reviewed-by: Sai Pavan Boddu <saipava@xilinx.com> > Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> > --- > > hw/ide/ahci.c | 13 ------------- > hw/ide/ahci.h | 14 ++++++++++++++ > 2 files changed, 14 insertions(+), 13 deletions(-) > > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index 48749c1..02d85fa 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -25,7 +25,6 @@ > #include <hw/pci/msi.h> > #include <hw/i386/pc.h> > #include <hw/pci/pci.h> > -#include <hw/sysbus.h> > > #include "qemu/error-report.h" > #include "sysemu/block-backend.h" > @@ -1625,18 +1624,6 @@ const VMStateDescription vmstate_ahci = { > }, > }; > > -#define TYPE_SYSBUS_AHCI "sysbus-ahci" > -#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) > - > -typedef struct SysbusAHCIState { > - /*< private >*/ > - SysBusDevice parent_obj; > - /*< public >*/ > - > - AHCIState ahci; > - uint32_t num_ports; > -} SysbusAHCIState; > - > static const VMStateDescription vmstate_sysbus_ahci = { > .name = "sysbus-ahci", > .fields = (VMStateField[]) { > diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h > index 79a463d..c055d6b 100644 > --- a/hw/ide/ahci.h > +++ b/hw/ide/ahci.h > @@ -24,6 +24,8 @@ > #ifndef HW_IDE_AHCI_H > #define HW_IDE_AHCI_H > > +#include <hw/sysbus.h> > + > #define AHCI_MEM_BAR_SIZE 0x1000 > #define AHCI_MAX_PORTS 32 > #define AHCI_MAX_SG 168 /* hardware max is 64K */ > @@ -369,4 +371,16 @@ void ahci_reset(AHCIState *s); > > void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); > > +#define TYPE_SYSBUS_AHCI "sysbus-ahci" > +#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) > + > +typedef struct SysbusAHCIState { > + /*< private >*/ > + SysBusDevice parent_obj; > + /*< public >*/ > + > + AHCIState ahci; > + uint32_t num_ports; > +} SysbusAHCIState; > + > #endif /* HW_IDE_AHCI_H */ > For whomever eventually merges this; if this indeed the preferred flavor as Peter indicated: Acked-by: John Snow <jsnow@redhat.com>
On Tue, Aug 18, 2015 at 11:12 AM, John Snow <jsnow@redhat.com> wrote: > > > On 08/17/2015 05:40 PM, Alistair Francis wrote: >> Pull the AHCI state structure out into the header. This allows >> other containers to access the struct. This is required to add >> the device to modern SoC containers. >> >> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> >> Reviewed-by: Sai Pavan Boddu <saipava@xilinx.com> >> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> >> --- >> >> hw/ide/ahci.c | 13 ------------- >> hw/ide/ahci.h | 14 ++++++++++++++ >> 2 files changed, 14 insertions(+), 13 deletions(-) >> >> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c >> index 48749c1..02d85fa 100644 >> --- a/hw/ide/ahci.c >> +++ b/hw/ide/ahci.c >> @@ -25,7 +25,6 @@ >> #include <hw/pci/msi.h> >> #include <hw/i386/pc.h> >> #include <hw/pci/pci.h> >> -#include <hw/sysbus.h> >> >> #include "qemu/error-report.h" >> #include "sysemu/block-backend.h" >> @@ -1625,18 +1624,6 @@ const VMStateDescription vmstate_ahci = { >> }, >> }; >> >> -#define TYPE_SYSBUS_AHCI "sysbus-ahci" >> -#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) >> - >> -typedef struct SysbusAHCIState { >> - /*< private >*/ >> - SysBusDevice parent_obj; >> - /*< public >*/ >> - >> - AHCIState ahci; >> - uint32_t num_ports; >> -} SysbusAHCIState; >> - >> static const VMStateDescription vmstate_sysbus_ahci = { >> .name = "sysbus-ahci", >> .fields = (VMStateField[]) { >> diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h >> index 79a463d..c055d6b 100644 >> --- a/hw/ide/ahci.h >> +++ b/hw/ide/ahci.h >> @@ -24,6 +24,8 @@ >> #ifndef HW_IDE_AHCI_H >> #define HW_IDE_AHCI_H >> >> +#include <hw/sysbus.h> >> + >> #define AHCI_MEM_BAR_SIZE 0x1000 >> #define AHCI_MAX_PORTS 32 >> #define AHCI_MAX_SG 168 /* hardware max is 64K */ >> @@ -369,4 +371,16 @@ void ahci_reset(AHCIState *s); >> >> void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); >> >> +#define TYPE_SYSBUS_AHCI "sysbus-ahci" >> +#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) >> + >> +typedef struct SysbusAHCIState { >> + /*< private >*/ >> + SysBusDevice parent_obj; >> + /*< public >*/ >> + >> + AHCIState ahci; >> + uint32_t num_ports; >> +} SysbusAHCIState; >> + >> #endif /* HW_IDE_AHCI_H */ >> > > For whomever eventually merges this; if this indeed the preferred flavor > as Peter indicated: > > Acked-by: John Snow <jsnow@redhat.com> Thanks :) >
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 48749c1..02d85fa 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -25,7 +25,6 @@ #include <hw/pci/msi.h> #include <hw/i386/pc.h> #include <hw/pci/pci.h> -#include <hw/sysbus.h> #include "qemu/error-report.h" #include "sysemu/block-backend.h" @@ -1625,18 +1624,6 @@ const VMStateDescription vmstate_ahci = { }, }; -#define TYPE_SYSBUS_AHCI "sysbus-ahci" -#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) - -typedef struct SysbusAHCIState { - /*< private >*/ - SysBusDevice parent_obj; - /*< public >*/ - - AHCIState ahci; - uint32_t num_ports; -} SysbusAHCIState; - static const VMStateDescription vmstate_sysbus_ahci = { .name = "sysbus-ahci", .fields = (VMStateField[]) { diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h index 79a463d..c055d6b 100644 --- a/hw/ide/ahci.h +++ b/hw/ide/ahci.h @@ -24,6 +24,8 @@ #ifndef HW_IDE_AHCI_H #define HW_IDE_AHCI_H +#include <hw/sysbus.h> + #define AHCI_MEM_BAR_SIZE 0x1000 #define AHCI_MAX_PORTS 32 #define AHCI_MAX_SG 168 /* hardware max is 64K */ @@ -369,4 +371,16 @@ void ahci_reset(AHCIState *s); void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd); +#define TYPE_SYSBUS_AHCI "sysbus-ahci" +#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) + +typedef struct SysbusAHCIState { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + + AHCIState ahci; + uint32_t num_ports; +} SysbusAHCIState; + #endif /* HW_IDE_AHCI_H */