]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
exec/user: Do not include 'cpu.h' in 'abitypes.h'
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 5 Dec 2023 21:45:37 +0000 (22:45 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 26 Apr 2024 15:03:05 +0000 (17:03 +0200)
"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é <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20231212123401.37493-20-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
include/exec/user/abitypes.h

index 731f345ff5068bb9de6a95e01e873b32d2946256..3ec1969368743e38e7f23e08e9b6773886920c34 100644 (file)
@@ -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