@@ -337,9 +337,42 @@ static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t val
}
}
+static void suse_platform_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
+{
+ addr &= 0x0f;
+ switch (addr) {
+ case 4:
+ /*
+ * SUSE unplug for Xenlinux
+ * xen-kmp used this since xen-3.0.4, instead the official protocol
+ * from xen-3.3+ It did an unconditional "outl(1, (ioaddr + 4));"
+ * Pre VMDP 1.7 used 4 and 8 depending on how VMDP was configured.
+ * If VMDP was to control both disk and LAN it would use 4.
+ * If it controlled just disk or just LAN, it would use 8 below.
+ * */
+ ide_unplug_harddisks();
+ pci_unplug_scsi();
+ pci_unplug_netifs();
+ net_tap_shutdown_all();
+ break;
+ case 8:
+ if (val ==1 ) {
+ ide_unplug_harddisks();
+ pci_unplug_scsi();
+ } else if (val == 2) {
+ pci_unplug_netifs();
+ net_tap_shutdown_all();
+ }
+ break;
+ default:
+ break;
+ }
+}
+
static void platform_ioport_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type)
{
PCIXenPlatformState *d = (PCIXenPlatformState *)pci_dev;
+ register_ioport_write(addr, 16, 4, suse_platform_ioport_writel, d);
register_ioport_write(addr, size, 1, xen_platform_ioport_writeb, d);
register_ioport_read(addr, size, 1, xen_platform_ioport_readb, d);
}