diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-01 09:03:04 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-01 09:03:04 -0500 |
commit | 1acd5a373905ddb28957842256a038956941f332 (patch) | |
tree | a371c58995d3e80702d4836c8dbb27dbdb70e9a5 /hw/ppc/mpc8544_guts.c | |
parent | f7d1f9d4e74d66cc7c72de46575a61bd6b433360 (diff) | |
parent | 2345f1c0146672ce6eb0025bd2cfa4afabdef5fd (diff) |
Merge remote-tracking branch 'agraf/ppc-for-upstream' into staging
# By Alexander Graf (12) and others
# Via Alexander Graf
* agraf/ppc-for-upstream: (32 commits)
PPC: Ignore writes to L2CR
mac-io: Add escc-legacy memory alias region
PPC: Newworld: Add second uninorth control register set
PPC: Newworld: Add uninorth token register
PPC: Add clock-frequency export for Mac machines
PPC: Introduce an alias cache for faster lookups
PPC: Fix GDB read on code area for PPC6xx
PPC: Add dump_mmu() for 6xx
target-ppc: Introduce unrealizefn for PowerPCCPU
booke_ppc: limit booke timer to max when timeout overflow
Graphics: Switch to 800x600x32 as default mode
pseries: Update MAINTAINERS information
target-ppc kvm: save cr register
pseries: Fix compiler warning (conversion of pointer to integral value)
spapr-rtas: add CPU argument to RTAS calls
target-ppc: Change default machine for 64-bit
ppc: do not register IABR SPR twice for 603e
target-ppc: Drop redundant flags assignments from CPU families
mpc8544_guts: Turn qdev initfn into instance_init
mpc8544_guts: QOM'ify
...
Message-id: 1372556709-23868-1-git-send-email-agraf@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ppc/mpc8544_guts.c')
-rw-r--r-- | hw/ppc/mpc8544_guts.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index 193beab2c2..d41f615522 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -51,8 +51,14 @@ #define MPC8544_GUTS_ADDR_SRDS2CR1 0xF10 #define MPC8544_GUTS_ADDR_SRDS2CR3 0xF18 +#define TYPE_MPC8544_GUTS "mpc8544-guts" +#define MPC8544_GUTS(obj) OBJECT_CHECK(GutsState, (obj), TYPE_MPC8544_GUTS) + struct GutsState { - SysBusDevice busdev; + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + MemoryRegion iomem; }; @@ -108,31 +114,21 @@ static const MemoryRegionOps mpc8544_guts_ops = { }, }; -static int mpc8544_guts_initfn(SysBusDevice *dev) +static void mpc8544_guts_initfn(Object *obj) { - GutsState *s; - - s = FROM_SYSBUS(GutsState, SYS_BUS_DEVICE(dev)); + SysBusDevice *d = SYS_BUS_DEVICE(obj); + GutsState *s = MPC8544_GUTS(obj); memory_region_init_io(&s->iomem, &mpc8544_guts_ops, s, - "mpc6544.guts", MPC8544_GUTS_MMIO_SIZE); - sysbus_init_mmio(dev, &s->iomem); - - return 0; -} - -static void mpc8544_guts_class_init(ObjectClass *klass, void *data) -{ - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - - k->init = mpc8544_guts_initfn; + "mpc8544.guts", MPC8544_GUTS_MMIO_SIZE); + sysbus_init_mmio(d, &s->iomem); } static const TypeInfo mpc8544_guts_info = { - .name = "mpc8544-guts", + .name = TYPE_MPC8544_GUTS, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(GutsState), - .class_init = mpc8544_guts_class_init, + .instance_init = mpc8544_guts_initfn, }; static void mpc8544_guts_register_types(void) |