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

TOMOYO Linux Cross Reference
Linux/arch/microblaze/kernel/traps.c

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 /*
  2  * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
  3  * Copyright (C) 2007-2009 PetaLogix
  4  * Copyright (C) 2006 Atmark Techno, Inc.
  5  *
  6  * This file is subject to the terms and conditions of the GNU General Public
  7  * License. See the file "COPYING" in the main directory of this archive
  8  * for more details.
  9  */
 10 
 11 #include <linux/cpu.h>
 12 #include <linux/export.h>
 13 #include <linux/kernel.h>
 14 #include <linux/kallsyms.h>
 15 #include <linux/sched.h>
 16 #include <linux/sched/debug.h>
 17 #include <linux/debug_locks.h>
 18 
 19 #include <asm/exceptions.h>
 20 #include <asm/unwind.h>
 21 
 22 void trap_init(void)
 23 {
 24         __enable_hw_exceptions();
 25 }
 26 
 27 static unsigned long kstack_depth_to_print;     /* 0 == entire stack */
 28 
 29 static int __init kstack_setup(char *s)
 30 {
 31         return !kstrtoul(s, 0, &kstack_depth_to_print);
 32 }
 33 __setup("kstack=", kstack_setup);
 34 
 35 void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
 36 {
 37         unsigned long words_to_show;
 38         u32 fp = (u32) sp;
 39 
 40         if (fp == 0) {
 41                 if (task) {
 42                         fp = ((struct thread_info *)
 43                                 (task->stack))->cpu_context.r1;
 44                 } else {
 45                         /* Pick up caller of dump_stack() */
 46                         fp = (u32)&sp - 8;
 47                 }
 48         }
 49 
 50         words_to_show = (THREAD_SIZE - (fp & (THREAD_SIZE - 1))) >> 2;
 51         if (kstack_depth_to_print && (words_to_show > kstack_depth_to_print))
 52                 words_to_show = kstack_depth_to_print;
 53 
 54         printk("%sKernel Stack:\n", loglvl);
 55 
 56         /*
 57          * Make the first line an 'odd' size if necessary to get
 58          * remaining lines to start at an address multiple of 0x10
 59          */
 60         if (fp & 0xF) {
 61                 unsigned long line1_words = (0x10 - (fp & 0xF)) >> 2;
 62                 if (line1_words < words_to_show) {
 63                         print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 32,
 64                                        4, (void *)fp, line1_words << 2, 0);
 65                         fp += line1_words << 2;
 66                         words_to_show -= line1_words;
 67                 }
 68         }
 69         print_hex_dump(loglvl, "", DUMP_PREFIX_ADDRESS, 32, 4, (void *)fp,
 70                        words_to_show << 2, 0);
 71         printk("%s\n\nCall Trace:\n", loglvl);
 72         microblaze_unwind(task, NULL, loglvl);
 73         printk("%s\n", loglvl);
 74 
 75         if (!task)
 76                 task = current;
 77 
 78         debug_show_held_locks(task);
 79 }
 80 

~ [ 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