diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-06-19 20:54:19 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-10 07:53:50 -0400 |
commit | 94a3807c2a547283bb2fb1728609ad51c09d5f79 (patch) | |
tree | d85fa4f63da7ccacaeaa1688718439c6741f1d56 | |
parent | db0dbae9d9680bce69fe1ce775709e60c8ee9c29 (diff) |
[POWERPC] Make the debugfs "powerpc" dir globally accessible
The prom.c debugging code creates a "powerpc" directory in debugfs,
which is nice, but doesn't allow any other debugging code to stick things
under "powerpc" in debugfs. So make it global.
While we're there we should make the prom.c debugging code depend on
CONFIG_DEBUG_FS, because it doesn't work otherwise.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/prom.c | 9 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 13 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 6d5e601097a..0782afc29f5 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <asm/pSeries_reconfig.h> | 52 | #include <asm/pSeries_reconfig.h> |
53 | #include <asm/pci-bridge.h> | 53 | #include <asm/pci-bridge.h> |
54 | #include <asm/kexec.h> | 54 | #include <asm/kexec.h> |
55 | #include <asm/system.h> | ||
55 | 56 | ||
56 | #ifdef DEBUG | 57 | #ifdef DEBUG |
57 | #define DBG(fmt...) printk(KERN_ERR fmt) | 58 | #define DBG(fmt...) printk(KERN_ERR fmt) |
@@ -1730,22 +1731,18 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) | |||
1730 | } | 1731 | } |
1731 | EXPORT_SYMBOL(of_get_cpu_node); | 1732 | EXPORT_SYMBOL(of_get_cpu_node); |
1732 | 1733 | ||
1733 | #ifdef DEBUG | 1734 | #if defined(CONFIG_DEBUG_FS) && defined(DEBUG) |
1734 | static struct debugfs_blob_wrapper flat_dt_blob; | 1735 | static struct debugfs_blob_wrapper flat_dt_blob; |
1735 | 1736 | ||
1736 | static int __init export_flat_device_tree(void) | 1737 | static int __init export_flat_device_tree(void) |
1737 | { | 1738 | { |
1738 | struct dentry *d; | 1739 | struct dentry *d; |
1739 | 1740 | ||
1740 | d = debugfs_create_dir("powerpc", NULL); | ||
1741 | if (!d) | ||
1742 | return 1; | ||
1743 | |||
1744 | flat_dt_blob.data = initial_boot_params; | 1741 | flat_dt_blob.data = initial_boot_params; |
1745 | flat_dt_blob.size = initial_boot_params->totalsize; | 1742 | flat_dt_blob.size = initial_boot_params->totalsize; |
1746 | 1743 | ||
1747 | d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR, | 1744 | d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR, |
1748 | d, &flat_dt_blob); | 1745 | powerpc_debugfs_root, &flat_dt_blob); |
1749 | if (!d) | 1746 | if (!d) |
1750 | return 1; | 1747 | return 1; |
1751 | 1748 | ||
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 38c4b733a72..4924c48cb1f 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
33 | #include <linux/serial.h> | 33 | #include <linux/serial.h> |
34 | #include <linux/serial_8250.h> | 34 | #include <linux/serial_8250.h> |
35 | #include <linux/debugfs.h> | ||
35 | #include <asm/io.h> | 36 | #include <asm/io.h> |
36 | #include <asm/prom.h> | 37 | #include <asm/prom.h> |
37 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
@@ -579,3 +580,15 @@ static int __init check_cache_coherency(void) | |||
579 | 580 | ||
580 | late_initcall(check_cache_coherency); | 581 | late_initcall(check_cache_coherency); |
581 | #endif /* CONFIG_CHECK_CACHE_COHERENCY */ | 582 | #endif /* CONFIG_CHECK_CACHE_COHERENCY */ |
583 | |||
584 | #ifdef CONFIG_DEBUG_FS | ||
585 | struct dentry *powerpc_debugfs_root; | ||
586 | |||
587 | static int powerpc_debugfs_init(void) | ||
588 | { | ||
589 | powerpc_debugfs_root = debugfs_create_dir("powerpc", NULL); | ||
590 | |||
591 | return powerpc_debugfs_root == NULL; | ||
592 | } | ||
593 | arch_initcall(powerpc_debugfs_init); | ||
594 | #endif | ||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index eff3de95371..32aa42b748b 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -559,5 +559,7 @@ static inline void create_function_call(unsigned long addr, void * func) | |||
559 | extern void account_system_vtime(struct task_struct *); | 559 | extern void account_system_vtime(struct task_struct *); |
560 | #endif | 560 | #endif |
561 | 561 | ||
562 | extern struct dentry *powerpc_debugfs_root; | ||
563 | |||
562 | #endif /* __KERNEL__ */ | 564 | #endif /* __KERNEL__ */ |
563 | #endif /* _ASM_POWERPC_SYSTEM_H */ | 565 | #endif /* _ASM_POWERPC_SYSTEM_H */ |