~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/stacktrace.h

Version: ~ [ linux-5.14-rc3 ] ~ [ linux-5.13.5 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.53 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.135 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.198 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.240 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.276 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.276 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ASM_STACKTRACE_H
  2 #define _ASM_STACKTRACE_H
  3 
  4 #include <asm/ptrace.h>
  5 
  6 #ifdef CONFIG_KALLSYMS
  7 extern int raw_show_trace;
  8 extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
  9                                   unsigned long pc, unsigned long *ra);
 10 extern unsigned long unwind_stack_by_address(unsigned long stack_page,
 11                                              unsigned long *sp,
 12                                              unsigned long pc,
 13                                              unsigned long *ra);
 14 #else
 15 #define raw_show_trace 1
 16 static inline unsigned long unwind_stack(struct task_struct *task,
 17         unsigned long *sp, unsigned long pc, unsigned long *ra)
 18 {
 19         return 0;
 20 }
 21 #endif
 22 
 23 static __always_inline void prepare_frametrace(struct pt_regs *regs)
 24 {
 25 #ifndef CONFIG_KALLSYMS
 26         /*
 27          * Remove any garbage that may be in regs (specially func
 28          * addresses) to avoid show_raw_backtrace() to report them
 29          */
 30         memset(regs, 0, sizeof(*regs));
 31 #endif
 32         __asm__ __volatile__(
 33                 ".set push\n\t"
 34                 ".set noat\n\t"
 35 #ifdef CONFIG_64BIT
 36                 "1: dla $1, 1b\n\t"
 37                 "sd $1, %0\n\t"
 38                 "sd $29, %1\n\t"
 39                 "sd $31, %2\n\t"
 40 #else
 41                 "1: la $1, 1b\n\t"
 42                 "sw $1, %0\n\t"
 43                 "sw $29, %1\n\t"
 44                 "sw $31, %2\n\t"
 45 #endif
 46                 ".set pop\n\t"
 47                 : "=m" (regs->cp0_epc),
 48                 "=m" (regs->regs[29]), "=m" (regs->regs[31])
 49                 : : "memory");
 50 }
 51 
 52 #endif /* _ASM_STACKTRACE_H */
 53 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp