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>
Philippe Mathieu-Daudé committed
Jun 16, 2026 at 13:58 UTC
1eaae985d4dec2aa0b187e362db50be46968d117
6 files changed
+24
include/accel/tcg/cpu-mmu-index.h
+4
@@ -9,6 +9,10 @@
9
#ifndef ACCEL_TCG_CPU_MMU_INDEX_H
10
#define ACCEL_TCG_CPU_MMU_INDEX_H
11
12
+#ifndef CONFIG_TCG
13
+#error Can only include this header with TCG
14
+#endif
15
+
16
#include "hw/core/cpu.h"
17
#include "accel/tcg/cpu-ops.h"
18
#include "tcg/debug-assert.h"
include/accel/tcg/cpu-ops.h
+4
@@ -10,6 +10,10 @@
10
#ifndef TCG_CPU_OPS_H
11
#define TCG_CPU_OPS_H
12
13
+#ifndef CONFIG_TCG
14
+#error Can only include this header with TCG
15
+#endif
16
+
17
#include "exec/breakpoint.h"
18
#include "exec/hwaddr.h"
19
#include "exec/memattrs.h"
include/accel/tcg/getpc.h
+4
@@ -8,6 +8,10 @@
8
#ifndef ACCEL_TCG_GETPC_H
9
#define ACCEL_TCG_GETPC_H
10
11
+#ifndef CONFIG_TCG
12
+#error Can only include this header with TCG
13
+#endif
14
+
15
/* GETPC is the true target of the return instruction that we'll execute. */
16
#ifdef CONFIG_TCG_INTERPRETER
17
extern __thread uintptr_t tci_tb_ptr;
include/accel/tcg/helper-retaddr.h
+4
@@ -6,6 +6,10 @@
6
#ifndef ACCEL_TCG_HELPER_RETADDR_H
7
#define ACCEL_TCG_HELPER_RETADDR_H
8
9
+#ifndef CONFIG_TCG
10
+#error Can only include this header with TCG
11
+#endif
12
+
13
/*
14
* For user-only, helpers that use guest to host address translation
15
* must protect the actual host memory access by recording 'retaddr'
include/accel/tcg/probe.h
+4
@@ -7,6 +7,10 @@
7
#ifndef ACCEL_TCG_PROBE_H
8
#define ACCEL_TCG_PROBE_H
9
10
+#ifndef CONFIG_TCG
11
+#error Can only include this header with TCG
12
+#endif
13
+
14
#include "exec/mmu-access-type.h"
15
#include "exec/vaddr.h"
16
include/accel/tcg/tb-cpu-state.h
+4
@@ -6,6 +6,10 @@
6
#ifndef EXEC_TB_CPU_STATE_H
7
#define EXEC_TB_CPU_STATE_H
8
9
+#ifndef CONFIG_TCG
10
+#error Can only include this header with TCG
11
+#endif
12
+
13
#include "exec/vaddr.h"
14
15
typedef struct TCGTBCPUState {