Skip to content

Commit

Permalink
sh: Create an sh debugfs root.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Apr 18, 2008
1 parent b420b1a commit b9e393c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <linux/kexec.h>
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/err.h>
#include <linux/debugfs.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/page.h>
Expand Down Expand Up @@ -443,3 +445,15 @@ const struct seq_operations cpuinfo_op = {
.show = show_cpuinfo,
};
#endif /* CONFIG_PROC_FS */

struct dentry *sh_debugfs_root;

static int __init sh_debugfs_init(void)
{
sh_debugfs_root = debugfs_create_dir("sh", NULL);
if (IS_ERR(sh_debugfs_root))
return PTR_ERR(sh_debugfs_root);

return 0;
}
arch_initcall(sh_debugfs_init);
4 changes: 2 additions & 2 deletions arch/sh/mm/cache-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ static int __init cache_debugfs_init(void)
{
struct dentry *dcache_dentry, *icache_dentry;

dcache_dentry = debugfs_create_file("dcache", S_IRUSR, NULL,
dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root,
(unsigned int *)CACHE_TYPE_DCACHE,
&cache_debugfs_fops);
if (IS_ERR(dcache_dentry))
return PTR_ERR(dcache_dentry);

icache_dentry = debugfs_create_file("icache", S_IRUSR, NULL,
icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root,
(unsigned int *)CACHE_TYPE_ICACHE,
&cache_debugfs_fops);
if (IS_ERR(icache_dentry)) {
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static int __init pmb_debugfs_init(void)
struct dentry *dentry;

dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
NULL, NULL, &pmb_debugfs_fops);
sh_debugfs_root, NULL, &pmb_debugfs_fops);
if (IS_ERR(dentry))
return PTR_ERR(dentry);

Expand Down
2 changes: 2 additions & 0 deletions include/asm-sh/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ extern unsigned int instruction_size(unsigned int insn);

extern unsigned long cached_to_uncached;

extern struct dentry *sh_debugfs_root;

/* XXX
* disable hlt during certain critical i/o operations
*/
Expand Down

0 comments on commit b9e393c

Please sign in to comment.