@@ -76,6 +76,7 @@ void tcg_gen_lookup_and_goto_ptr(void);
void tcg_gen_plugin_cb(unsigned from);
void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo);
+void tcg_gen_plugin_pc(TCGv_ptr);
/* 32 bit ops */
@@ -199,6 +199,7 @@ DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END)
DEF(plugin_cb, 0, 0, 1, TCG_OPF_NOT_PRESENT)
DEF(plugin_mem_cb, 0, 1, 1, TCG_OPF_NOT_PRESENT)
+DEF(plugin_pc, 1, 0, 0, TCG_OPF_NOT_PRESENT)
/* Replicate ld/st ops for 32 and 64-bit guest addresses. */
DEF(qemu_ld_a32_i32, 1, 1, 1,
@@ -322,6 +322,11 @@ void tcg_gen_plugin_mem_cb(TCGv_i64 addr, unsigned meminfo)
tcg_gen_op2(INDEX_op_plugin_mem_cb, tcgv_i64_arg(addr), meminfo);
}
+void tcg_gen_plugin_pc(TCGv_ptr arg)
+{
+ tcg_gen_op1(INDEX_op_plugin_pc, tcgv_ptr_arg(arg));
+}
+
/* 32 bit ops */
void tcg_gen_discard_i32(TCGv_i32 arg)
@@ -4689,6 +4689,13 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op)
}
}
+static void tcg_reg_alloc_plugin_pc(TCGContext *s, const TCGOp *op)
+{
+ tcg_reg_alloc_do_movi(s, arg_temp(op->args[0]),
+ (uintptr_t)tcg_splitwx_to_rx(s->code_ptr),
+ op->life, output_pref(op, 0));
+}
+
/*
* Specialized code generation for INDEX_op_dup_vec.
*/
@@ -6196,6 +6203,9 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
case INDEX_op_mov_vec:
tcg_reg_alloc_mov(s, op);
break;
+ case INDEX_op_plugin_pc:
+ tcg_reg_alloc_plugin_pc(s, op);
+ break;
case INDEX_op_dup_vec:
tcg_reg_alloc_dup(s, op);
break;