2 #include <linux/init.h>
3 #include <linux/interrupt.h>
4 #include <linux/irqnr.h>
5 #include <linux/proc_fs.h>
6 #include <linux/seq_file.h>
11 static void *int_seq_start(struct seq_file *f, loff_t *pos)
13 return (*pos <= nr_irqs) ? pos : NULL;
16 static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
24 static void int_seq_stop(struct seq_file *f, void *v)
29 static const struct seq_operations int_seq_ops = {
30 .start = int_seq_start,
33 .show = show_interrupts
36 static int interrupts_open(struct inode *inode, struct file *filp)
38 return seq_open(filp, &int_seq_ops);
41 static const struct file_operations proc_interrupts_operations = {
42 .open = interrupts_open,
45 .release = seq_release,
48 static int __init proc_interrupts_init(void)
50 proc_create("interrupts", 0, NULL, &proc_interrupts_operations);
53 module_init(proc_interrupts_init);