On 09/09/2012 03:22 PM, Avi Kivity wrote:
On 09/04/2012 06:13 PM, Julien Grall wrote:
This patch replaces all register_ioport* with the new memory API. It permits
to use the new Memory stuff like listener.

@@ -200,8 +212,11 @@ static void pm_io_space_update(PIIX4PMState *s)

          /* XXX: need to improve memory and ioport allocation */
          PIIX4_DPRINTF("PM: mapping to 0x%x\n", pm_io_base);
-        iorange_init(&s->ioport,&pm_iorange_ops, pm_io_base, 64);
-        ioport_register(&s->ioport);
+
+        memory_region_set_address(&s->pm_io, pm_io_base);
+        memory_region_set_enabled(&s->pm_io, true);
+    } else {
+        memory_region_set_enabled(&s->pm_io, false);
      }
  }

The entire if () can be simplified to

        pm_io_base = le32_to_cpu(*(uint32_t *)(s->dev.config + 0x40));
        pm_io_base&= 0xffc0;
        memory_region_transaction_begin()
        memory_region_set_enabled(&s->pm_io, s->dev.config[0x80]&  1);
        memory_region_set_address(&s->pm_io, pm_io_base);
        memory_region_transaction_commit();
I will modify, do I need to resend all the patch series or just this patch ?

--
Julien Grall



Reply via email to