Skip to content

Commit b9e393c

Browse files
committed
sh: Create an sh debugfs root.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent b420b1a commit b9e393c

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎arch/sh/kernel/setup.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <linux/kexec.h>
2424
#include <linux/module.h>
2525
#include <linux/smp.h>
26+
#include <linux/err.h>
27+
#include <linux/debugfs.h>
2628
#include <asm/uaccess.h>
2729
#include <asm/io.h>
2830
#include <asm/page.h>
@@ -443,3 +445,15 @@ const struct seq_operations cpuinfo_op = {
443445
.show = show_cpuinfo,
444446
};
445447
#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‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ static int __init cache_debugfs_init(void)
127127
{
128128
struct dentry *dcache_dentry, *icache_dentry;
129129

130-
dcache_dentry = debugfs_create_file("dcache", S_IRUSR, NULL,
130+
dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root,
131131
(unsigned int *)CACHE_TYPE_DCACHE,
132132
&cache_debugfs_fops);
133133
if (IS_ERR(dcache_dentry))
134134
return PTR_ERR(dcache_dentry);
135135

136-
icache_dentry = debugfs_create_file("icache", S_IRUSR, NULL,
136+
icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root,
137137
(unsigned int *)CACHE_TYPE_ICACHE,
138138
&cache_debugfs_fops);
139139
if (IS_ERR(icache_dentry)) {

‎arch/sh/mm/pmb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int __init pmb_debugfs_init(void)
393393
struct dentry *dentry;
394394

395395
dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
396-
NULL, NULL, &pmb_debugfs_fops);
396+
sh_debugfs_root, NULL, &pmb_debugfs_fops);
397397
if (IS_ERR(dentry))
398398
return PTR_ERR(dentry);
399399

‎include/asm-sh/system.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn);
146146

147147
extern unsigned long cached_to_uncached;
148148

149+
extern struct dentry *sh_debugfs_root;
150+
149151
/* XXX
150152
* disable hlt during certain critical i/o operations
151153
*/

0 commit comments

Comments
 (0)