[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/24] pc: Remove redundant arguments from pc_cmos_in
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 16/24] pc: Remove redundant arguments from pc_cmos_init() |
Date: |
Thu, 13 Aug 2015 15:15:26 +0300 |
From: Eduardo Habkost <address@hidden>
Remove arguments that can be found in PCMachineState.
Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/i386/pc.h | 2 --
hw/i386/pc.c | 16 +++++++---------
hw/i386/pc_piix.c | 5 +----
hw/i386/pc_q35.c | 5 +----
4 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index c433602..a56f70c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -198,8 +198,6 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
uint32 hpet_irqs);
void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
void pc_cmos_init(PCMachineState *pcms,
- ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
- const char *boot_device,
BusState *ide0, BusState *ide1,
ISADevice *s);
void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 54b28a3..681ea85 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -429,8 +429,6 @@ static void pc_cmos_init_late(void *opaque)
}
void pc_cmos_init(PCMachineState *pcms,
- ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
- const char *boot_device,
BusState *idebus0, BusState *idebus1,
ISADevice *s)
{
@@ -442,12 +440,12 @@ void pc_cmos_init(PCMachineState *pcms,
/* memory size */
/* base memory (first MiB) */
- val = MIN(ram_size / 1024, 640);
+ val = MIN(pcms->below_4g_mem_size / 1024, 640);
rtc_set_memory(s, 0x15, val);
rtc_set_memory(s, 0x16, val >> 8);
/* extended memory (next 64MiB) */
- if (ram_size > 1024 * 1024) {
- val = (ram_size - 1024 * 1024) / 1024;
+ if (pcms->below_4g_mem_size > 1024 * 1024) {
+ val = (pcms->below_4g_mem_size - 1024 * 1024) / 1024;
} else {
val = 0;
}
@@ -458,8 +456,8 @@ void pc_cmos_init(PCMachineState *pcms,
rtc_set_memory(s, 0x30, val);
rtc_set_memory(s, 0x31, val >> 8);
/* memory between 16MiB and 4GiB */
- if (ram_size > 16 * 1024 * 1024) {
- val = (ram_size - 16 * 1024 * 1024) / 65536;
+ if (pcms->below_4g_mem_size > 16 * 1024 * 1024) {
+ val = (pcms->below_4g_mem_size - 16 * 1024 * 1024) / 65536;
} else {
val = 0;
}
@@ -468,7 +466,7 @@ void pc_cmos_init(PCMachineState *pcms,
rtc_set_memory(s, 0x34, val);
rtc_set_memory(s, 0x35, val >> 8);
/* memory above 4GiB */
- val = above_4g_mem_size / 65536;
+ val = pcms->above_4g_mem_size / 65536;
rtc_set_memory(s, 0x5b, val);
rtc_set_memory(s, 0x5c, val >> 8);
rtc_set_memory(s, 0x5d, val >> 16);
@@ -484,7 +482,7 @@ void pc_cmos_init(PCMachineState *pcms,
object_property_set_link(OBJECT(pcms), OBJECT(s),
"rtc_state", &error_abort);
- set_boot_dev(s, boot_device, &local_err);
+ set_boot_dev(s, MACHINE(pcms)->boot_order, &local_err);
if (local_err) {
error_report_err(local_err);
exit(1);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index f64f029..c98635f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -267,10 +267,7 @@ static void pc_init1(MachineState *machine)
}
}
- pc_cmos_init(pcms,
- pcms->below_4g_mem_size, pcms->above_4g_mem_size,
- machine->boot_order,
- idebus[0], idebus[1], rtc_state);
+ pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
if (pci_enabled && usb_enabled()) {
pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index af5fd9f..79e3f9b 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -276,10 +276,7 @@ static void pc_q35_init(MachineState *machine)
0xb100),
8, NULL, 0);
- pc_cmos_init(pcms,
- pcms->below_4g_mem_size, pcms->above_4g_mem_size,
- machine->boot_order,
- idebus[0], idebus[1], rtc_state);
+ pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
/* the rest devices to which pci devfn is automatically assigned */
pc_vga_init(isa_bus, host_bus);
--
MST
- [Qemu-devel] [PULL 07/24] pc: Rename pc_machine variables to pcms, (continued)
- [Qemu-devel] [PULL 07/24] pc: Rename pc_machine variables to pcms, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 09/24] pc: Eliminate pc_common_machine_options(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 08/24] pc: Move PCMachineClass, PCMachineState to qemu/typedefs.h, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 10/24] pc: Eliminate pc_default_machine_options(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 12/24] pc: Use PCMachineState for pc_memory_init() argument, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 11/24] pc: Use PCMachineState for pc_cmos_init() argument, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 14/24] pc: Use PCMachineState as pc_guest_info_init() argument, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 13/24] pc: Move {above, below}_4g_mem_size variables to PCMachineState, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 15/24] pc: Remove redundant arguments from *load_linux(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 17/24] pc: Remove redundant arguments from pc_memory_init(), Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 16/24] pc: Remove redundant arguments from pc_cmos_init(),
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 18/24] pci: allow 0 address for PCI IO/MEM regions, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 19/24] virtio-net: remove useless codes, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 20/24] acpi: avoid potential uninitialized access to cpu_hp_io_base, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 21/24] smbios: extract x86 smbios building code into a function, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 22/24] smbios: remove dependency on x86 e820 tables, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 23/24] smbios: move smbios code into a common folder, Michael S. Tsirkin, 2015/08/13
- [Qemu-devel] [PULL 24/24] MAINTAINERS: list smbios maintainers, Michael S. Tsirkin, 2015/08/13
- Re: [Qemu-devel] [PULL 00/24] virtio,pc,acpi fixes, cleanups, Peter Maydell, 2015/08/13