summaryrefslogtreecommitdiff
path: root/hw/lm32/milkymist.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/lm32/milkymist.c')
-rw-r--r--hw/lm32/milkymist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index 7ceedb814..baf234ce0 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -21,6 +21,7 @@
#include "hw/hw.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/loader.h"
@@ -107,6 +108,11 @@ milkymist_init(QEMUMachineInitArgs *args)
cpu_model = "lm32-full";
}
cpu = cpu_lm32_init(cpu_model);
+ if (cpu == NULL) {
+ fprintf(stderr, "qemu: unable to find CPU '%s'\n", cpu_model);
+ exit(1);
+ }
+
env = &cpu->env;
reset_info->cpu = cpu;
@@ -143,7 +149,7 @@ milkymist_init(QEMUMachineInitArgs *args)
reset_info->bootstrap_pc = BIOS_OFFSET;
/* if no kernel is given no valid bios rom is a fatal error */
- if (!kernel_filename && !dinfo && !bios_filename) {
+ if (!kernel_filename && !dinfo && !bios_filename && !qtest_enabled()) {
fprintf(stderr, "qemu: could not load Milkymist One bios '%s'\n",
bios_name);
exit(1);
@@ -208,7 +214,6 @@ static QEMUMachine milkymist_machine = {
.desc = "Milkymist One",
.init = milkymist_init,
.is_default = 0,
- DEFAULT_MACHINE_OPTIONS,
};
static void milkymist_machine_init(void)