Commit b9e393c2babb8b6956de52fc580b7c23f3629232

Authored by Paul Mundt
1 parent b420b1a7a1

sh: Create an sh debugfs root.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

Showing 4 changed files with 19 additions and 3 deletions Side-by-side Diff

arch/sh/kernel/setup.c
... ... @@ -23,6 +23,8 @@
23 23 #include <linux/kexec.h>
24 24 #include <linux/module.h>
25 25 #include <linux/smp.h>
  26 +#include <linux/err.h>
  27 +#include <linux/debugfs.h>
26 28 #include <asm/uaccess.h>
27 29 #include <asm/io.h>
28 30 #include <asm/page.h>
... ... @@ -443,4 +445,16 @@
443 445 .show = show_cpuinfo,
444 446 };
445 447 #endif /* CONFIG_PROC_FS */
  448 +
  449 +struct dentry *sh_debugfs_root;
  450 +
  451 +static int __init sh_debugfs_init(void)
  452 +{
  453 + sh_debugfs_root = debugfs_create_dir("sh", NULL);
  454 + if (IS_ERR(sh_debugfs_root))
  455 + return PTR_ERR(sh_debugfs_root);
  456 +
  457 + return 0;
  458 +}
  459 +arch_initcall(sh_debugfs_init);
arch/sh/mm/cache-debugfs.c
... ... @@ -127,13 +127,13 @@
127 127 {
128 128 struct dentry *dcache_dentry, *icache_dentry;
129 129  
130   - dcache_dentry = debugfs_create_file("dcache", S_IRUSR, NULL,
  130 + dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root,
131 131 (unsigned int *)CACHE_TYPE_DCACHE,
132 132 &cache_debugfs_fops);
133 133 if (IS_ERR(dcache_dentry))
134 134 return PTR_ERR(dcache_dentry);
135 135  
136   - icache_dentry = debugfs_create_file("icache", S_IRUSR, NULL,
  136 + icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root,
137 137 (unsigned int *)CACHE_TYPE_ICACHE,
138 138 &cache_debugfs_fops);
139 139 if (IS_ERR(icache_dentry)) {
... ... @@ -393,7 +393,7 @@
393 393 struct dentry *dentry;
394 394  
395 395 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
396   - NULL, NULL, &pmb_debugfs_fops);
  396 + sh_debugfs_root, NULL, &pmb_debugfs_fops);
397 397 if (IS_ERR(dentry))
398 398 return PTR_ERR(dentry);
399 399  
include/asm-sh/system.h
... ... @@ -146,6 +146,8 @@
146 146  
147 147 extern unsigned long cached_to_uncached;
148 148  
  149 +extern struct dentry *sh_debugfs_root;
  150 +
149 151 /* XXX
150 152 * disable hlt during certain critical i/o operations
151 153 */