caveat/ecall.c: refactor proxy ecall
[cavatools.git] / caveat / ecall.h
index e0cc738fa42d8b9a69d107ab96ebfe8c38da2fcc..a5aed4cb9ca1d3b36fbee8fa0b2492402f3c3829 100644 (file)
@@ -21,7 +21,7 @@ ecall_entry(long id) {
 }
 
 static inline long
-ecall_idargs(struct core_t const *cpu, long arguments[6]) {
+ecall_fetch(struct core_t const *cpu, long arguments[6]) {
     arguments[0] = cpu->reg[10].l;
     arguments[1] = cpu->reg[11].l;
     arguments[2] = cpu->reg[12].l;
@@ -31,3 +31,14 @@ ecall_idargs(struct core_t const *cpu, long arguments[6]) {
 
     return cpu->reg[17].l;
 }
+
+static inline void
+ecall_store(long const arguments[6], struct core_t *cpu)
+{
+    cpu->reg[10].l = arguments[0];
+    cpu->reg[11].l = arguments[1];
+    cpu->reg[12].l = arguments[2];
+    cpu->reg[13].l = arguments[3];
+    cpu->reg[14].l = arguments[4];
+    cpu->reg[15].l = arguments[5];
+}