[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/35] next-cube: rearrange NeXTState declarations to improve read
From: |
Thomas Huth |
Subject: |
[PULL 18/35] next-cube: rearrange NeXTState declarations to improve readability |
Date: |
Sun, 29 Dec 2024 08:25:09 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Move the NeXTState, next_dma and TYPE_NEXT_MACHINE definition to the same area
at the top of next-cube.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20241222130012.1013374-17-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
---
hw/m68k/next-cube.c | 64 ++++++++++++++++++++++-----------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index 73c4d4ea9c..0cf4470ce8 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -38,30 +38,10 @@
#define DPRINTF(fmt, ...) do { } while (0)
#endif
-#define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube")
-OBJECT_DECLARE_SIMPLE_TYPE(NeXTState, NEXT_MACHINE)
-
#define ENTRY 0x0100001e
#define RAM_SIZE 0x4000000
#define ROM_FILE "Rev_2.5_v66.bin"
-typedef struct next_dma {
- uint32_t csr;
-
- uint32_t saved_next;
- uint32_t saved_limit;
- uint32_t saved_start;
- uint32_t saved_stop;
-
- uint32_t next;
- uint32_t limit;
- uint32_t start;
- uint32_t stop;
-
- uint32_t next_initbuf;
- uint32_t size;
-} next_dma;
-
typedef struct NextRtc {
int8_t phase;
uint8_t ram[32];
@@ -72,18 +52,6 @@ typedef struct NextRtc {
uint8_t retval;
} NextRtc;
-struct NeXTState {
- MachineState parent;
-
- MemoryRegion rom;
- MemoryRegion rom2;
- MemoryRegion dmamem;
- MemoryRegion bmapm1;
- MemoryRegion bmapm2;
-
- next_dma dma[10];
-};
-
#define TYPE_NEXT_SCSI "next-scsi"
OBJECT_DECLARE_SIMPLE_TYPE(NeXTSCSI, NEXT_SCSI)
@@ -132,6 +100,38 @@ struct NeXTPC {
NextRtc rtc;
};
+typedef struct next_dma {
+ uint32_t csr;
+
+ uint32_t saved_next;
+ uint32_t saved_limit;
+ uint32_t saved_start;
+ uint32_t saved_stop;
+
+ uint32_t next;
+ uint32_t limit;
+ uint32_t start;
+ uint32_t stop;
+
+ uint32_t next_initbuf;
+ uint32_t size;
+} next_dma;
+
+#define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube")
+OBJECT_DECLARE_SIMPLE_TYPE(NeXTState, NEXT_MACHINE)
+
+struct NeXTState {
+ MachineState parent;
+
+ MemoryRegion rom;
+ MemoryRegion rom2;
+ MemoryRegion dmamem;
+ MemoryRegion bmapm1;
+ MemoryRegion bmapm2;
+
+ next_dma dma[10];
+};
+
/* Thanks to NeXT forums for this */
/*
static const uint8_t rtc_ram3[32] = {
--
2.47.1
- [PULL 09/35] next-cube: move SCSI CSRs from next-pc to the next-scsi device, (continued)
- [PULL 09/35] next-cube: move SCSI CSRs from next-pc to the next-scsi device, Thomas Huth, 2024/12/29
- [PULL 10/35] next-cube: move SCSI 4020/4021 logic from next-pc device to next-scsi device, Thomas Huth, 2024/12/29
- [PULL 11/35] next-cube: move floppy disk MMIO to separate memory region in next-pc, Thomas Huth, 2024/12/29
- [PULL 12/35] next-cube: map ESCC registers as a subregion of the next.scr memory region, Thomas Huth, 2024/12/29
- [PULL 13/35] next-cube: move ESCC to be QOM child of next-pc device, Thomas Huth, 2024/12/29
- [PULL 14/35] next-cube: move timer MMIO to separate memory region on next-pc device, Thomas Huth, 2024/12/29
- [PULL 15/35] next-cube: move en ethernet MMIO to separate memory region on next-pc device, Thomas Huth, 2024/12/29
- [PULL 16/35] next-cube: add empty slots for unknown accesses to next.scr memory region, Thomas Huth, 2024/12/29
- [PULL 17/35] next-cube: remove unused next.scr memory region, Thomas Huth, 2024/12/29
- [PULL 25/35] next-cube: use named gpio to read RTC data bit in scr2, Thomas Huth, 2024/12/29
- [PULL 18/35] next-cube: rearrange NeXTState declarations to improve readability,
Thomas Huth <=
- [PULL 19/35] next-cube: convert next-pc device to use Resettable interface, Thomas Huth, 2024/12/29
- [PULL 20/35] next-cube: rename typedef struct NextRtc to NeXTRTC, Thomas Huth, 2024/12/29
- [PULL 21/35] next-cube: use qemu_irq to drive int_status in next_scr2_rtc_update(), Thomas Huth, 2024/12/29
- [PULL 23/35] next-cube: always use retval to return rtc read values, Thomas Huth, 2024/12/29
- [PULL 24/35] next-cube: use named gpio to set RTC data bit in scr2, Thomas Huth, 2024/12/29
- [PULL 30/35] next-cube: use named gpio output for next-rtc data, Thomas Huth, 2024/12/29
- [PULL 26/35] next-cube: don't use rtc phase value of -1, Thomas Huth, 2024/12/29
- [PULL 27/35] next-cube: QOMify NeXTRTC, Thomas Huth, 2024/12/29
- [PULL 29/35] next-cube: move rtc-data-in gpio from next-pc to next-rtc device, Thomas Huth, 2024/12/29
- [PULL 31/35] next-cube: add rtc-cmd-reset named gpio to reset the rtc state machine, Thomas Huth, 2024/12/29