From 542ca4349878a2ea3818aea5c448a6db567da3ae Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 20 Feb 2018 18:33:04 +0100 Subject: linux-user: Move CPU type name selection to a function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of a sequence of "#if ... #endif" move the selection to a function in linux-user/*/target_elf.h We can't add them in linux-user/*/target_cpu.h because we will need to include "elf.h" to use ELF flags with eflags, and including "elf.h" in "target_cpu.h" introduces some conflicts in elfload.c Suggested-by: Richard Henderson Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20180220173307.25125-2-laurent@vivier.eu> --- linux-user/ppc/target_elf.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 linux-user/ppc/target_elf.h (limited to 'linux-user/ppc') diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h new file mode 100644 index 0000000000..576a5b9959 --- /dev/null +++ b/linux-user/ppc/target_elf.h @@ -0,0 +1,18 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef PPC_TARGET_ELF_H +#define PPC_TARGET_ELF_H +static inline const char *cpu_get_model(uint32_t eflags) +{ +#ifdef TARGET_PPC64 + return "POWER8"; +#else + return "750"; +#endif +} +#endif -- cgit v1.2.3