aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/ftrace.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 10:23:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-30 10:23:53 -0700
commitebc8eca169be0283d5a7ab54c4411dd59cfb0f27 (patch)
tree831f6d577da3469e3154bf29409281c640bb67df /arch/powerpc/include/asm/ftrace.h
parent25c1a411e8a0a709abe3449866125dc290711ea8 (diff)
parent9ff9a26b786c35ee8d2a66222924a807ec851a9f (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (180 commits) powerpc: clean up ssi.txt, add definition for fsl,ssi-asynchronous powerpc/85xx: Add support for the "socrates" board (MPC8544). powerpc: Fix bugs introduced by sysfs changes powerpc: Sanitize stack pointer in signal handling code powerpc: Add write barrier before enabling DTL flags powerpc/83xx: Update ranges in gianfar node to match other dts powerpc/86xx: Move gianfar mdio nodes under the ethernet nodes powerpc/85xx: Move gianfar mdio nodes under the ethernet nodes powerpc/83xx: Move gianfar mdio nodes under the ethernet nodes powerpc/83xx: Add power management support for MPC837x boards powerpc/mm: Introduce early_init_mmu() on 64-bit powerpc/mm: Add option for non-atomic PTE updates to ppc64 powerpc/mm: Fix printk type warning in mmu_context_nohash powerpc/mm: Rename arch/powerpc/kernel/mmap.c to mmap_64.c powerpc/mm: Merge various PTE bits and accessors definitions powerpc/mm: Tweak PTE bit combination definitions powerpc/cell: Fix iommu exception reporting powerpc/mm: e300c2/c3/c4 TLB errata workaround powerpc/mm: Used free register to save a few cycles in SW TLB miss handling powerpc/mm: Remove unused register usage in SW TLB miss handling ...
Diffstat (limited to 'arch/powerpc/include/asm/ftrace.h')
-rw-r--r--arch/powerpc/include/asm/ftrace.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/ftrace.h b/arch/powerpc/include/asm/ftrace.h
index e5f2ae8362f..dde1296b8b4 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -5,7 +5,44 @@
#define MCOUNT_ADDR ((long)(_mcount))
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
-#ifndef __ASSEMBLY__
+#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__ */
extern void _mcount(void);
#ifdef CONFIG_DYNAMIC_FTRACE