[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC ppc-next v3 04/10] macio: Delay qdev init until all fiel
From: |
Andreas Färber |
Subject: |
[Qemu-ppc] [RFC ppc-next v3 04/10] macio: Delay qdev init until all fields are initialized |
Date: |
Mon, 14 Jan 2013 00:54:58 +0100 |
This turns macio_bar_setup() into an implementation detail of the qdev
initfn, to be removed step by step.
Signed-off-by: Andreas Färber <address@hidden>
---
hw/macio.c | 11 ++++++++---
1 Datei geändert, 8 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
diff --git a/hw/macio.c b/hw/macio.c
index 770e3bd..8b4b48d 100644
--- a/hw/macio.c
+++ b/hw/macio.c
@@ -82,7 +82,13 @@ static void macio_bar_setup(MacIOState *macio_state)
static int macio_initfn(PCIDevice *d)
{
+ MacIOState *s = MACIO(d);
+
d->config[0x3d] = 0x01; // interrupt on pin 1
+
+ macio_bar_setup(s);
+ pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar);
+
return 0;
}
@@ -127,7 +133,7 @@ void macio_init (PCIBus *bus, int device_id, int
is_oldworld,
MacIOState *macio_state;
int i;
- d = pci_create_simple(bus, -1, TYPE_MACIO);
+ d = pci_create(bus, -1, TYPE_MACIO);
macio_state = MACIO(d);
macio_state->is_oldworld = is_oldworld;
@@ -148,6 +154,5 @@ void macio_init (PCIBus *bus, int device_id, int
is_oldworld,
pci_config_set_device_id(d->config, device_id);
- macio_bar_setup(macio_state);
- pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &macio_state->bar);
+ qdev_init_nofail(DEVICE(d));
}
--
1.7.10.4
- [Qemu-ppc] [RFC ppc-next v3 00/10] target-ppc: MacIO QOM'ification, Andreas Färber, 2013/01/13
- [Qemu-ppc] [RFC ppc-next v3 06/10] mac_nvram: Clean up public API, Andreas Färber, 2013/01/13
- [Qemu-ppc] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Andreas Färber, 2013/01/13
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Markus Armbruster, 2013/01/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Andreas Färber, 2013/01/14
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const, Markus Armbruster, 2013/01/14
- [Qemu-ppc] Go along with glib's basic type typedef silliness? (was: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const), Markus Armbruster, 2013/01/14
- Re: [Qemu-ppc] [Qemu-devel] Go along with glib's basic type typedef silliness? (was: [PATCH 01/10] qom: Make object_resolve_path_component() path argument const), Blue Swirl, 2013/01/17
- Re: [Qemu-ppc] [Qemu-devel] Go along with glib's basic type typedef silliness?, Markus Armbruster, 2013/01/18
- Re: [Qemu-ppc] [Qemu-devel] Go along with glib's basic type typedef silliness?, Blue Swirl, 2013/01/19
[Qemu-ppc] [RFC ppc-next v3 04/10] macio: Delay qdev init until all fields are initialized,
Andreas Färber <=
[Qemu-ppc] [RFC ppc-next v3 07/10] mac_nvram: Mark as Big Endian, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 08/10] mac_nvram: QOM'ify MacIO NVRAM, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 03/10] macio: QOM'ify some more, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 05/10] macio: Split MacIO in two, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 09/10] ide/macio: QOM'ify MacIO IDE, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 02/10] ppc: Move Mac machines to hw/ppc/, Andreas Färber, 2013/01/13
[Qemu-ppc] [RFC ppc-next v3 10/10] cuda: QOM'ify CUDA, Andreas Färber, 2013/01/13