From 136c0eff3b501c3828d38a08ef2e3bcf255fdef2 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Sat, 30 Mar 2024 02:15:24 +0000 Subject: [PATCH] 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 --- util/m5/src/m5_mmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/m5/src/m5_mmap.c b/util/m5/src/m5_mmap.c index c088e264eb..cda36fe70a 100644 --- a/util/m5/src/m5_mmap.c +++ b/util/m5/src/m5_mmap.c @@ -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));