aboutsummaryrefslogtreecommitdiff
path: root/hw/m68k
diff options
context:
space:
mode:
Diffstat (limited to 'hw/m68k')
-rw-r--r--hw/m68k/mcf5206.c4
-rw-r--r--hw/m68k/mcf5208.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index 92a194dbc4..6d93d761a5 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -10,6 +10,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "cpu.h"
+#include "hw/boards.h"
#include "hw/irq.h"
#include "hw/m68k/mcf.h"
#include "qemu/timer.h"
@@ -312,8 +313,9 @@ static uint64_t m5206_mbar_read(m5206_mbar_state *s,
/* FIXME: currently hardcoded to 128Mb. */
{
uint32_t mask = ~0;
- while (mask > ram_size)
+ while (mask > current_machine->ram_size) {
mask >>= 1;
+ }
return mask & 0x0ffe0000;
}
case 0x5c: return 1; /* DRAM bank 1 empty. */
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 7c8ca5ddf6..2205145ecc 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -157,8 +157,9 @@ static uint64_t m5208_sys_read(void *opaque, hwaddr addr,
{
int n;
for (n = 0; n < 32; n++) {
- if (ram_size < (2u << n))
+ if (current_machine->ram_size < (2u << n)) {
break;
+ }
}
return (n - 1) | 0x40000000;
}