Skip to contentSkip to conversation

hw/i386: Fix linker error when ISAPC is disabled

PATCH New Paolo Bonzini 1 participant 3 messages Jul 5, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

v3 cover hw/i386: Fix linker error when ISAPC is disabled

v3 fixes the issue pointed out by Patchew and Philippe.

Julio Montes (2):
Makefile: generate header file with the list of devices enabled hw/i386: Fix linker error when ISAPC is disabled

 Makefile.target       |  4 ++++
 hw/i386/pc_piix.c     | 12 +++++++++---
 scripts/create_config |  2 ++
 3 files changed, 15 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v3 1/2 Makefile: generate header file with the list of devices enabled

From: Julio Montes <[email protected]>

v2: generate config-devices.h which contains the list of devices enabled

Message-Id: <[email protected]>

---
 Makefile.target       | 4 ++++
 scripts/create_config | 2 ++
 2 files changed, 6 insertions(+)
Makefile.target +4 -0
index 72c267f..7154e99 100644
@@ -45,6 +45,9 @@ include $(SRC_PATH)/tests/tcg/Makefile.include
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak
 
+config-devices.h: config-devices.h-timestamp
+config-devices.h-timestamp: config-devices.mak
+
 ifdef CONFIG_TRACE_SYSTEMTAP
 stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp $(QEMU_PROG)-log.stp
 
@@ -168,6 +171,7 @@ obj-y += hw/$(TARGET_BASE_ARCH)/
 endif
 
 generated-files-y += hmp-commands.h hmp-commands-info.h
+generated-files-y += config-devices.h
 
 endif # CONFIG_SOFTMMU
 
scripts/create_config +2 -0
index d727e5e..00e86c8 100755
@@ -58,6 +58,8 @@ case $line in
     name=${line%=*}
     echo "#define $name 1"
     ;;
+ CONFIG_*=n) # configuration
+    ;;
  CONFIG_*=*) # configuration
     name=${line%=*}
     value=${line#*=}
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v3 2/2 hw/i386: Fix linker error when ISAPC is disabled

In reply to Paolo Bonzini

From: Julio Montes <[email protected]>

v2: include config-devices.h to use CONFIG_IDE_ISA

Message-Id: <[email protected]>

---
 hw/i386/pc_piix.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +9 -3
index c07c4a5..cc04c01 100644
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "config-devices.h"
 
 #include "qemu/units.h"
 #include "hw/hw.h"
@@ -61,9 +62,11 @@
 
 #define MAX_IDE_BUS 2
 
+#ifdef CONFIG_IDE_ISA
 static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
+#endif
 
 /* PC hardware initialisation */
 static void pc_init1(MachineState *machine,
@@ -254,7 +257,10 @@ static void pc_init1(MachineState *machine,
         }
         idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
         idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
-    } else {
+        pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
+    }
+#ifdef CONFIG_IDE_ISA
+else {
         for(i = 0; i < MAX_IDE_BUS; i++) {
             ISADevice *dev;
             char busname[] = "ide.0";
@@ -268,9 +274,9 @@ static void pc_init1(MachineState *machine,
             busname[4] = '0' + i;
             idebus[i] = qdev_get_child_bus(DEVICE(dev), busname);
         }
+        pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
     }
-
-    pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
+#endif
 
     if (pcmc->pci_enabled && machine_usb(machine)) {
         pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
Signature · 1 line
1.8.3.1