[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V12 17/27] pc: split out pci device init from pc_ini
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V12 17/27] pc: split out pci device init from pc_init1() into pc_pci_device_init() |
Date: |
Wed, 6 Jan 2010 11:39:41 +0900 |
Split out pci device initialization from pc_init1() into pc_pci_device_init().
and removed unnecessary braces.
Signed-off-by: Isaku Yamahata <address@hidden>
Acked-by: Gerd Hoffmann <address@hidden>
---
hw/pc.c | 35 +++++++++++++++++++----------------
1 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index dbff7b7..7ce1fdb 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1189,6 +1189,24 @@ static void pc_basic_device_init(qemu_irq *isa_irq,
*floppy_controller = fdctrl_init_isa(fd);
}
+static void pc_pci_device_init(PCIBus *pci_bus)
+{
+ int i;
+ int max_bus;
+
+ max_bus = drive_get_max_bus(IF_SCSI);
+ for (i = 0; i <= max_bus; i++) {
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
+ }
+
+ /* Add virtio console devices */
+ for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
+ if (virtcon_hds[i]) {
+ pci_create_simple(pci_bus, -1, "virtio-console-pci");
+ }
+ }
+}
+
/* PC hardware initialisation */
static void pc_init1(ram_addr_t ram_size,
const char *boot_device,
@@ -1308,22 +1326,7 @@ static void pc_init1(ram_addr_t ram_size,
}
if (pci_enabled) {
- int max_bus;
- int bus;
-
- max_bus = drive_get_max_bus(IF_SCSI);
- for (bus = 0; bus <= max_bus; bus++) {
- pci_create_simple(pci_bus, -1, "lsi53c895a");
- }
- }
-
- /* Add virtio console devices */
- if (pci_enabled) {
- for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
- if (virtcon_hds[i]) {
- pci_create_simple(pci_bus, -1, "virtio-console-pci");
- }
- }
+ pc_pci_device_init(pci_bus);
}
rom_load_fw(fw_cfg);
--
1.6.5.4
- [Qemu-devel] [PATCH V12 08/27] pc: make an unnecessary global variable, pit, local., (continued)
- [Qemu-devel] [PATCH V12 08/27] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 22/27] pci hotplug: add argument to pci hot plug callback., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 16/27] pc: split out basic device init from pc_init1() into pc_basic_device_init(), Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 14/27] pc: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 18/27] pc: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 21/27] acpi_piix4: qdevfy., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 20/27] rtc: make rtc_xxx accept/return ISADevice instead of RTCState., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 19/27] pc: move rtc declarations from pc.h into a dedicated header file., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 06/27] pc: initialize ioapic before use., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 13/27] pc: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 17/27] pc: split out pci device init from pc_init1() into pc_pci_device_init(),
Isaku Yamahata <=
- [Qemu-devel] [PATCH V12 15/27] pc: split out vga initialization from pc_init1() into pc_vga_init()., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 02/27] acpi: split out apm register emulation from acpi.c, Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 04/27] acpi: split acpi.c into the common part and the piix4 part., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 03/27] acpi: add acpi constants from linux header files and use them., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V12 07/27] pc, i440fx: Make smm enable/disable function i440fx independent., Isaku Yamahata, 2010/01/05
- Re: [Qemu-devel] [PATCH V12 00/27] split out piix specific part from pc emulator and some clean ups, Isaku Yamahata, 2010/01/12