[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] pc: sanitize i440fx_init() arguments
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 1/4] pc: sanitize i440fx_init() arguments |
Date: |
Wed, 16 Oct 2013 10:49:11 +0200 |
* rename pci_hole_start to below_4g_mem_size to reflect what is
really passed in and move pci_hole_size calculation inside
i440fx.
* remove ram_size arg from function signature, since it could be
retrieved as below_4g_mem_size + above_4g_mem_size sum,
internally.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/i386/pc_piix.c | 3 +--
hw/pci-host/piix.c | 11 ++++++-----
include/hw/i386/pc.h | 4 +---
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index c6042c7..2fed5fd 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -145,9 +145,8 @@ static void pc_init1(QEMUMachineInitArgs *args,
if (pci_enabled) {
pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi,
- system_memory, system_io, args->ram_size,
+ system_memory, system_io,
below_4g_mem_size,
- 0x100000000ULL - below_4g_mem_size,
above_4g_mem_size,
pci_memory, ram_memory);
} else {
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index c041149..5b9cc1f 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -311,9 +311,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,
ISABus **isa_bus, qemu_irq *pic,
MemoryRegion *address_space_mem,
MemoryRegion *address_space_io,
- ram_addr_t ram_size,
- hwaddr pci_hole_start,
- hwaddr pci_hole_size,
+ hwaddr below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *pci_address_space,
MemoryRegion *ram_memory)
@@ -327,6 +325,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,
unsigned i;
I440FXState *i440fx;
uint64_t pci_hole64_size;
+ ram_addr_t ram_size = below_4g_mem_size + above_4g_mem_size;
dev = qdev_create(NULL, TYPE_I440FX_PCI_HOST_BRIDGE);
s = PCI_HOST_BRIDGE(dev);
@@ -355,8 +354,10 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,
}
memory_region_init_alias(&f->pci_hole, OBJECT(d), "pci-hole",
f->pci_address_space,
- pci_hole_start, pci_hole_size);
- memory_region_add_subregion(f->system_memory, pci_hole_start,
&f->pci_hole);
+ below_4g_mem_size,
+ 0x100000000ULL - below_4g_mem_size);
+ memory_region_add_subregion(f->system_memory, below_4g_mem_size,
+ &f->pci_hole);
pci_hole64_size = pci_host_get_hole64_size(i440fx->pci_hole64_size);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 6083839..95fc6cc 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -166,9 +166,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int
*piix_devfn,
ISABus **isa_bus, qemu_irq *pic,
MemoryRegion *address_space_mem,
MemoryRegion *address_space_io,
- ram_addr_t ram_size,
- hwaddr pci_hole_start,
- hwaddr pci_hole_size,
+ hwaddr below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *pci_memory,
MemoryRegion *ram_memory);
--
1.7.1