summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smp-mt.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-10-16 17:10:07 +0200
committerRalf Baechle <ralf@linux-mips.org>2014-03-31 18:17:12 +0200
commitd6d3c9afaab47418ab2d7f874fb8aeac1f067104 (patch)
tree9f3b27fad7b722ab15144e6a044c5d771d3e3d59 /arch/mips/kernel/smp-mt.c
parentMIPS: BCM47XX: Add new file for device specific workarounds (diff)
downloadlinux-d6d3c9afaab47418ab2d7f874fb8aeac1f067104.tar.xz
linux-d6d3c9afaab47418ab2d7f874fb8aeac1f067104.zip
MIPS: MT: proc: Add support for printing VPE and TC ids
And there are more CPUs or configurations that want to provide special per-CPU information in /proc/cpuinfo. So I think there needs to be a hook mechanism, such as a notifier. This is a first cut only; I need to think about what sort of looking the notifier needs to have. But I'd appreciate testing on MT hardware! Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6066/
Diffstat (limited to 'arch/mips/kernel/smp-mt.c')
-rw-r--r--arch/mips/kernel/smp-mt.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 0fb8cefc9114..3378c452e5d7 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -313,3 +313,25 @@ struct plat_smp_ops vsmp_smp_ops = {
.smp_setup = vsmp_smp_setup,
.prepare_cpus = vsmp_prepare_cpus,
};
+
+static int proc_cpuinfo_chain_call(struct notifier_block *nfb,
+ unsigned long action_unused, void *data)
+{
+ struct proc_cpuinfo_notifier_args *pcn = data;
+ struct seq_file *m = pcn->m;
+ unsigned long n = pcn->n;
+
+ if (!cpu_has_mipsmt)
+ return NOTIFY_OK;
+
+ seq_printf(m, "VPE\t\t\t: %d\n", cpu_data[n].vpe_id);
+
+ return NOTIFY_OK;
+}
+
+static int __init proc_cpuinfo_notifier_init(void)
+{
+ return proc_cpuinfo_notifier(proc_cpuinfo_chain_call, 0);
+}
+
+subsys_initcall(proc_cpuinfo_notifier_init);