xref: /openbmc/qemu/linux-user/mips64/target_elf.h (revision 76277cf82f0e1123bd69ec59d22014b8f78485ec)
1542ca434SLaurent Vivier /*
2542ca434SLaurent Vivier  * This program is free software; you can redistribute it and/or modify
3542ca434SLaurent Vivier  * it under the terms of the GNU General Public License version 2 as
4542ca434SLaurent Vivier  * published by the Free Software Foundation, or (at your option) any
5542ca434SLaurent Vivier  * later version. See the COPYING file in the top-level directory.
6542ca434SLaurent Vivier  */
7542ca434SLaurent Vivier 
8542ca434SLaurent Vivier #ifndef MIPS64_TARGET_ELF_H
9542ca434SLaurent Vivier #define MIPS64_TARGET_ELF_H
cpu_get_model(uint32_t eflags)10542ca434SLaurent Vivier static inline const char *cpu_get_model(uint32_t eflags)
11542ca434SLaurent Vivier {
121e5a7c57SPhilippe Mathieu-Daudé     switch (eflags & EF_MIPS_MACH) {
131e5a7c57SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_OCTEON:
141e5a7c57SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_OCTEON2:
151e5a7c57SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_OCTEON3:
161e5a7c57SPhilippe Mathieu-Daudé         return "Octeon68XX";
17*e922abf5SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_LS2E:
18*e922abf5SPhilippe Mathieu-Daudé         return "Loongson-2E";
19*e922abf5SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_LS2F:
20*e922abf5SPhilippe Mathieu-Daudé         return "Loongson-2F";
21*e922abf5SPhilippe Mathieu-Daudé     case EF_MIPS_MACH_LS3A:
22*e922abf5SPhilippe Mathieu-Daudé         return "Loongson-3A1000";
231e5a7c57SPhilippe Mathieu-Daudé     default:
241e5a7c57SPhilippe Mathieu-Daudé         break;
251e5a7c57SPhilippe Mathieu-Daudé     }
26309ce6afSPhilippe Mathieu-Daudé     switch (eflags & EF_MIPS_ARCH) {
27309ce6afSPhilippe Mathieu-Daudé     case EF_MIPS_ARCH_64R6:
2845506bddSYunQiang Su         return "I6400";
29309ce6afSPhilippe Mathieu-Daudé     case EF_MIPS_ARCH_64R2:
30309ce6afSPhilippe Mathieu-Daudé         return "MIPS64R2-generic";
31309ce6afSPhilippe Mathieu-Daudé     default:
32309ce6afSPhilippe Mathieu-Daudé         break;
3345506bddSYunQiang Su     }
34542ca434SLaurent Vivier     return "5KEf";
35542ca434SLaurent Vivier }
36542ca434SLaurent Vivier #endif
37