]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
Move GETPC from dyngen-exec.h to exec-all.h
authorBlue Swirl <blauwirbel@gmail.com>
Wed, 21 Sep 2011 18:13:16 +0000 (18:13 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 1 Oct 2011 09:31:43 +0000 (09:31 +0000)
GETPC() can be used even from outside of helper code. Move the macro to
a more accessible location. Avoid a compile warning from redefining it in exec.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
dyngen-exec.h
exec-all.h
exec.c

index 8beb7f33447cea9fe71d54b2d753d26b4900a209..fbde29ea014edc990c308c6ee615ac7f9726b9e5 100644 (file)
 
 register CPUState *env asm(AREG0);
 
-/* The return address may point to the start of the next instruction.
-   Subtracting one gets us the call instruction itself.  */
-#if defined(__s390__) && !defined(__s390x__)
-# 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.
-   This is still safe in ARM mode because instructions are 4 bytes.  */
-# define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 2))
-#else
-# define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1))
-#endif
-
 #endif /* !defined(__DYNGEN_EXEC_H__) */
index b1dfe109d238ced1a3e0cb150b1cb2b9decbf962..1120f84661f5aca354c949b0b29353ff7935272d 100644 (file)
@@ -267,6 +267,18 @@ extern spinlock_t tb_lock;
 
 extern int tb_invalidated_flag;
 
+/* The return address may point to the start of the next instruction.
+   Subtracting one gets us the call instruction itself.  */
+#if defined(__s390__) && !defined(__s390x__)
+# 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.
+   This is still safe in ARM mode because instructions are 4 bytes.  */
+# define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 2))
+#else
+# define GETPC() ((void *)((unsigned long)__builtin_return_address(0) - 1))
+#endif
+
 #if !defined(CONFIG_USER_ONLY)
 
 extern CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
diff --git a/exec.c b/exec.c
index 1e6f732d1d2549d957ac42a6f2bf4d6b6c72551b..d0cbf1582297b403936035e953a01462e0ccd21c 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -4763,6 +4763,7 @@ void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
 }
 
 #define MMUSUFFIX _cmmu
+#undef GETPC
 #define GETPC() NULL
 #define env cpu_single_env
 #define SOFTMMU_CODE_ACCESS