Skip to content

Commit

Permalink
macfb: increase number of registers saved in MacfbState
Browse files Browse the repository at this point in the history
The MacOS toolbox ROM accesses a number of addresses between 0x0 and 0x200 during
initialisation and resolution changes. Whilst the function of many of these
registers is unknown, it is worth the minimal cost of saving these extra values as
part of migration to help future-proof the migration stream for the q800 machine
as it starts to stabilise.

Note this is a migration break, but since there are upcoming incompatible changes
for the q800 machine (and migration does not even succeed without these patches)
then this is not an issue.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220305155530.9265-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed Mar 9, 2022
1 parent 4718125 commit dd2a56a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions hw/display/macfb.c
Expand Up @@ -537,6 +537,10 @@ static uint64_t macfb_ctrl_read(void *opaque,
case DAFB_MODE_SENSE:
val = macfb_sense_read(s);
break;
default:
if (addr < MACFB_CTRL_TOPADDR) {
val = s->regs[addr >> 2];
}
}

trace_macfb_ctrl_read(addr, val, size);
Expand Down Expand Up @@ -592,6 +596,10 @@ static void macfb_ctrl_write(void *opaque,
macfb_invalidate_display(s);
}
break;
default:
if (addr < MACFB_CTRL_TOPADDR) {
s->regs[addr >> 2] = val;
}
}

trace_macfb_ctrl_write(addr, val, size);
Expand Down
3 changes: 2 additions & 1 deletion include/hw/display/macfb.h
Expand Up @@ -48,7 +48,8 @@ typedef struct MacFbMode {
uint32_t offset;
} MacFbMode;

#define MACFB_NUM_REGS 8
#define MACFB_CTRL_TOPADDR 0x200
#define MACFB_NUM_REGS (MACFB_CTRL_TOPADDR / sizeof(uint32_t))

typedef struct MacfbState {
MemoryRegion mem_vram;
Expand Down

0 comments on commit dd2a56a

Please sign in to comment.