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

TOMOYO Linux Cross Reference
Linux/arch/sh/mm/asids-debugfs.c

Version: ~ [ linux-5.13-rc1 ] ~ [ linux-5.12.2 ] ~ [ linux-5.11.19 ] ~ [ linux-5.10.35 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.117 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.190 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.232 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.268 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.268 ] ~ [ 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 /*
  2  * debugfs ops for process ASIDs
  3  *
  4  *  Copyright (C) 2000, 2001  Paolo Alberelli
  5  *  Copyright (C) 2003 - 2008  Paul Mundt
  6  *  Copyright (C) 2003, 2004  Richard Curnow
  7  *
  8  * Provides a debugfs file that lists out the ASIDs currently associated
  9  * with the processes.
 10  *
 11  * In the SH-5 case, if the DM.PC register is examined through the debug
 12  * link, this shows ASID + PC. To make use of this, the PID->ASID
 13  * relationship needs to be known. This is primarily for debugging.
 14  *
 15  * This file is subject to the terms and conditions of the GNU General Public
 16  * License.  See the file "COPYING" in the main directory of this archive
 17  * for more details.
 18  */
 19 #include <linux/init.h>
 20 #include <linux/debugfs.h>
 21 #include <linux/seq_file.h>
 22 #include <linux/spinlock.h>
 23 #include <linux/sched/signal.h>
 24 #include <linux/sched/task.h>
 25 
 26 #include <asm/processor.h>
 27 #include <asm/mmu_context.h>
 28 
 29 static int asids_seq_show(struct seq_file *file, void *iter)
 30 {
 31         struct task_struct *p;
 32 
 33         read_lock(&tasklist_lock);
 34 
 35         for_each_process(p) {
 36                 int pid = p->pid;
 37 
 38                 if (unlikely(!pid))
 39                         continue;
 40 
 41                 if (p->mm)
 42                         seq_printf(file, "%5d : %04lx\n", pid,
 43                                    cpu_asid(smp_processor_id(), p->mm));
 44         }
 45 
 46         read_unlock(&tasklist_lock);
 47 
 48         return 0;
 49 }
 50 
 51 static int asids_debugfs_open(struct inode *inode, struct file *file)
 52 {
 53         return single_open(file, asids_seq_show, inode->i_private);
 54 }
 55 
 56 static const struct file_operations asids_debugfs_fops = {
 57         .owner          = THIS_MODULE,
 58         .open           = asids_debugfs_open,
 59         .read           = seq_read,
 60         .llseek         = seq_lseek,
 61         .release        = single_release,
 62 };
 63 
 64 static int __init asids_debugfs_init(void)
 65 {
 66         debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, NULL,
 67                             &asids_debugfs_fops);
 68         return 0;
 69 }
 70 device_initcall(asids_debugfs_init);
 71 

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