diff options
Diffstat (limited to 'util/m5')
-rw-r--r-- | util/m5/m5.c | 19 | ||||
-rw-r--r-- | util/m5/m5op.S | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/util/m5/m5.c b/util/m5/m5.c index 193c0e329..23401aea5 100644 --- a/util/m5/m5.c +++ b/util/m5/m5.c @@ -169,6 +169,22 @@ main(int argc, char *argv[]) } } + if (COMPARE("readfile")) { + char buf[256*1024]; + int offset = 0; + int len; + + if (argc != 2) + usage(); + + while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) { + write(STDOUT_FILENO, buf, len); + offset += len; + } + + return 0; + } + if (COMPARE("checkpoint")) { switch (argc) { case 4: @@ -186,6 +202,9 @@ main(int argc, char *argv[]) return 0; } + if (COMPARE("loadsymbol")) { + m5_loadsymbol(arg1); + return 0; if (COMPARE("readfile")) { char buf[256*1024]; int offset = 0; diff --git a/util/m5/m5op.S b/util/m5/m5op.S index 5c0212189..a19113e62 100644 --- a/util/m5/m5op.S +++ b/util/m5/m5op.S @@ -41,6 +41,7 @@ #define exit_old_func 0x20 // deprectated! #define exit_func 0x21 #define initparam_func 0x30 +#define loadsymbol_func 0x31 #define resetstats_func 0x40 #define dumpstats_func 0x41 #define dumprststats_func 0x42 @@ -77,6 +78,7 @@ func: #define IVLE(reg) INST(m5_op, reg, 0, ivle_func) #define M5EXIT(reg) INST(m5_op, reg, 0, exit_func) #define INITPARAM(reg) INST(m5_op, reg, 0, initparam_func) +#define LOADSYMBOL(reg) INST(m5_op, reg, 0, loadsymbol_func) #define RESET_STATS(r1, r2) INST(m5_op, r1, r2, resetstats_func) #define DUMP_STATS(r1, r2) INST(m5_op, r1, r2, dumpstats_func) #define DUMPRST_STATS(r1, r2) INST(m5_op, r1, r2, dumprststats_func) @@ -147,6 +149,12 @@ LEAF(m5_initparam) END(m5_initparam) .align 4 +LEAF(m5_loadsymbol) + LOADSYMBOL(0) + RET +END(m5_loadsymbol) + + .align 4 LEAF(m5_reset_stats) RESET_STATS(16, 17) RET |