[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/17] q800: move dp8393x_prom memory region to Q800MachineState
|
From: |
Thomas Huth |
|
Subject: |
[PULL 01/17] q800: move dp8393x_prom memory region to Q800MachineState |
|
Date: |
Thu, 11 Jan 2024 18:00:30 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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>
---
include/hw/m68k/q800.h | 1 +
hw/m68k/q800.c | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/hw/m68k/q800.h b/include/hw/m68k/q800.h
index a9661f65f6..34365c9860 100644
--- a/include/hw/m68k/q800.h
+++ b/include/hw/m68k/q800.h
@@ -55,6 +55,7 @@ struct Q800MachineState {
MOS6522Q800VIA1State via1;
MOS6522Q800VIA2State via2;
dp8393xState dp8393x;
+ MemoryRegion dp8393x_prom;
ESCCState escc;
OrIRQState escc_orgate;
SysBusESPState esp;
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 83d1571d02..b80a3b6d5f 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]);
--
2.43.0
- [PULL 00/17] Misc patches (qtests, s390x, m68k, gitlab-ci), Thomas Huth, 2024/01/11
- [PULL 01/17] q800: move dp8393x_prom memory region to Q800MachineState,
Thomas Huth <=
- [PULL 03/17] Revert "netdev: set timeout depending on loadavg", Thomas Huth, 2024/01/11
- [PULL 06/17] net: add explicit info about connecting/listening state, Thomas Huth, 2024/01/11
- [PULL 02/17] qtest: use correct boolean type for failover property, Thomas Huth, 2024/01/11
- [PULL 07/17] net: handle QIOTask completion to report useful error message, Thomas Huth, 2024/01/11
- [PULL 05/17] Revert "tests/qtest/netdev-socket: Raise connection timeout to 120 seconds", Thomas Huth, 2024/01/11
- [PULL 08/17] qtest: ensure netdev-socket tests have non-overlapping names, Thomas Huth, 2024/01/11
- [PULL 04/17] Revert "osdep: add getloadavg", Thomas Huth, 2024/01/11
- [PULL 10/17] gitlab: fix s390x tag for avocado-system-centos, Thomas Huth, 2024/01/11
- [PULL 11/17] target/s390x/kvm/pv: Provide some more useful information if decryption fails, Thomas Huth, 2024/01/11
- [PULL 09/17] tests/qtest/virtio-ccw: Fix device presence checking, Thomas Huth, 2024/01/11