util: Fix incorrect return type in m5 writefile
[gem5.git] / util / m5 / m5op_x86.S
index e85051d980fae5feb073ff200be1da69e1865d95..f38803a253d7cda78cf25d9d9b4ad3d5cd17c41f 100644 (file)
 
 #include "m5ops.h"
 
+#ifdef M5OP_ADDR
+/* Use the memory mapped m5op interface */
+#define TWO_BYTE_OP(name, number)         \
+        .globl name;                      \
+        .func name;                       \
+name:                                     \
+        mov m5_mem, %r11;                 \
+        mov $number, %rax;                \
+        shl $8, %rax;                     \
+        mov 0(%r11, %rax, 1), %rax;       \
+        ret;                              \
+        .endfunc;
+
+#else
+/* Use the magic instruction based m5op interface. This does not work
+ * in virtualized environments.
+ */
+
 #define TWO_BYTE_OP(name, number)         \
         .globl name;                      \
         .func name;                       \
@@ -41,6 +59,8 @@ name:                                     \
         ret;                              \
         .endfunc;
 
+#endif
+
 TWO_BYTE_OP(arm, arm_func)
 TWO_BYTE_OP(quiesce, quiesce_func)
 TWO_BYTE_OP(quiesceNs, quiescens_func)
@@ -48,6 +68,7 @@ TWO_BYTE_OP(quiesceCycle, quiescecycle_func)
 TWO_BYTE_OP(quiesceTime, quiescetime_func)
 TWO_BYTE_OP(rpns, rpns_func)
 TWO_BYTE_OP(m5_exit, exit_func)
+TWO_BYTE_OP(m5_fail, fail_func)
 TWO_BYTE_OP(m5_initparam, initparam_func)
 TWO_BYTE_OP(m5_loadsymbol, loadsymbol_func)
 TWO_BYTE_OP(m5_reset_stats, resetstats_func)
@@ -55,12 +76,11 @@ TWO_BYTE_OP(m5_dump_stats, dumpstats_func)
 TWO_BYTE_OP(m5_dumpreset_stats, dumprststats_func)
 TWO_BYTE_OP(m5_checkpoint, ckpt_func)
 TWO_BYTE_OP(m5_readfile, readfile_func)
+TWO_BYTE_OP(m5_writefile, writefile_func)
 TWO_BYTE_OP(m5_debugbreak, debugbreak_func)
 TWO_BYTE_OP(m5_switchcpu, switchcpu_func)
 TWO_BYTE_OP(m5_addsymbol, addsymbol_func)
 TWO_BYTE_OP(m5_panic, panic_func)
-TWO_BYTE_OP(m5_reserved1_func, reserved1_func)
-TWO_BYTE_OP(m5_reserved2_func, reserved2_func)
-TWO_BYTE_OP(m5_reserved3_func, reserved3_func)
-TWO_BYTE_OP(m5_reserved4_func, reserved4_func)
-TWO_BYTE_OP(m5_reserved5_func, reserved5_func)
+TWO_BYTE_OP(m5_work_begin, work_begin_func)
+TWO_BYTE_OP(m5_work_end, work_end_func)
+TWO_BYTE_OP(m5_togglesync, togglesync_func)