aboutsummaryrefslogtreecommitdiff
path: root/hw/m68k
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2023-12-27 21:02:12 +0000
committerThomas Huth <thuth@redhat.com>2024-01-11 11:39:26 +0100
commiteea9f763002b369c2d601a3eedb905b945563e5a (patch)
treec416dcff4a1e34504ee672348fdbea167a334669 /hw/m68k
parent34eac35f893664eb8545b98142e23d9954722766 (diff)
downloadqemu-eea9f763002b369c2d601a3eedb905b945563e5a.zip
qemu-eea9f763002b369c2d601a3eedb905b945563e5a.tar.gz
qemu-eea9f763002b369c2d601a3eedb905b945563e5a.tar.bz2
q800: move dp8393x_prom memory region to Q800MachineState
There is no need to dynamically allocate the memory region from the heap. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-ID: <20231227210212.245106-1-mark.cave-ayland@ilande.co.uk> Reviewed-by: Thomas Huth <huth@tuxfamily.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/m68k')
-rw-r--r--hw/m68k/q800.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 83d1571..b80a3b6 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -253,7 +253,6 @@ static void q800_machine_init(MachineState *machine)
int bios_size;
ram_addr_t initrd_base;
int32_t initrd_size;
- MemoryRegion *dp8393x_prom = g_new(MemoryRegion, 1);
uint8_t *prom;
int i, checksum;
MacFbMode *macfb_mode;
@@ -406,13 +405,13 @@ static void q800_machine_init(MachineState *machine)
sysbus_connect_irq(sysbus, 0,
qdev_get_gpio_in(DEVICE(&m->glue), GLUE_IRQ_IN_SONIC));
- memory_region_init_rom(dp8393x_prom, NULL, "dp8393x-q800.prom",
+ memory_region_init_rom(&m->dp8393x_prom, NULL, "dp8393x-q800.prom",
SONIC_PROM_SIZE, &error_fatal);
memory_region_add_subregion(get_system_memory(), SONIC_PROM_BASE,
- dp8393x_prom);
+ &m->dp8393x_prom);
/* Add MAC address with valid checksum to PROM */
- prom = memory_region_get_ram_ptr(dp8393x_prom);
+ prom = memory_region_get_ram_ptr(&m->dp8393x_prom);
checksum = 0;
for (i = 0; i < 6; i++) {
prom[i] = revbit8(nd_table[0].macaddr.a[i]);