2008-05-22 22:31:07 +04:00
|
|
|
#ifndef _ASM_POWERPC_FTRACE
|
|
|
|
#define _ASM_POWERPC_FTRACE
|
|
|
|
|
2008-10-07 03:06:12 +04:00
|
|
|
#ifdef CONFIG_FUNCTION_TRACER
|
2008-06-21 22:17:27 +04:00
|
|
|
#define MCOUNT_ADDR ((long)(_mcount))
|
|
|
|
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
|
|
|
|
|
2009-02-11 23:01:18 +03:00
|
|
|
#ifdef __ASSEMBLY__
|
|
|
|
|
|
|
|
/* Based off of objdump optput from glibc */
|
|
|
|
|
|
|
|
#define MCOUNT_SAVE_FRAME \
|
|
|
|
stwu r1,-48(r1); \
|
|
|
|
stw r3, 12(r1); \
|
|
|
|
stw r4, 16(r1); \
|
|
|
|
stw r5, 20(r1); \
|
|
|
|
stw r6, 24(r1); \
|
|
|
|
mflr r3; \
|
|
|
|
lwz r4, 52(r1); \
|
|
|
|
mfcr r5; \
|
|
|
|
stw r7, 28(r1); \
|
|
|
|
stw r8, 32(r1); \
|
|
|
|
stw r9, 36(r1); \
|
|
|
|
stw r10,40(r1); \
|
|
|
|
stw r3, 44(r1); \
|
|
|
|
stw r5, 8(r1)
|
|
|
|
|
|
|
|
#define MCOUNT_RESTORE_FRAME \
|
|
|
|
lwz r6, 8(r1); \
|
|
|
|
lwz r0, 44(r1); \
|
|
|
|
lwz r3, 12(r1); \
|
|
|
|
mtctr r0; \
|
|
|
|
lwz r4, 16(r1); \
|
|
|
|
mtcr r6; \
|
|
|
|
lwz r5, 20(r1); \
|
|
|
|
lwz r6, 24(r1); \
|
|
|
|
lwz r0, 52(r1); \
|
|
|
|
lwz r7, 28(r1); \
|
|
|
|
lwz r8, 32(r1); \
|
|
|
|
mtlr r0; \
|
|
|
|
lwz r9, 36(r1); \
|
|
|
|
lwz r10,40(r1); \
|
|
|
|
addi r1, r1, 48
|
|
|
|
|
|
|
|
#else /* !__ASSEMBLY__ */
|
2008-05-22 22:31:07 +04:00
|
|
|
extern void _mcount(void);
|
2008-11-15 03:21:19 +03:00
|
|
|
|
|
|
|
#ifdef CONFIG_DYNAMIC_FTRACE
|
|
|
|
static inline unsigned long ftrace_call_adjust(unsigned long addr)
|
|
|
|
{
|
|
|
|
/* reloction of mcount call site is the same as the address */
|
|
|
|
return addr;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct dyn_arch_ftrace {
|
2008-11-15 07:47:03 +03:00
|
|
|
struct module *mod;
|
2008-11-15 03:21:19 +03:00
|
|
|
};
|
|
|
|
#endif /* CONFIG_DYNAMIC_FTRACE */
|
|
|
|
#endif /* __ASSEMBLY__ */
|
2008-05-22 22:31:07 +04:00
|
|
|
|
|
|
|
#endif
|
2008-06-21 22:17:27 +04:00
|
|
|
|
|
|
|
#endif /* _ASM_POWERPC_FTRACE */
|