/*1* debugfs ops for process ASIDs2*3* Copyright (C) 2000, 2001 Paolo Alberelli4* Copyright (C) 2003 - 2008 Paul Mundt5* Copyright (C) 2003, 2004 Richard Curnow6*7* Provides a debugfs file that lists out the ASIDs currently associated8* with the processes.9*10* In the SH-5 case, if the DM.PC register is examined through the debug11* link, this shows ASID + PC. To make use of this, the PID->ASID12* relationship needs to be known. This is primarily for debugging.13*14* This file is subject to the terms and conditions of the GNU General Public15* License. See the file "COPYING" in the main directory of this archive16* for more details.17*/18#include <linux/init.h>19#include <linux/debugfs.h>20#include <linux/seq_file.h>21#include <linux/spinlock.h>22#include <linux/sched/signal.h>23#include <linux/sched/task.h>2425#include <asm/processor.h>26#include <asm/mmu_context.h>2728static int asids_debugfs_show(struct seq_file *file, void *iter)29{30struct task_struct *p;3132read_lock(&tasklist_lock);3334for_each_process(p) {35int pid = p->pid;3637if (unlikely(!pid))38continue;3940if (p->mm)41seq_printf(file, "%5d : %04lx\n", pid,42cpu_asid(smp_processor_id(), p->mm));43}4445read_unlock(&tasklist_lock);4647return 0;48}4950DEFINE_SHOW_ATTRIBUTE(asids_debugfs);5152static int __init asids_debugfs_init(void)53{54debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, NULL,55&asids_debugfs_fops);56return 0;57}58device_initcall(asids_debugfs_init);596061