summaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-07-26 06:09:16 +0530
committerRichard Henderson <rth@twiddle.net>2016-09-16 08:12:11 -0700
commit01ecaf438b1eb46abe23392c8ce5b7628b0c8cf5 (patch)
tree8d5d6d640cb0994345a508213f716b08708b171e /include/exec
parent85aa80813dd9f5c1f581c743e45678a3bee220f8 (diff)
downloadqemu-01ecaf438b1eb46abe23392c8ce5b7628b0c8cf5.zip
tcg: Merge GETPC and GETRA
The return address argument to the softmmu template helpers was confused. In the legacy case, we wanted to indicate that there is no return address, and so passed in NULL. However, we then immediately subtracted GETPC_ADJ from NULL, resulting in a non-zero value, indicating the presence of an (invalid) return address. Push the GETPC_ADJ subtraction down to the only point it's required: immediately before use within cpu_restore_state_from_tb, after all NULL pointer checks have been completed. This makes GETPC and GETRA identical. Remove GETRA as the lesser used macro, replacing all uses with GETPC. Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/exec-all.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index a0e87be88f..008e09a3c1 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -349,13 +349,12 @@ static inline void tb_add_jump(TranslationBlock *tb, int n,
tb_next->jmp_list_first = (uintptr_t)tb | n;
}
-/* GETRA is the true target of the return instruction that we'll execute,
- defined here for simplicity of defining the follow-up macros. */
+/* GETPC is the true target of the return instruction that we'll execute. */
#if defined(CONFIG_TCG_INTERPRETER)
extern uintptr_t tci_tb_ptr;
-# define GETRA() tci_tb_ptr
+# define GETPC() tci_tb_ptr
#else
-# define GETRA() \
+# define GETPC() \
((uintptr_t)__builtin_extract_return_addr(__builtin_return_address(0)))
#endif
@@ -368,8 +367,6 @@ extern uintptr_t tci_tb_ptr;
smaller than 4 bytes, so we don't worry about special-casing this. */
#define GETPC_ADJ 2
-#define GETPC() (GETRA() - GETPC_ADJ)
-
#if !defined(CONFIG_USER_ONLY)
struct MemoryRegion *iotlb_to_region(CPUState *cpu,