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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __ASM_STACKTRACE_H
  3 #define __ASM_STACKTRACE_H
  4 
  5 #include <asm/ptrace.h>
  6 #include <linux/llist.h>
  7 
  8 struct stackframe {
  9         /*
 10          * FP member should hold R7 when CONFIG_THUMB2_KERNEL is enabled
 11          * and R11 otherwise.
 12          */
 13         unsigned long fp;
 14         unsigned long sp;
 15         unsigned long lr;
 16         unsigned long pc;
 17 
 18         /* address of the LR value on the stack */
 19         unsigned long *lr_addr;
 20 #ifdef CONFIG_KRETPROBES
 21         struct llist_node *kr_cur;
 22         struct task_struct *tsk;
 23 #endif
 24 #ifdef CONFIG_UNWINDER_FRAME_POINTER
 25         bool ex_frame;
 26 #endif
 27 };
 28 
 29 static inline bool on_thread_stack(void)
 30 {
 31         unsigned long delta = current_stack_pointer ^ (unsigned long)current->stack;
 32 
 33         return delta < THREAD_SIZE;
 34 }
 35 
 36 static __always_inline
 37 void arm_get_current_stackframe(struct pt_regs *regs, struct stackframe *frame)
 38 {
 39                 frame->fp = frame_pointer(regs);
 40                 frame->sp = regs->ARM_sp;
 41                 frame->lr = regs->ARM_lr;
 42                 frame->pc = regs->ARM_pc;
 43 #ifdef CONFIG_KRETPROBES
 44                 frame->kr_cur = NULL;
 45                 frame->tsk = current;
 46 #endif
 47 #ifdef CONFIG_UNWINDER_FRAME_POINTER
 48                 frame->ex_frame = in_entry_text(frame->pc);
 49 #endif
 50 }
 51 
 52 extern int unwind_frame(struct stackframe *frame);
 53 extern void walk_stackframe(struct stackframe *frame,
 54                             bool (*fn)(void *, unsigned long), void *data);
 55 extern void dump_mem(const char *lvl, const char *str, unsigned long bottom,
 56                      unsigned long top);
 57 extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
 58                            const char *loglvl);
 59 
 60 #endif  /* __ASM_STACKTRACE_H */
 61 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php