]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: move target_flat.h to target subdirs
authorMike Frysinger <vapier@gentoo.org>
Sun, 29 Jan 2023 00:46:25 +0000 (19:46 -0500)
committerLaurent Vivier <laurent@vivier.eu>
Fri, 3 Feb 2023 21:55:12 +0000 (22:55 +0100)
This makes target_flat.h behave like every other target_xxx.h header.
It also makes it actually work -- while the current header says adding
a header to the target subdir overrides the common one, it doesn't.
This is for two reasons:
* meson.build adds -Ilinux-user before -Ilinux-user/$arch
* the compiler search path for "target_flat.h" looks in the same dir
  as the source file before searching -I paths.

This can be seen with the xtensa port -- the subdir settings aren't
used which breaks stack setup.

Move it to the generic/ subdir and add include stubs like every
other target_xxx.h header is handled.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230129004625.11228-1-vapier@gentoo.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/aarch64/target_flat.h [new file with mode: 0644]
linux-user/arm/target_flat.h [new file with mode: 0644]
linux-user/generic/target_flat.h [new file with mode: 0644]
linux-user/m68k/target_flat.h [new file with mode: 0644]
linux-user/microblaze/target_flat.h [new file with mode: 0644]
linux-user/sh4/target_flat.h [new file with mode: 0644]
linux-user/target_flat.h [deleted file]

diff --git a/linux-user/aarch64/target_flat.h b/linux-user/aarch64/target_flat.h
new file mode 100644 (file)
index 0000000..bc83224
--- /dev/null
@@ -0,0 +1 @@
+#include "../generic/target_flat.h"
diff --git a/linux-user/arm/target_flat.h b/linux-user/arm/target_flat.h
new file mode 100644 (file)
index 0000000..bc83224
--- /dev/null
@@ -0,0 +1 @@
+#include "../generic/target_flat.h"
diff --git a/linux-user/generic/target_flat.h b/linux-user/generic/target_flat.h
new file mode 100644 (file)
index 0000000..8fe189e
--- /dev/null
@@ -0,0 +1,16 @@
+/* If your arch needs to do custom stuff, create your own target_flat.h
+ * header file in linux-user/<your arch>/
+ */
+
+#ifndef LINUX_USER_TARGET_FLAT_H
+#define LINUX_USER_TARGET_FLAT_H
+
+#define flat_argvp_envp_on_stack()                           1
+#define flat_reloc_valid(reloc, size)                        ((reloc) <= (size))
+#define flat_old_ram_flag(flag)                              (flag)
+#define flat_get_relocate_addr(relval)                       (relval)
+#define flat_get_addr_from_rp(rp, relval, flags, persistent) (rp)
+#define flat_set_persistent(relval, persistent)              (*persistent)
+#define flat_put_addr_at_rp(rp, addr, relval)                put_user_ual(addr, rp)
+
+#endif
diff --git a/linux-user/m68k/target_flat.h b/linux-user/m68k/target_flat.h
new file mode 100644 (file)
index 0000000..bc83224
--- /dev/null
@@ -0,0 +1 @@
+#include "../generic/target_flat.h"
diff --git a/linux-user/microblaze/target_flat.h b/linux-user/microblaze/target_flat.h
new file mode 100644 (file)
index 0000000..bc83224
--- /dev/null
@@ -0,0 +1 @@
+#include "../generic/target_flat.h"
diff --git a/linux-user/sh4/target_flat.h b/linux-user/sh4/target_flat.h
new file mode 100644 (file)
index 0000000..bc83224
--- /dev/null
@@ -0,0 +1 @@
+#include "../generic/target_flat.h"
diff --git a/linux-user/target_flat.h b/linux-user/target_flat.h
deleted file mode 100644 (file)
index 8fe189e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/* If your arch needs to do custom stuff, create your own target_flat.h
- * header file in linux-user/<your arch>/
- */
-
-#ifndef LINUX_USER_TARGET_FLAT_H
-#define LINUX_USER_TARGET_FLAT_H
-
-#define flat_argvp_envp_on_stack()                           1
-#define flat_reloc_valid(reloc, size)                        ((reloc) <= (size))
-#define flat_old_ram_flag(flag)                              (flag)
-#define flat_get_relocate_addr(relval)                       (relval)
-#define flat_get_addr_from_rp(rp, relval, flags, persistent) (rp)
-#define flat_set_persistent(relval, persistent)              (*persistent)
-#define flat_put_addr_at_rp(rp, addr, relval)                put_user_ual(addr, rp)
-
-#endif