mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-21 00:53:27 -06:00
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>
This commit is contained in:
parent
6007523a80
commit
28c78fe818
4 changed files with 10 additions and 6 deletions
|
@ -1241,7 +1241,7 @@ void mips_malta_init(MachineState *machine)
|
||||||
* exception when accessing invalid memory. Create an empty slot to
|
* exception when accessing invalid memory. Create an empty slot to
|
||||||
* emulate this feature.
|
* emulate this feature.
|
||||||
*/
|
*/
|
||||||
empty_slot_init(0, 0x20000000);
|
empty_slot_init("GT64120", 0, 0x20000000);
|
||||||
|
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ static const MemoryRegionOps empty_slot_ops = {
|
||||||
.endianness = DEVICE_NATIVE_ENDIAN,
|
.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) {
|
if (slot_size > 0) {
|
||||||
/* Only empty slots larger than 0 byte need handling. */
|
/* Only empty slots larger than 0 byte need handling. */
|
||||||
|
|
|
@ -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 */
|
/* models without ECC don't trap when missing ram is accessed */
|
||||||
if (!hwdef->ecc_base) {
|
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);
|
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
|
Software shouldn't use aliased addresses, neither should it crash
|
||||||
when does. Using empty_slot instead of aliasing can help with
|
when does. Using empty_slot instead of aliasing can help with
|
||||||
debugging such accesses */
|
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,
|
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++) {
|
for (i = 0; i < MAX_VSIMMS; i++) {
|
||||||
/* vsimm registers probed by OBP */
|
/* vsimm registers probed by OBP */
|
||||||
if (hwdef->vsimm[i].reg_base) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,6 @@
|
||||||
|
|
||||||
#include "exec/hwaddr.h"
|
#include "exec/hwaddr.h"
|
||||||
|
|
||||||
void empty_slot_init(hwaddr addr, uint64_t slot_size);
|
void empty_slot_init(const char *name, hwaddr addr, uint64_t slot_size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue