ftrace.h 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * arch/xtensa/include/asm/ftrace.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2013 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_FTRACE_H
  11. #define _XTENSA_FTRACE_H
  12. #include <asm/processor.h>
  13. #ifndef __ASSEMBLY__
  14. #define ftrace_return_address0 ({ unsigned long a0, a1; \
  15. __asm__ __volatile__ ( \
  16. "mov %0, a0\n" \
  17. "mov %1, a1\n" \
  18. : "=r"(a0), "=r"(a1)); \
  19. MAKE_PC_FROM_RA(a0, a1); })
  20. #ifdef CONFIG_FRAME_POINTER
  21. extern unsigned long return_address(unsigned level);
  22. #define ftrace_return_address(n) return_address(n)
  23. #endif
  24. #endif /* __ASSEMBLY__ */
  25. #ifdef CONFIG_FUNCTION_TRACER
  26. #define MCOUNT_ADDR ((unsigned long)(_mcount))
  27. #define MCOUNT_INSN_SIZE 3
  28. #ifndef __ASSEMBLY__
  29. extern void _mcount(void);
  30. #define mcount _mcount
  31. #endif /* __ASSEMBLY__ */
  32. #endif /* CONFIG_FUNCTION_TRACER */
  33. #endif /* _XTENSA_FTRACE_H */