util, m5: Use consistent naming for m5op C symbols
authorAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 27 Jul 2017 14:38:38 +0000 (15:38 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 1 Aug 2017 18:27:06 +0000 (18:27 +0000)
Rename m5op C symbols to be prefixed all lower case, separated by
underscore, and prefixed by m5. This avoids potential name clashes for
short names such as arm.

Change-Id: Ic42f94d8a722661ef96c151d627e31eeb2e51490
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jose Marinho <jose.marinho@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/4264
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
include/gem5/asm/generic/m5ops.h
util/m5/m5.c
util/m5/m5op.h
util/m5/m5op_alpha.S
util/m5/m5op_sparc.S
util/m5/m5op_x86.S

index b7999cb438dea8f29a3580d3f5a6a0d652a14d4b..e3df3f69e89c90939e4d7d45baa19232953b519b 100644 (file)
 #define M5OP_AN_GETID           0x11
 
 
-#define M5OP_FOREACH                                          \
-    M5OP(arm, M5OP_ARM, 0);                                   \
-    M5OP(quiesce, M5OP_QUIESCE, 0);                           \
-    M5OP(quiesceNs, M5OP_QUIESCE_NS, 0);                      \
-    M5OP(quiesceCycle, M5OP_QUIESCE_CYCLE, 0);                \
-    M5OP(quiesceTime, M5OP_QUIESCE_TIME, 0);                  \
-    M5OP(rpns, M5OP_RPNS, 0);                                 \
-    M5OP(wakeCPU, M5OP_WAKE_CPU, 0);                          \
-    M5OP(m5_exit, M5OP_EXIT, 0);                              \
-    M5OP(m5_fail, M5OP_FAIL, 0);                              \
-    M5OP(m5_initparam, M5OP_INIT_PARAM, 0);                   \
-    M5OP(m5_loadsymbol, M5OP_LOAD_SYMBOL, 0);                 \
-    M5OP(m5_reset_stats, M5OP_RESET_STATS, 0);                \
-    M5OP(m5_dump_stats, M5OP_DUMP_STATS, 0);                  \
-    M5OP(m5_dumpreset_stats, M5OP_DUMP_RESET_STATS, 0);       \
-    M5OP(m5_checkpoint, M5OP_CHECKPOINT, 0);                  \
-    M5OP(m5_readfile, M5OP_READ_FILE, 0);                     \
-    M5OP(m5_writefile, M5OP_WRITE_FILE, 0);                   \
-    M5OP(m5_debugbreak, M5OP_DEBUG_BREAK, 0);                 \
-    M5OP(m5_switchcpu, M5OP_SWITCH_CPU, 0);                   \
-    M5OP(m5_addsymbol, M5OP_ADD_SYMBOL, 0);                   \
-    M5OP(m5_panic, M5OP_PANIC, 0);                            \
-    M5OP(m5_work_begin, M5OP_WORK_BEGIN, 0);                  \
-    M5OP(m5_work_end, M5OP_WORK_END, 0);                      \
-    M5OP(m5_togglesync, M5OP_DIST_TOGGLE_SYNC, 0);
+#define M5OP_FOREACH                                            \
+    M5OP(m5_arm, M5OP_ARM, 0);                                  \
+    M5OP(m5_quiesce, M5OP_QUIESCE, 0);                          \
+    M5OP(m5_quiesce_ns, M5OP_QUIESCE_NS, 0);                    \
+    M5OP(m5_quiesce_cycle, M5OP_QUIESCE_CYCLE, 0);              \
+    M5OP(m5_quiesce_time, M5OP_QUIESCE_TIME, 0);                \
+    M5OP(m5_rpns, M5OP_RPNS, 0);                                \
+    M5OP(m5_wake_cpu, M5OP_WAKE_CPU, 0);                        \
+    M5OP(m5_exit, M5OP_EXIT, 0);                                \
+    M5OP(m5_fail, M5OP_FAIL, 0);                                \
+    M5OP(m5_init_param, M5OP_INIT_PARAM, 0);                    \
+    M5OP(m5_load_symbol, M5OP_LOAD_SYMBOL, 0);                  \
+    M5OP(m5_reset_stats, M5OP_RESET_STATS, 0);                  \
+    M5OP(m5_dump_stats, M5OP_DUMP_STATS, 0);                    \
+    M5OP(m5_dump_reset_stats, M5OP_DUMP_RESET_STATS, 0);        \
+    M5OP(m5_checkpoint, M5OP_CHECKPOINT, 0);                    \
+    M5OP(m5_read_file, M5OP_READ_FILE, 0);                      \
+    M5OP(m5_write_file, M5OP_WRITE_FILE, 0);                    \
+    M5OP(m5_debug_break, M5OP_DEBUG_BREAK, 0);                  \
+    M5OP(m5_switch_cpu, M5OP_SWITCH_CPU, 0);                    \
+    M5OP(m5_add_symbol, M5OP_ADD_SYMBOL, 0);                    \
+    M5OP(m5_panic, M5OP_PANIC, 0);                              \
+    M5OP(m5_work_begin, M5OP_WORK_BEGIN, 0);                    \
+    M5OP(m5_work_end, M5OP_WORK_END, 0);                        \
+    M5OP(m5_dist_togglesync, M5OP_DIST_TOGGLE_SYNC, 0);
 
 #define M5OP_FOREACH_ANNOTATION                      \
     M5_ANNOTATION(m5a_bsm, M5OP_AN_BSM);             \
index bd39041d3f9db8b362f5dfd4f4cd5ed36fec8754..5b6c7a6aa573d7f235ad32d6dc2fdfaf5e56235d 100644 (file)
@@ -117,7 +117,7 @@ read_file(int dest_fid)
     // Linux does demand paging.
     memset(buf, 0, sizeof(buf));
 
-    while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
+    while ((len = m5_read_file(buf, sizeof(buf), offset)) > 0) {
         uint8_t *base = buf;
         offset += len;
         do {
@@ -158,7 +158,7 @@ write_file(const char *filename)
     memset(buf, 0, sizeof(buf));
 
     while ((len = read(src_fid, buf, sizeof(buf))) > 0) {
-        bytes += m5_writefile(buf, len, offset, filename);
+        bytes += m5_write_file(buf, len, offset, filename);
         offset += len;
     }
     fprintf(stderr, "written %d bytes\n", bytes);
@@ -209,7 +209,7 @@ do_dump_reset_stats(int argc, char *argv[])
 {
     uint64_t ints[2];
     parse_int_args(argc, argv, ints, 2);
-    m5_dumpreset_stats(ints[0], ints[1]);
+    m5_dump_reset_stats(ints[0], ints[1]);
 }
 
 void
@@ -265,7 +265,7 @@ do_addsymbol(int argc, char *argv[])
 
     uint64_t addr = strtoul(argv[0], NULL, 0);
     char *symbol = argv[1];
-    m5_addsymbol(addr, symbol);
+    m5_add_symbol(addr, symbol);
 }
 
 
@@ -275,7 +275,7 @@ do_loadsymbol(int argc, char *argv[])
     if (argc > 0)
         usage();
 
-    m5_loadsymbol();
+    m5_load_symbol();
 }
 
 void
@@ -286,7 +286,7 @@ do_initparam(int argc, char *argv[])
 
     uint64_t key_str[2];
     parse_str_args_to_regs(argc, argv, key_str, 2);
-    uint64_t val = m5_initparam(key_str[0], key_str[1]);
+    uint64_t val = m5_init_param(key_str[0], key_str[1]);
     printf("%"PRIu64, val);
 }
 
@@ -296,7 +296,7 @@ do_sw99param(int argc, char *argv[])
     if (argc != 0)
         usage();
 
-    uint64_t param = m5_initparam(0, 0);
+    uint64_t param = m5_init_param(0, 0);
 
     // run-time, rampup-time, rampdown-time, warmup-time, connections
     printf("%"PRId64" %"PRId64" %"PRId64" %"PRId64" %"PRId64,
index f2d85fe97aa97232c34281ab72100846a58c3135..3a507e1643ebf0ac879736710dc0ac7e15aa5fd6 100644 (file)
@@ -38,27 +38,28 @@ extern "C" {
 
 #include <stdint.h>
 
-void arm(uint64_t address);
-void quiesce(void);
-void quiesceNs(uint64_t ns);
-void quiesceCycle(uint64_t cycles);
-uint64_t quiesceTime(void);
-uint64_t rpns();
-void wakeCPU(uint64_t cpuid);
+void m5_arm(uint64_t address);
+void m5_quiesce(void);
+void m5_quiesce_ns(uint64_t ns);
+void m5_quiesce_cycle(uint64_t cycles);
+uint64_t m5_quiesce_time(void);
+uint64_t m5_rpns();
+void m5_wake_cpu(uint64_t cpuid);
 
 void m5_exit(uint64_t ns_delay);
 void m5_fail(uint64_t ns_delay, uint64_t code);
-uint64_t m5_initparam(uint64_t key_str1, uint64_t key_str2);
+uint64_t m5_init_param(uint64_t key_str1, uint64_t key_str2);
 void m5_checkpoint(uint64_t ns_delay, uint64_t ns_period);
 void m5_reset_stats(uint64_t ns_delay, uint64_t ns_period);
 void m5_dump_stats(uint64_t ns_delay, uint64_t ns_period);
-void m5_dumpreset_stats(uint64_t ns_delay, uint64_t ns_period);
-uint64_t m5_readfile(void *buffer, uint64_t len, uint64_t offset);
-uint64_t m5_writefile(void *buffer, uint64_t len, uint64_t offset, const char *filename);
-void m5_debugbreak(void);
-void m5_switchcpu(void);
-void m5_togglesync(void);
-void m5_addsymbol(uint64_t addr, char *symbol);
+void m5_dump_reset_stats(uint64_t ns_delay, uint64_t ns_period);
+uint64_t m5_read_file(void *buffer, uint64_t len, uint64_t offset);
+uint64_t m5_write_file(void *buffer, uint64_t len, uint64_t offset,
+                       const char *filename);
+void m5_debug_break(void);
+void m5_switch_cpu(void);
+void m5_dist_toggle_sync(void);
+void m5_add_symbol(uint64_t addr, char *symbol);
 void m5_loadsymbol();
 void m5_panic(void);
 void m5_work_begin(uint64_t workid, uint64_t threadid);
index 91e1d53536561b27ef650ef1bf0b949109520506..ad88750174be96c6a29a945a5651ed4cebc146eb 100644 (file)
@@ -94,24 +94,24 @@ func:
 
         .set noreorder
 
-SIMPLE_OP(arm, ARM(16))
-SIMPLE_OP(quiesce, QUIESCE)
-SIMPLE_OP(quiesceNs, QUIESCENS(16))
-SIMPLE_OP(quiesceCycle, QUIESCECYC(16))
-SIMPLE_OP(quiesceTime, QUIESCETIME)
-SIMPLE_OP(rpns, RPNS)
-SIMPLE_OP(wakeCPU, WAKE_CPU(16))
+SIMPLE_OP(m5_arm, ARM(16))
+SIMPLE_OP(m5_quiesce, QUIESCE)
+SIMPLE_OP(m5_quiesce_ns, QUIESCENS(16))
+SIMPLE_OP(m5_quiesce_cycle, QUIESCECYC(16))
+SIMPLE_OP(m5_quiesce_time, QUIESCETIME)
+SIMPLE_OP(m5_rpns, RPNS)
+SIMPLE_OP(m5_wake_cpu, WAKE_CPU(16))
 SIMPLE_OP(m5_exit, M5EXIT(16))
-SIMPLE_OP(m5_initparam, INITPARAM(0))
-SIMPLE_OP(m5_loadsymbol, LOADSYMBOL(0))
+SIMPLE_OP(m5_init_param, INITPARAM(0))
+SIMPLE_OP(m5_load_symbol, LOADSYMBOL(0))
 SIMPLE_OP(m5_reset_stats, RESET_STATS(16, 17))
 SIMPLE_OP(m5_dump_stats, DUMP_STATS(16, 17))
-SIMPLE_OP(m5_dumpreset_stats, DUMPRST_STATS(16, 17))
+SIMPLE_OP(m5_dump_reset_stats, DUMPRST_STATS(16, 17))
 SIMPLE_OP(m5_checkpoint, CHECKPOINT(16, 17))
-SIMPLE_OP(m5_readfile, READFILE)
-SIMPLE_OP(m5_debugbreak, DEBUGBREAK)
-SIMPLE_OP(m5_switchcpu, SWITCHCPU)
-SIMPLE_OP(m5_addsymbol, ADDSYMBOL(16, 17))
+SIMPLE_OP(m5_read_file, READFILE)
+SIMPLE_OP(m5_debug_break, DEBUGBREAK)
+SIMPLE_OP(m5_switch_cpu, SWITCHCPU)
+SIMPLE_OP(m5_add_symbol, ADDSYMBOL(16, 17))
 SIMPLE_OP(m5_panic, PANIC)
 
 SIMPLE_OP(m5a_bsm, AN_BSM)
index ba8f6841f3c3f9e3dfcdb664efd124687f2d8df7..1a4f5bb899592e974ca1cc4b5b4942be552df0b5 100644 (file)
@@ -64,51 +64,51 @@ LEAF(m5_panic)
     PANIC
 END(m5_panic)
 
-LEAF(m5_readfile)
+LEAF(m5_read_file)
     retl
     READFILE
-END(m5_readfile)
+END(m5_read_file)
 
-LEAF(m5_debugbreak)
+LEAF(m5_debug_break)
     retl
     DEBUGBREAK
-END(m5_debugbreak)
+END(m5_debug_break)
 
 /* !!!!!! All code below here just panics !!!!!! */
-LEAF(arm)
+LEAF(m5_arm)
     retl
     PANIC
-END(arm)
+END(m5_arm)
 
-LEAF(quiesce)
+LEAF(m5_quiesce)
     retl
     PANIC
-END(quiesce)
+END(m5_quiesce)
 
-LEAF(quiesceNs)
+LEAF(m5_quiesce_ns)
     retl
     PANIC
-END(quiesceNs)
+END(m5_quiesce_ns)
 
-LEAF(quiesceCycle)
+LEAF(m5_quiesce_cycle)
     retl
     PANIC
-END(quiesceCycle)
+END(m5_quiesce_cycle)
 
-LEAF(quiesceTime)
+LEAF(m5_quiesce_time)
     retl
     PANIC
-END(quiesceTime)
+END(m5_quiesce_time)
 
-LEAF(m5_initparam)
+LEAF(m5_init_param)
     retl
     PANIC
-END(m5_initparam)
+END(m5_init_param)
 
-LEAF(m5_loadsymbol)
+LEAF(m5_load_symbol)
     retl
     PANIC
-END(m5_loadsymbol)
+END(m5_load_symbol)
 
 LEAF(m5_reset_stats)
     retl
@@ -120,25 +120,25 @@ LEAF(m5_dump_stats)
     PANIC
 END(m5_dump_stats)
 
-LEAF(m5_dumpreset_stats)
+LEAF(m5_dump_reset_stats)
     retl
     PANIC
-END(m5_dumpreset_stats)
+END(m5_dump_reset_stats)
 
 LEAF(m5_checkpoint)
     retl
     PANIC
 END(m5_checkpoint)
 
-LEAF(m5_switchcpu)
+LEAF(m5_switch_cpu)
     retl
     PANIC
-END(m5_switchcpu)
+END(m5_switch_cpu)
 
-LEAF(m5_addsymbol)
+LEAF(m5_add_symbol)
     retl
     PANIC
-END(m5_addsymbol)
+END(m5_add_symbol)
 
 LEAF(m5_anbegin)
     retl
index c09e51e256dda9ed616e0827d19ca83f35e3df73..6d162932164f52f37d6bdf67ad35372f7705995c 100644 (file)
@@ -61,26 +61,26 @@ name:                                     \
 
 #endif
 
-TWO_BYTE_OP(arm, M5OP_ARM)
-TWO_BYTE_OP(quiesce, M5OP_QUIESCE)
-TWO_BYTE_OP(quiesceNs, M5OP_QUIESCE_NS)
-TWO_BYTE_OP(quiesceCycle, M5OP_QUIESCE_CYCLE)
-TWO_BYTE_OP(quiesceTime, M5OP_QUIESCE_TIME)
-TWO_BYTE_OP(rpns, M5OP_RPNS)
+TWO_BYTE_OP(m5_arm, M5OP_ARM)
+TWO_BYTE_OP(m5_quiesce, M5OP_QUIESCE)
+TWO_BYTE_OP(m5_quiesce_ns, M5OP_QUIESCE_NS)
+TWO_BYTE_OP(m5_quiesce_cycle, M5OP_QUIESCE_CYCLE)
+TWO_BYTE_OP(m5_quiesce_time, M5OP_QUIESCE_TIME)
+TWO_BYTE_OP(m5_rpns, M5OP_RPNS)
 TWO_BYTE_OP(m5_exit, M5OP_EXIT)
 TWO_BYTE_OP(m5_fail, M5OP_FAIL)
-TWO_BYTE_OP(m5_initparam, M5OP_INIT_PARAM)
-TWO_BYTE_OP(m5_loadsymbol, M5OP_LOAD_SYMBOL)
+TWO_BYTE_OP(m5_init_param, M5OP_INIT_PARAM)
+TWO_BYTE_OP(m5_load_symbol, M5OP_LOAD_SYMBOL)
 TWO_BYTE_OP(m5_reset_stats, M5OP_RESET_STATS)
 TWO_BYTE_OP(m5_dump_stats, M5OP_DUMP_STATS)
-TWO_BYTE_OP(m5_dumpreset_stats, M5OP_DUMP_RESET_STATS)
+TWO_BYTE_OP(m5_dump_reset_stats, M5OP_DUMP_RESET_STATS)
 TWO_BYTE_OP(m5_checkpoint, M5OP_CHECKPOINT)
-TWO_BYTE_OP(m5_readfile, M5OP_READ_FILE)
-TWO_BYTE_OP(m5_writefile, M5OP_WRITE_FILE)
-TWO_BYTE_OP(m5_debugbreak, M5OP_DEBUG_BREAK)
-TWO_BYTE_OP(m5_switchcpu, M5OP_SWITCH_CPU)
-TWO_BYTE_OP(m5_addsymbol, M5OP_ADD_SYMBOL)
+TWO_BYTE_OP(m5_read_file, M5OP_READ_FILE)
+TWO_BYTE_OP(m5_write_file, M5OP_WRITE_FILE)
+TWO_BYTE_OP(m5_debug_break, M5OP_DEBUG_BREAK)
+TWO_BYTE_OP(m5_switch_cpu, M5OP_SWITCH_CPU)
+TWO_BYTE_OP(m5_add_symbol, M5OP_ADD_SYMBOL)
 TWO_BYTE_OP(m5_panic, M5OP_PANIC)
 TWO_BYTE_OP(m5_work_begin, M5OP_WORK_BEGIN)
 TWO_BYTE_OP(m5_work_end, M5OP_WORK_END)
-TWO_BYTE_OP(m5_togglesync, M5OP_DIST_TOGGLE_SYNC)
+TWO_BYTE_OP(m5_dist_toggle_sync, M5OP_DIST_TOGGLE_SYNC)