/* * Gcc-csky with -pg will insert stub in function prologue: * push lr * jbsr _mcount * nop32 * nop32 * * If the (callee - current_pc) is less then 64MB, we'll use bsr: * push lr * bsr _mcount * nop32 * nop32 * else we'll use (movih + ori + jsr): * push lr * movih r26, ... * ori r26, ... * jsr r26 * * (r26 is our reserved link-reg) *
*/ staticinlinevoid make_jbsr(unsignedlong callee, unsignedlong pc,
uint16_t *call, bool nolr)
{ long offset;
int ftrace_update_ftrace_func(ftrace_func_t func)
{ int ret = ftrace_modify_code((unsignedlong)&ftrace_call,
(unsignedlong)func, true, true); if (!ret)
ret = ftrace_modify_code((unsignedlong)&ftrace_regs_call,
(unsignedlong)func, true, true); return ret;
} #endif/* CONFIG_DYNAMIC_FTRACE */
if (unlikely(atomic_read(¤t->tracing_graph_pause))) return;
old = *parent;
if (!function_graph_enter(old, self_addr,
*(unsignedlong *)frame_pointer, parent)) { /* * For csky-gcc function has sub-call: * subi sp, sp, 8 * stw r8, (sp, 0) * mov r8, sp * st.w r15, (sp, 0x4) * push r15 * jl _mcount * We only need set *parent for resume * * For csky-gcc function has no sub-call: * subi sp, sp, 4 * stw r8, (sp, 0) * mov r8, sp * push r15 * jl _mcount * We need set *parent and *(frame_pointer + 4) for resume, * because lr is resumed twice.
*/
*parent = return_hooker;
frame_pointer += 4; if (*(unsignedlong *)frame_pointer == old)
*(unsignedlong *)frame_pointer = return_hooker;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.