aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2019-06-24 18:55:47 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-06-09 06:59:44 +0200
commit28c78fe818257eb1229448ac672e9f350b37437d (patch)
tree0418451c7b34effc17c086b0e7d160ad546760db /hw
parent6007523a80bc5100c22a1caf642a9e8a3ea7bd15 (diff)
downloadqemu-28c78fe818257eb1229448ac672e9f350b37437d.zip
qemu-28c78fe818257eb1229448ac672e9f350b37437d.tar.gz
qemu-28c78fe818257eb1229448ac672e9f350b37437d.tar.bz2
hw/misc/empty_slot: Name the slots when created
Directly set the slot name when creating the device, to display the device name in trace events. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Artyom Tarasenko <atar4qemu@gmail.com> Message-Id: <20200510152840.13558-8-f4bug@amsat.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/mips/malta.c2
-rw-r--r--hw/misc/empty_slot.c2
-rw-r--r--hw/sparc/sun4m.c10
3 files changed, 9 insertions, 5 deletions
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index c973c76..62063b2 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -1241,7 +1241,7 @@ void mips_malta_init(MachineState *machine)
* exception when accessing invalid memory. Create an empty slot to
* emulate this feature.
*/
- empty_slot_init(0, 0x20000000);
+ empty_slot_init("GT64120", 0, 0x20000000);
qdev_init_nofail(dev);
diff --git a/hw/misc/empty_slot.c b/hw/misc/empty_slot.c
index 54be085..b568ae2 100644
--- a/hw/misc/empty_slot.c
+++ b/hw/misc/empty_slot.c
@@ -50,7 +50,7 @@ static const MemoryRegionOps empty_slot_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-void empty_slot_init(hwaddr addr, uint64_t slot_size)
+void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size)
{
if (slot_size > 0) {
/* Only empty slots larger than 0 byte need handling. */
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index a16e667..249f7ba 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -884,7 +884,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
/* models without ECC don't trap when missing ram is accessed */
if (!hwdef->ecc_base) {
- empty_slot_init(machine->ram_size, hwdef->max_mem - machine->ram_size);
+ empty_slot_init("ecc", machine->ram_size,
+ hwdef->max_mem - machine->ram_size);
}
prom_init(hwdef->slavio_base, bios_name);
@@ -915,7 +916,8 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
Software shouldn't use aliased addresses, neither should it crash
when does. Using empty_slot instead of aliasing can help with
debugging such accesses */
- empty_slot_init(hwdef->iommu_pad_base,hwdef->iommu_pad_len);
+ empty_slot_init("iommu.alias",
+ hwdef->iommu_pad_base, hwdef->iommu_pad_len);
}
sparc32_dma_init(hwdef->dma_base,
@@ -964,7 +966,9 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hwdef,
for (i = 0; i < MAX_VSIMMS; i++) {
/* vsimm registers probed by OBP */
if (hwdef->vsimm[i].reg_base) {
- empty_slot_init(hwdef->vsimm[i].reg_base, 0x2000);
+ char *name = g_strdup_printf("vsimm[%d]", i);
+ empty_slot_init(name, hwdef->vsimm[i].reg_base, 0x2000);
+ g_free(name);
}
}