[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/21] macio: Delay qdev init until all fields are i
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 03/21] macio: Delay qdev init until all fields are initialized |
Date: |
Fri, 25 Jan 2013 13:52:46 +0100 |
From: Andreas Färber <address@hidden>
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>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/macio.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
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.6.0.2
- [Qemu-devel] [PULL 00/21] ppc patch queue 2013-01-25, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 06/21] mac_nvram: Mark as Big Endian, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 01/21] ppc: Move Mac machines to hw/ppc/, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 03/21] macio: Delay qdev init until all fields are initialized,
Alexander Graf <=
- [Qemu-devel] [PATCH 02/21] macio: QOM'ify some more, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 08/21] ide/macio: QOM'ify MacIO IDE, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 04/21] macio: Split MacIO in two, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 07/21] mac_nvram: QOM'ify MacIO NVRAM, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 12/21] cuda: Move ADB bus into CUDA state, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 05/21] mac_nvram: Clean up public API, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 11/21] adb: QOM'ify ADB devices, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 15/21] pseries: Adjust default VIO address allocations to play better with libvirt, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 13/21] target-ppc: Give a meaningful error if too many threads are specified, Alexander Graf, 2013/01/25
- [Qemu-devel] [PATCH 10/21] adb: QOM'ify Apple Desktop Bus, Alexander Graf, 2013/01/25