[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/24] exec/user: Do not include 'cpu.h' in 'abitypes.h'
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 19/24] exec/user: Do not include 'cpu.h' in 'abitypes.h' |
Date: |
Mon, 11 Dec 2023 22:19:56 +0100 |
First, "exec/user/abitypes.h" is missing the following
includes (they are included by "cpu.h"):
- "exec/target_long.h"
- "exec/cpu-all.h"
- "exec/tswap.h"
Second, it only requires the definitions from "cpu-param.h",
not the huge "cpu.h".
In order to avoid "cpu.h", pick the minimum required headers.
Assert this user-specific header is only included from user
emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/user/abitypes.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index 6178453d94..1a8cd1ac74 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -1,7 +1,14 @@
#ifndef EXEC_USER_ABITYPES_H
#define EXEC_USER_ABITYPES_H
-#include "cpu.h"
+#ifndef CONFIG_USER_ONLY
+#error Cannot include this header from system emulation
+#endif
+
+#include "cpu-param.h"
+#include "exec/target_long.h"
+#include "exec/cpu-all.h"
+#include "exec/tswap.h"
#ifdef TARGET_ABI32
#define TARGET_ABI_BITS 32
--
2.41.0
- [PATCH 14/24] gdbstub: Include missing 'hw/core/cpu.h' header, (continued)
- [PATCH 14/24] gdbstub: Include missing 'hw/core/cpu.h' header, Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 15/24] exec/cpu-all: Remove unused headers, Philippe Mathieu-Daudé, 2023/12/11
- Re: [PATCH 00/24] exec: Rework of various headers (user focused), Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 16/24] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion, Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 17/24] target/ppc/excp_helper: Avoid 'abi_ptr' in system emulation, Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 18/24] accel/tcg: Un-inline retaddr helpers to 'user-retaddr.h', Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 19/24] exec/user: Do not include 'cpu.h' in 'abitypes.h',
Philippe Mathieu-Daudé <=
- [PATCH 20/24] exec: Declare abi_ptr type in its own 'tcg/abi_ptr.h' header, Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 21/24] exec/cpu_ldst: Avoid including 'cpu.h', Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 22/24] exec/cpu-all: Restrict inclusion of 'exec/user/guest-base.h', Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 23/24] exec/cpu-all: Extract page-protection definitions to page-prot-common.h, Philippe Mathieu-Daudé, 2023/12/11
- [PATCH 24/24] target: Restrict 'sysemu/reset.h' to system emulation, Philippe Mathieu-Daudé, 2023/12/11