Skip to contentSkip to conversation

hw/mips/malta: Minor housekeeping in mips_malta_init()

PATCH Applied Philippe Mathieu-Daudé 2 participants 5 messages Oct 12, 2020 – Oct 16, 2020

lore
Share & tools
lore
#0 lore raw

cover hw/mips/malta: Minor housekeeping in mips_malta_init()

Move some code around to make this big function
easier to review.

Philippe Mathieu-Daudé (2):
hw/mips/malta: Move gt64120 related code together hw/mips/malta: Use clearer qdev style

 hw/mips/malta.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 hw/mips/malta: Move gt64120 related code together

The 'empty_slot' region created is related to the gt64120. Move its creation close to the gt64120 instance creation.

---
 hw/mips/malta.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
hw/mips/malta.c +6 -7
index 4019c9dc1a8..fe8f6f7ef51 100644
@@ -1235,13 +1235,6 @@ void mips_malta_init(MachineState *machine)
     DeviceState *dev = qdev_new(TYPE_MIPS_MALTA);
     MaltaState *s = MIPS_MALTA(dev);
 
-    /*
-     * The whole address space decoded by the GT-64120A doesn't generate
-     * exception when accessing invalid memory. Create an empty slot to
-     * emulate this feature.
-     */
-    empty_slot_init("GT64120", 0, 0x20000000);
-
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* create CPU */
@@ -1395,6 +1388,12 @@ void mips_malta_init(MachineState *machine)
 
     /* Northbridge */
     pci_bus = gt64120_register(s->i8259);
+    /*
+     * The whole address space decoded by the GT-64120A doesn't generate
+     * exception when accessing invalid memory. Create an empty slot to
+     * emulate this feature.
+     */
+    empty_slot_init("GT64120", 0, 0x20000000);
 
     /* Southbridge */
     dev = piix4_create(pci_bus, &isa_bus, &smbus);
Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 hw/mips/malta: Use clearer qdev style

In reply to Philippe Mathieu-Daudé

In order to be consistent with the other code base uses, rewrite slightly how the MIPS_MALTA object is created. No logical change.

---
 hw/mips/malta.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/mips/malta.c +4 -4
index fe8f6f7ef51..6c447d159e3 100644
@@ -1231,11 +1231,11 @@ void mips_malta_init(MachineState *machine)
     DriveInfo *dinfo;
     int fl_idx = 0;
     int be;
+    MaltaState *s;
+    DeviceState *dev;
 
-    DeviceState *dev = qdev_new(TYPE_MIPS_MALTA);
-    MaltaState *s = MIPS_MALTA(dev);
-
-    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+    s = MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA));
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
 
     /* create CPU */
     mips_create_cpu(machine, s, &cbus_irq, &i8259_irq);
Signature · 1 line
2.26.2
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

Move some code around to make this big function
easier to review.

Philippe Mathieu-Daudé (2):
hw/mips/malta: Move gt64120 related code together hw/mips/malta: Use clearer qdev style

  hw/mips/malta.c | 21 ++++++++++-----------
  1 file changed, 10 insertions(+), 11 deletions(-)

Thanks, applied to mips-next.