/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "any";
+}
#ifndef AARCH64_TARGET_ELF_H
#define AARCH64_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "any";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "ev67";
+}
#ifndef ALPHA_TARGET_ELF_H
#define ALPHA_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "ev67";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "any";
+}
#ifndef ARM_TARGET_ELF_H
#define ARM_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "any";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ static char buf[32];
+ int err;
+
+ /* For now, treat anything newer than v5 as a v73 */
+ /* FIXME - Disable instructions that are newer than the specified arch */
+ if (eflags == 0x04 || /* v5 */
+ eflags == 0x05 || /* v55 */
+ eflags == 0x60 || /* v60 */
+ eflags == 0x61 || /* v61 */
+ eflags == 0x62 || /* v62 */
+ eflags == 0x65 || /* v65 */
+ eflags == 0x66 || /* v66 */
+ eflags == 0x67 || /* v67 */
+ eflags == 0x8067 || /* v67t */
+ eflags == 0x68 || /* v68 */
+ eflags == 0x69 || /* v69 */
+ eflags == 0x71 || /* v71 */
+ eflags == 0x8071 || /* v71t */
+ eflags == 0x73 /* v73 */
+ ) {
+ return "v73";
+ }
+
+ err = snprintf(buf, sizeof(buf), "unknown (0x%x)", eflags);
+ return err >= 0 && err < sizeof(buf) ? buf : "unknown";
+}
#ifndef HEXAGON_TARGET_ELF_H
#define HEXAGON_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- static char buf[32];
- int err;
-
- /* For now, treat anything newer than v5 as a v73 */
- /* FIXME - Disable instructions that are newer than the specified arch */
- if (eflags == 0x04 || /* v5 */
- eflags == 0x05 || /* v55 */
- eflags == 0x60 || /* v60 */
- eflags == 0x61 || /* v61 */
- eflags == 0x62 || /* v62 */
- eflags == 0x65 || /* v65 */
- eflags == 0x66 || /* v66 */
- eflags == 0x67 || /* v67 */
- eflags == 0x8067 || /* v67t */
- eflags == 0x68 || /* v68 */
- eflags == 0x69 || /* v69 */
- eflags == 0x71 || /* v71 */
- eflags == 0x8071 || /* v71t */
- eflags == 0x73 /* v73 */
- ) {
- return "v73";
- }
-
- err = snprintf(buf, sizeof(buf), "unknown (0x%x)", eflags);
- return err >= 0 && err < sizeof(buf) ? buf : "unknown";
-}
-
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "hppa";
+}
#ifndef HPPA_TARGET_ELF_H
#define HPPA_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "hppa";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "max";
+}
#ifndef I386_TARGET_ELF_H
#define I386_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "max";
-}
+
#endif
extern unsigned long guest_stack_size;
+/* Note that Elf32 and Elf64 use uint32_t for e_flags. */
+const char *get_elf_cpu_model(uint32_t eflags);
+
#if defined(TARGET_S390X) || defined(TARGET_AARCH64) || defined(TARGET_ARM)
uint32_t get_elf_hwcap(void);
const char *elf_hwcap_str(uint32_t bit);
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "la464";
+}
#ifndef LOONGARCH_TARGET_ELF_H
#define LOONGARCH_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "la464";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+#include "elf.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ if (eflags == 0 || (eflags & EF_M68K_M68000)) {
+ /* 680x0 */
+ return "m68040";
+ }
+
+ /* Coldfire */
+ return "any";
+}
#ifndef M68K_TARGET_ELF_H
#define M68K_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- if (eflags == 0 || (eflags & EF_M68K_M68000)) {
- /* 680x0 */
- return "m68040";
- }
- /* Coldfire */
- return "any";
-}
#endif
#include "qemu/guest-random.h"
#include "elf.h"
#include "trace/control.h"
-#include "target_elf.h"
#include "user/cpu_loop.h"
#include "crypto/init.h"
#include "fd-trans.h"
}
if (cpu_model == NULL) {
- cpu_model = cpu_get_model(get_elf_eflags(execfd));
+ cpu_model = get_elf_cpu_model(get_elf_eflags(execfd));
}
cpu_type = parse_cpu_option(cpu_model);
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "any";
+}
#ifndef MICROBLAZE_TARGET_ELF_H
#define MICROBLAZE_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "any";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+#include "elf.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+#ifdef TARGET_MIPS64
+ switch (eflags & EF_MIPS_MACH) {
+ case EF_MIPS_MACH_OCTEON:
+ case EF_MIPS_MACH_OCTEON2:
+ case EF_MIPS_MACH_OCTEON3:
+ return "Octeon68XX";
+ case EF_MIPS_MACH_LS2E:
+ return "Loongson-2E";
+ case EF_MIPS_MACH_LS2F:
+ return "Loongson-2F";
+ case EF_MIPS_MACH_LS3A:
+ return "Loongson-3A1000";
+ default:
+ break;
+ }
+ switch (eflags & EF_MIPS_ARCH) {
+ case EF_MIPS_ARCH_64R6:
+ return "I6400";
+ case EF_MIPS_ARCH_64R2:
+ return "MIPS64R2-generic";
+ default:
+ break;
+ }
+ return "5KEf";
+#else
+ if ((eflags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6) {
+ return "mips32r6-generic";
+ }
+ if (eflags & EF_MIPS_NAN2008) {
+ return "P5600";
+ }
+ return "24Kf";
+#endif
+}
#ifndef MIPS_TARGET_ELF_H
#define MIPS_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- if ((eflags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6) {
- return "mips32r6-generic";
- }
- if (eflags & EF_MIPS_NAN2008) {
- return "P5600";
- }
- return "24Kf";
-}
+
#endif
#ifndef MIPS64_TARGET_ELF_H
#define MIPS64_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- switch (eflags & EF_MIPS_MACH) {
- case EF_MIPS_MACH_OCTEON:
- case EF_MIPS_MACH_OCTEON2:
- case EF_MIPS_MACH_OCTEON3:
- return "Octeon68XX";
- case EF_MIPS_MACH_LS2E:
- return "Loongson-2E";
- case EF_MIPS_MACH_LS2F:
- return "Loongson-2F";
- case EF_MIPS_MACH_LS3A:
- return "Loongson-3A1000";
- default:
- break;
- }
- switch (eflags & EF_MIPS_ARCH) {
- case EF_MIPS_ARCH_64R6:
- return "I6400";
- case EF_MIPS_ARCH_64R2:
- return "MIPS64R2-generic";
- default:
- break;
- }
- return "5KEf";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "any";
+}
#ifndef OPENRISC_TARGET_ELF_H
#define OPENRISC_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "any";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+#ifdef TARGET_PPC64
+ return "POWER9";
+#else
+ return "750";
+#endif
+}
#ifndef PPC_TARGET_ELF_H
#define PPC_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
-#ifdef TARGET_PPC64
- return "POWER9";
-#else
- return "750";
-#endif
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "max";
+}
#ifndef RISCV_TARGET_ELF_H
#define RISCV_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "max";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "qemu";
+}
#ifndef S390X_TARGET_ELF_H
#define S390X_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "qemu";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "sh7785";
+}
#ifndef SH4_TARGET_ELF_H
#define SH4_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "sh7785";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+#ifdef TARGET_SPARC64
+ return "TI UltraSparc II";
+#else
+ return "Fujitsu MB86904";
+#endif
+}
#ifndef SPARC_TARGET_ELF_H
#define SPARC_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
-#ifdef TARGET_SPARC64
- return "TI UltraSparc II";
-#else
- return "Fujitsu MB86904";
-#endif
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return "max";
+}
#ifndef X86_64_TARGET_ELF_H
#define X86_64_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return "max";
-}
+
#endif
/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "qemu/osdep.h"
+#include "qemu.h"
+#include "loader.h"
+
+
+const char *get_elf_cpu_model(uint32_t eflags)
+{
+ return XTENSA_DEFAULT_CPU_MODEL;
+}
#ifndef XTENSA_TARGET_ELF_H
#define XTENSA_TARGET_ELF_H
-static inline const char *cpu_get_model(uint32_t eflags)
-{
- return XTENSA_DEFAULT_CPU_MODEL;
-}
-
#endif