]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
pc: Remove redundant arguments from pc_cmos_init()
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 7 Aug 2015 19:55:54 +0000 (16:55 -0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 13 Aug 2015 11:08:28 +0000 (14:08 +0300)
Remove arguments that can be found in PCMachineState.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_q35.c
include/hw/i386/pc.h

index 54b28a3c703fcff0491eddb354c39b57254998ce..681ea858725949552285b9ee7a603437d1c4f8e9 100644 (file)
@@ -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);
index f64f029c49ad505c188737e93889858dff16349f..c98635fb11578fcc5f0dba214fe7a5bcc6950d26 100644 (file)
@@ -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");
index af5fd9f9d69277f2af7fd33856794ec05d652258..79e3f9b3cdb52dace32907d1af6ee99f7ce0b99d 100644 (file)
@@ -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);
index c43360207d0b166d7c1d34b86bee42b5a6f4d0b0..a56f70c2ea9f108340ac9463ff24053bebb3c72d 100644 (file)
@@ -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);