Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67286
b: refs/heads/master
c: 60b332e
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Sep 13, 2007
1 parent fd8cae1 commit 671fad7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7866291d4cabf5491d4ecb62787308f8b8958f59
refs/heads/master: 60b332e755da7dbf32f1660973ce4f97ebf05d05
10 changes: 10 additions & 0 deletions trunk/arch/powerpc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ config IRQSTACKS
for handling hard and soft interrupts. This can help avoid
overflowing the process kernel stacks.

config VIRQ_DEBUG
bool "Expose hardware/virtual IRQ mapping via debugfs"
depends on DEBUG_FS && PPC_MERGE
help
This option will show the mapping relationship between hardware irq
numbers and virtual irq numbers. The mapping is exposed via debugfs
in the file powerpc/virq_mapping.

If you don't know what this means you don't need it.

config BDI_SWITCH
bool "Include BDI-2000 user context switcher"
depends on DEBUG_KERNEL && PPC32
Expand Down
63 changes: 63 additions & 0 deletions trunk/arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <linux/mutex.h>
#include <linux/bootmem.h>
#include <linux/pci.h>
#include <linux/debugfs.h>

#include <asm/uaccess.h>
#include <asm/system.h>
Expand Down Expand Up @@ -1006,6 +1007,68 @@ static int irq_late_init(void)
}
arch_initcall(irq_late_init);

#ifdef CONFIG_VIRQ_DEBUG
static int virq_debug_show(struct seq_file *m, void *private)
{
unsigned long flags;
irq_desc_t *desc;
const char *p;
char none[] = "none";
int i;

seq_printf(m, "%-5s %-7s %-15s %s\n", "virq", "hwirq",
"chip name", "host name");

for (i = 1; i < NR_IRQS; i++) {
desc = get_irq_desc(i);
spin_lock_irqsave(&desc->lock, flags);

if (desc->action && desc->action->handler) {
seq_printf(m, "%5d ", i);
seq_printf(m, "0x%05lx ", virq_to_hw(i));

if (desc->chip && desc->chip->typename)
p = desc->chip->typename;
else
p = none;
seq_printf(m, "%-15s ", p);

if (irq_map[i].host && irq_map[i].host->of_node)
p = irq_map[i].host->of_node->full_name;
else
p = none;
seq_printf(m, "%s\n", p);
}

spin_unlock_irqrestore(&desc->lock, flags);
}

return 0;
}

static int virq_debug_open(struct inode *inode, struct file *file)
{
return single_open(file, virq_debug_show, inode->i_private);
}

static const struct file_operations virq_debug_fops = {
.open = virq_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static int __init irq_debugfs_init(void)
{
if (debugfs_create_file("virq_mapping", S_IRUGO, powerpc_debugfs_root,
NULL, &virq_debug_fops))
return -ENOMEM;

return 0;
}
__initcall(irq_debugfs_init);
#endif /* CONFIG_VIRQ_DEBUG */

#endif /* CONFIG_PPC_MERGE */

#ifdef CONFIG_PPC64
Expand Down

0 comments on commit 671fad7

Please sign in to comment.