xref: /openbmc/qemu/linux-user/hexagon/elfload.c (revision ca18b336e12c8433177a3cd639c5bf757952adaa)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "qemu/osdep.h"
4 #include "qemu.h"
5 #include "loader.h"
6 
7 
8 const char *get_elf_cpu_model(uint32_t eflags)
9 {
10     static char buf[32];
11     int err;
12 
13     /* For now, treat anything newer than v5 as a v73 */
14     /* FIXME - Disable instructions that are newer than the specified arch */
15     if (eflags == 0x04 ||    /* v5  */
16         eflags == 0x05 ||    /* v55 */
17         eflags == 0x60 ||    /* v60 */
18         eflags == 0x61 ||    /* v61 */
19         eflags == 0x62 ||    /* v62 */
20         eflags == 0x65 ||    /* v65 */
21         eflags == 0x66 ||    /* v66 */
22         eflags == 0x67 ||    /* v67 */
23         eflags == 0x8067 ||  /* v67t */
24         eflags == 0x68 ||    /* v68 */
25         eflags == 0x69 ||    /* v69 */
26         eflags == 0x71 ||    /* v71 */
27         eflags == 0x8071 ||  /* v71t */
28         eflags == 0x73       /* v73 */
29        ) {
30         return "v73";
31     }
32 
33     err = snprintf(buf, sizeof(buf), "unknown (0x%x)", eflags);
34     return err >= 0 && err < sizeof(buf) ? buf : "unknown";
35 }
36