Subject: [PATCH 3/5] tci: support GETPC() for SOFTMMU --- dyngen-exec.h | 5 ++++- tcg/tci.c | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dyngen-exec.h b/dyngen-exec.h index d5620ca..ba213c4 100644 --- a/dyngen-exec.h +++ b/dyngen-exec.h @@ -119,7 +119,10 @@ extern int printf(const char *, ...); /* The return address may point to the start of the next instruction. Subtracting one gets us the call instruction itself. */ -#if defined(__s390__) +#if defined(CONFIG_TCG_INTERPRETER) +extern uint8_t * tci_tb_ptr; +# define GETPC() ((void *)tci_tb_ptr) +#elif defined(__s390__) # define GETPC() ((void*)(((unsigned long)__builtin_return_address(0) & 0x7fffffffUL) - 1)) #elif defined(__arm__) /* Thumb return addresses have the low bit set, so we need to subtract two. diff --git a/tcg/tci.c b/tcg/tci.c index 8bb78e3..0ba605b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -50,6 +50,10 @@ struct CPUX86State *env; #error Target support missing, please fix! #endif +#ifdef CONFIG_SOFTMMU +uint8_t * tci_tb_ptr; +#endif + static tcg_target_ulong tci_reg[TCG_TARGET_NB_REGS]; static tcg_target_ulong tci_read_reg(uint32_t index) @@ -380,6 +384,9 @@ unsigned long tcg_qemu_tb_exec(uint8_t *tb_ptr) tci_reg[TCG_AREG0] = (tcg_target_ulong)env; for (;;) { +#ifdef CONFIG_SOFTMMU + tci_tb_ptr=tb_ptr; +#endif uint8_t opc = *(uint8_t *)tb_ptr++; tcg_target_ulong t0; tcg_target_ulong t1; -- 1.6.3.msysgit.0