From: Philippe Mathieu-Daudé Date: Tue, 5 Dec 2023 21:45:37 +0000 (+0100) Subject: exec/user: Do not include 'cpu.h' in 'abitypes.h' X-Git-Tag: v9.1.0-rc0~133^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d25ddb3f543dda8189b19dafd0b9a972c331fade;p=thirdparty%2Fqemu.git exec/user: Do not include 'cpu.h' in 'abitypes.h' "exec/user/abitypes.h" requires: - "exec/cpu-defs.h" (TARGET_LONG_BITS) - "exec/tswap.h" (tswap32) 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é Reviewed-by: Thomas Huth Message-Id: <20231212123401.37493-20-philmd@linaro.org> Reviewed-by: Richard Henderson --- diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h index 731f345ff50..3ec19693687 100644 --- a/include/exec/user/abitypes.h +++ b/include/exec/user/abitypes.h @@ -1,7 +1,12 @@ #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 "exec/cpu-defs.h" +#include "exec/tswap.h" #include "user/tswap-target.h" #ifdef TARGET_ABI32