44 #define clib_backtrace_defined 56 asm volatile (
".set push\n" 57 ".set noat\n" "move %[saved_pc], $31\n" "move %[sp], $29\n" 63 ".set pop\n":[pc]
"=r" (pc),
64 [saved_pc]
"=r" (saved_pc),[sp]
"=r" (sp));
67 n_frames_to_skip += 1;
69 for (i = 0; i < max_callers + n_frames_to_skip; i++)
73 i32 insn, rs, rt, rd, immediate, found_saved_pc;
101 void *addr = sp + immediate;
108 ASSERT (immediate % 4 == 0);
109 if (op == MIPS_OPCODE_sw)
110 saved_pc = ((
u32 *) addr)[0];
112 saved_pc = ((
u64 *) addr)[0];
117 case MIPS_OPCODE_addiu:
118 case MIPS_OPCODE_daddiu:
119 case MIPS_OPCODE_addi:
120 case MIPS_OPCODE_daddi:
126 ASSERT (immediate % 4 == 0);
152 case MIPS_OPCODE_slti:
153 case MIPS_OPCODE_sltiu:
154 case MIPS_OPCODE_andi:
155 case MIPS_OPCODE_ori:
156 case MIPS_OPCODE_xori:
157 case MIPS_OPCODE_lui:
158 case MIPS_OPCODE_ldl:
159 case MIPS_OPCODE_ldr:
162 case MIPS_OPCODE_lwl:
164 case MIPS_OPCODE_lbu:
165 case MIPS_OPCODE_lhu:
166 case MIPS_OPCODE_lwr:
167 case MIPS_OPCODE_lwu:
174 case MIPS_OPCODE_SPECIAL:
182 case MIPS_SPECIAL_FUNCT_break:
183 case MIPS_SPECIAL_FUNCT_jr:
184 case MIPS_SPECIAL_FUNCT_sync:
185 case MIPS_SPECIAL_FUNCT_syscall:
186 case MIPS_SPECIAL_FUNCT_tge:
187 case MIPS_SPECIAL_FUNCT_tgeu:
188 case MIPS_SPECIAL_FUNCT_tlt:
189 case MIPS_SPECIAL_FUNCT_tltu:
190 case MIPS_SPECIAL_FUNCT_teq:
191 case MIPS_SPECIAL_FUNCT_tne:
206 if (i >= n_frames_to_skip)
207 callers[i - n_frames_to_skip] = saved_pc;
212 if (i < n_frames_to_skip)
215 return i - n_frames_to_skip;
219 #ifndef clib_backtrace_defined 220 #define clib_backtrace_defined 237 f = __builtin_frame_address (0);
240 n_frames_to_skip += 1;
242 for (i = 0; i < max_callers + n_frames_to_skip; i++)
247 if (
clib_abs ((
void *) f - (
void *) f->
prev) > (64 * 1024))
249 if (i >= n_frames_to_skip)
254 if (i < n_frames_to_skip)
257 return i - n_frames_to_skip;
static u32 mips_insn_get_rt(u32 insn)
sll srl srl sll sra u16x4 i
struct clib_generic_stack_frame_t clib_generic_stack_frame_t
uword clib_backtrace(uword *callers, uword max_callers, uword n_frames_to_skip)
struct clib_generic_stack_frame_t * prev
static uword pointer_to_uword(const void *p)
static u32 mips_insn_get_funct(u32 insn)
#define uword_to_pointer(u, type)
static u32 mips_insn_get_rd(u32 insn)
static i32 mips_insn_get_immediate(u32 insn)
static u32 mips_insn_get_rs(u32 insn)
static mips_insn_opcode_t mips_insn_get_op(u32 insn)
mips_insn_special_funct_t