qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 13/14] ide: Convert to isa_register_old_portio_l


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 13/14] ide: Convert to isa_register_old_portio_list.
Date: Wed, 17 Aug 2011 07:04:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

On 08/16/2011 09:45 AM, Richard Henderson wrote:
@@ -1873,20 +1874,30 @@ void ide_init2_with_non_qdev_drives(IDEBus *bus, 
DriveInfo *hd0,
      bus->dma =&ide_dma_nop;
  }

-void ide_init_ioport(IDEBus *bus, int iobase, int iobase2)
+static const MemoryRegionPortio ide_portio_list[] = {
+    {0, 8, 1, .read = ide_ioport_read, .write = ide_ioport_write },
+    {0, 2, 2, .read = ide_data_readw, .write = ide_data_writew },
+    {0, 4, 4, .read = ide_data_readl, .write = ide_data_writel },
+    PORTIO_END_OF_LIST(),
+    PORTIO_END_OF_LIST(),
+};
+
+static const MemoryRegionPortio ide_portio2_list[] = {
+    {0, 1, 1, .read = ide_status_read, .write = ide_cmd_write },
+    PORTIO_END_OF_LIST(),
+    PORTIO_END_OF_LIST(),
+};

Missing spaces.

+
+void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
  {
-    register_ioport_write(iobase, 8, 1, ide_ioport_write, bus);
-    register_ioport_read(iobase, 8, 1, ide_ioport_read, bus);
+    /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA
+       bridge has been setup properly to always register with ISA.  */
+    isa_register_old_portio_list(dev, iobase, ide_portio_list, bus, "ide");

Which PCI-ISA bridge? If you're behind a secondary PCI bridge, you've now bypassed its filtering.


+
      if (iobase2) {
-        register_ioport_read(iobase2, 1, 1, ide_status_read, bus);
-        register_ioport_write(iobase2, 1, 1, ide_cmd_write, bus);
+        isa_register_old_portio_list(dev, iobase2,
+                                     ide_portio2_list, bus, "ide");
      }
-
-    /* data ports */
-    register_ioport_write(iobase, 2, 2, ide_data_writew, bus);
-    register_ioport_read(iobase, 2, 2, ide_data_readw, bus);
-    register_ioport_write(iobase, 4, 4, ide_data_writel, bus);
-    register_ioport_read(iobase, 4, 4, ide_data_readl, bus);
  }



--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]