util-m5: Add a warning when m5op_addr is 0x0

This address, 0x0, is most likely a wrong address to call m5 ops.
The warning will catch the problem where m5op_addr is not initialized
properly.

Change-Id: I442b4806191ae6f5c137bc947f2a269684c599dd
Signed-off-by: Hoa Nguyen <hn@hnpl.org>
This commit is contained in:
Hoa Nguyen
2024-03-30 02:15:24 +00:00
parent 294dd6dd01
commit 136c0eff3b

View File

@@ -69,6 +69,10 @@ map_m5_mem()
exit(1);
}
if (m5op_addr == 0) {
fprintf(stdout, "Warn: m5op_addr is set to 0x0\n");
}
fd = open(m5_mmap_dev, O_RDWR | O_SYNC);
if (fd == -1) {
fprintf(stderr, "Can't open %s: %s\n", m5_mmap_dev, strerror(errno));