ftrace.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_NDS32_FTRACE_H
  3. #define __ASM_NDS32_FTRACE_H
  4. #ifdef CONFIG_FUNCTION_TRACER
  5. #define HAVE_FUNCTION_GRAPH_FP_TEST
  6. #define MCOUNT_ADDR ((unsigned long)(_mcount))
  7. /* mcount call is composed of three instructions:
  8. * sethi + ori + jral
  9. */
  10. #define MCOUNT_INSN_SIZE 12
  11. extern void _mcount(unsigned long parent_ip);
  12. #ifdef CONFIG_DYNAMIC_FTRACE
  13. #define FTRACE_ADDR ((unsigned long)_ftrace_caller)
  14. #ifdef __NDS32_EL__
  15. #define INSN_NOP 0x09000040
  16. #define INSN_SIZE(insn) (((insn & 0x00000080) == 0) ? 4 : 2)
  17. #define IS_SETHI(insn) ((insn & 0x000000fe) == 0x00000046)
  18. #define ENDIAN_CONVERT(insn) be32_to_cpu(insn)
  19. #else /* __NDS32_EB__ */
  20. #define INSN_NOP 0x40000009
  21. #define INSN_SIZE(insn) (((insn & 0x80000000) == 0) ? 4 : 2)
  22. #define IS_SETHI(insn) ((insn & 0xfe000000) == 0x46000000)
  23. #define ENDIAN_CONVERT(insn) (insn)
  24. #endif
  25. extern void _ftrace_caller(unsigned long parent_ip);
  26. static inline unsigned long ftrace_call_adjust(unsigned long addr)
  27. {
  28. return addr;
  29. }
  30. struct dyn_arch_ftrace {
  31. };
  32. #endif /* CONFIG_DYNAMIC_FTRACE */
  33. #endif /* CONFIG_FUNCTION_TRACER */
  34. #endif /* __ASM_NDS32_FTRACE_H */