qemu-cr16/hw/cr16c/boot.c
Jonas Bewig 005bf105aa
WIP
2025-04-14 09:07:59 +02:00

22 lines
619 B
C

#include "boot.h"
#include "hw/loader.h"
#include "qemu/datadir.h"
#include "qemu/error-report.h"
bool cr16c_load_firmware(CR16CCPU *cpu, MachineState *ms, MemoryRegion *mr, const char *firmware) {
/* Adapted from arm implementation */
g_autofree char *filename = NULL;
int ret;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware);
if (!filename) {
error_report("Could not find firmware image");
return false;
}
ret = load_image_mr(filename, mr);
if (ret < 0) {
error_report("Failed to load firmware image");
return false;
}
return true;
}