1d2a56bd2STaylor Simpson /* 2*fc2622f6STaylor Simpson * Copyright(c) 2019-2023 Qualcomm Innovation Center, Inc. All Rights Reserved. 3d2a56bd2STaylor Simpson * 4d2a56bd2STaylor Simpson * This program is free software; you can redistribute it and/or modify 5d2a56bd2STaylor Simpson * it under the terms of the GNU General Public License as published by 6d2a56bd2STaylor Simpson * the Free Software Foundation; either version 2 of the License, or 7d2a56bd2STaylor Simpson * (at your option) any later version. 8d2a56bd2STaylor Simpson * 9d2a56bd2STaylor Simpson * This program is distributed in the hope that it will be useful, 10d2a56bd2STaylor Simpson * but WITHOUT ANY WARRANTY; without even the implied warranty of 11d2a56bd2STaylor Simpson * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12d2a56bd2STaylor Simpson * GNU General Public License for more details. 13d2a56bd2STaylor Simpson * 14d2a56bd2STaylor Simpson * You should have received a copy of the GNU General Public License 15d2a56bd2STaylor Simpson * along with this program; if not, see <http://www.gnu.org/licenses/>. 16d2a56bd2STaylor Simpson */ 17d2a56bd2STaylor Simpson 18d2a56bd2STaylor Simpson #ifndef HEXAGON_TARGET_ELF_H 19d2a56bd2STaylor Simpson #define HEXAGON_TARGET_ELF_H 20d2a56bd2STaylor Simpson 21d2a56bd2STaylor Simpson static inline const char *cpu_get_model(uint32_t eflags) 22d2a56bd2STaylor Simpson { 23*fc2622f6STaylor Simpson /* For now, treat anything newer than v5 as a v73 */ 24d2a56bd2STaylor Simpson /* FIXME - Disable instructions that are newer than the specified arch */ 25d2a56bd2STaylor Simpson if (eflags == 0x04 || /* v5 */ 26d2a56bd2STaylor Simpson eflags == 0x05 || /* v55 */ 27d2a56bd2STaylor Simpson eflags == 0x60 || /* v60 */ 28d2a56bd2STaylor Simpson eflags == 0x61 || /* v61 */ 29d2a56bd2STaylor Simpson eflags == 0x62 || /* v62 */ 30d2a56bd2STaylor Simpson eflags == 0x65 || /* v65 */ 31d2a56bd2STaylor Simpson eflags == 0x66 || /* v66 */ 32d2a56bd2STaylor Simpson eflags == 0x67 || /* v67 */ 33*fc2622f6STaylor Simpson eflags == 0x8067 || /* v67t */ 34*fc2622f6STaylor Simpson eflags == 0x68 || /* v68 */ 35*fc2622f6STaylor Simpson eflags == 0x69 || /* v69 */ 36*fc2622f6STaylor Simpson eflags == 0x71 || /* v71 */ 37*fc2622f6STaylor Simpson eflags == 0x8071 || /* v71t */ 38*fc2622f6STaylor Simpson eflags == 0x73 /* v73 */ 39d2a56bd2STaylor Simpson ) { 40*fc2622f6STaylor Simpson return "v73"; 41d2a56bd2STaylor Simpson } 42d2a56bd2STaylor Simpson return "unknown"; 43d2a56bd2STaylor Simpson } 44d2a56bd2STaylor Simpson 45d2a56bd2STaylor Simpson #endif 46