Files
qemu/include/accel/tcg/getpc.h
Philippe Mathieu-Daudé 1eaae985d4 accel/tcg: Restrict headers being TCG specific
Forbid including TCG-specific headers in non-TCG builds.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-12-philmd@oss.qualcomm.com>
2026-06-18 14:27:21 +02:00

25 lines
571 B
C

/*
* Get host pc for helper unwinding.
*
* Copyright (c) 2003 Fabrice Bellard
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef ACCEL_TCG_GETPC_H
#define ACCEL_TCG_GETPC_H
#ifndef CONFIG_TCG
#error Can only include this header with TCG
#endif
/* GETPC is the true target of the return instruction that we'll execute. */
#ifdef CONFIG_TCG_INTERPRETER
extern __thread uintptr_t tci_tb_ptr;
# define GETPC() tci_tb_ptr
#else
# define GETPC() \
((uintptr_t)__builtin_extract_return_addr(__builtin_return_address(0)))
#endif
#endif /* ACCEL_TCG_GETPC_H */