15000e7f6SLeo Yan // SPDX-License-Identifier: GPL-2.0 25000e7f6SLeo Yan 35000e7f6SLeo Yan #ifdef HAVE_PERF_REGS_SUPPORT 45000e7f6SLeo Yan 55000e7f6SLeo Yan #include "../perf_regs.h" 65000e7f6SLeo Yan #include "../../../arch/mips/include/uapi/asm/perf_regs.h" 75000e7f6SLeo Yan 85000e7f6SLeo Yan const char *__perf_reg_name_mips(int id) 95000e7f6SLeo Yan { 105000e7f6SLeo Yan switch (id) { 115000e7f6SLeo Yan case PERF_REG_MIPS_PC: 125000e7f6SLeo Yan return "PC"; 135000e7f6SLeo Yan case PERF_REG_MIPS_R1: 145000e7f6SLeo Yan return "$1"; 155000e7f6SLeo Yan case PERF_REG_MIPS_R2: 165000e7f6SLeo Yan return "$2"; 175000e7f6SLeo Yan case PERF_REG_MIPS_R3: 185000e7f6SLeo Yan return "$3"; 195000e7f6SLeo Yan case PERF_REG_MIPS_R4: 205000e7f6SLeo Yan return "$4"; 215000e7f6SLeo Yan case PERF_REG_MIPS_R5: 225000e7f6SLeo Yan return "$5"; 235000e7f6SLeo Yan case PERF_REG_MIPS_R6: 245000e7f6SLeo Yan return "$6"; 255000e7f6SLeo Yan case PERF_REG_MIPS_R7: 265000e7f6SLeo Yan return "$7"; 275000e7f6SLeo Yan case PERF_REG_MIPS_R8: 285000e7f6SLeo Yan return "$8"; 295000e7f6SLeo Yan case PERF_REG_MIPS_R9: 305000e7f6SLeo Yan return "$9"; 315000e7f6SLeo Yan case PERF_REG_MIPS_R10: 325000e7f6SLeo Yan return "$10"; 335000e7f6SLeo Yan case PERF_REG_MIPS_R11: 345000e7f6SLeo Yan return "$11"; 355000e7f6SLeo Yan case PERF_REG_MIPS_R12: 365000e7f6SLeo Yan return "$12"; 375000e7f6SLeo Yan case PERF_REG_MIPS_R13: 385000e7f6SLeo Yan return "$13"; 395000e7f6SLeo Yan case PERF_REG_MIPS_R14: 405000e7f6SLeo Yan return "$14"; 415000e7f6SLeo Yan case PERF_REG_MIPS_R15: 425000e7f6SLeo Yan return "$15"; 435000e7f6SLeo Yan case PERF_REG_MIPS_R16: 445000e7f6SLeo Yan return "$16"; 455000e7f6SLeo Yan case PERF_REG_MIPS_R17: 465000e7f6SLeo Yan return "$17"; 475000e7f6SLeo Yan case PERF_REG_MIPS_R18: 485000e7f6SLeo Yan return "$18"; 495000e7f6SLeo Yan case PERF_REG_MIPS_R19: 505000e7f6SLeo Yan return "$19"; 515000e7f6SLeo Yan case PERF_REG_MIPS_R20: 525000e7f6SLeo Yan return "$20"; 535000e7f6SLeo Yan case PERF_REG_MIPS_R21: 545000e7f6SLeo Yan return "$21"; 555000e7f6SLeo Yan case PERF_REG_MIPS_R22: 565000e7f6SLeo Yan return "$22"; 575000e7f6SLeo Yan case PERF_REG_MIPS_R23: 585000e7f6SLeo Yan return "$23"; 595000e7f6SLeo Yan case PERF_REG_MIPS_R24: 605000e7f6SLeo Yan return "$24"; 615000e7f6SLeo Yan case PERF_REG_MIPS_R25: 625000e7f6SLeo Yan return "$25"; 635000e7f6SLeo Yan case PERF_REG_MIPS_R28: 645000e7f6SLeo Yan return "$28"; 655000e7f6SLeo Yan case PERF_REG_MIPS_R29: 665000e7f6SLeo Yan return "$29"; 675000e7f6SLeo Yan case PERF_REG_MIPS_R30: 685000e7f6SLeo Yan return "$30"; 695000e7f6SLeo Yan case PERF_REG_MIPS_R31: 705000e7f6SLeo Yan return "$31"; 715000e7f6SLeo Yan default: 725000e7f6SLeo Yan break; 735000e7f6SLeo Yan } 745000e7f6SLeo Yan return NULL; 755000e7f6SLeo Yan } 765000e7f6SLeo Yan 77*34af56afSLeo Yan uint64_t __perf_reg_ip_mips(void) 78*34af56afSLeo Yan { 79*34af56afSLeo Yan return PERF_REG_MIPS_PC; 80*34af56afSLeo Yan } 81*34af56afSLeo Yan 82*34af56afSLeo Yan uint64_t __perf_reg_sp_mips(void) 83*34af56afSLeo Yan { 84*34af56afSLeo Yan return PERF_REG_MIPS_R29; 85*34af56afSLeo Yan } 86*34af56afSLeo Yan 875000e7f6SLeo Yan #endif 88