This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / kernel / irq.c
1 /* 
2  * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  * Derived (i.e. mostly copied) from arch/i386/kernel/irq.c:
5  *      Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
6  */
7
8 #include "linux/config.h"
9 #include "linux/kernel.h"
10 #include "linux/module.h"
11 #include "linux/smp.h"
12 #include "linux/irq.h"
13 #include "linux/kernel_stat.h"
14 #include "linux/interrupt.h"
15 #include "linux/random.h"
16 #include "linux/slab.h"
17 #include "linux/file.h"
18 #include "linux/proc_fs.h"
19 #include "linux/init.h"
20 #include "linux/seq_file.h"
21 #include "asm/irq.h"
22 #include "asm/hw_irq.h"
23 #include "asm/hardirq.h"
24 #include "asm/atomic.h"
25 #include "asm/signal.h"
26 #include "asm/system.h"
27 #include "asm/errno.h"
28 #include "asm/uaccess.h"
29 #include "user_util.h"
30 #include "kern_util.h"
31 #include "irq_user.h"
32 #include "irq_kern.h"
33
34 static void register_irq_proc (unsigned int irq);
35
36 irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
37         [0 ... NR_IRQS-1] = {
38                 .handler = &no_irq_type,
39                 .lock = SPIN_LOCK_UNLOCKED
40         }
41 };
42
43 /*
44  * Generic no controller code
45  */
46
47 static void enable_none(unsigned int irq) { }
48 static unsigned int startup_none(unsigned int irq) { return 0; }
49 static void disable_none(unsigned int irq) { }
50 static void ack_none(unsigned int irq)
51 {
52 /*
53  * 'what should we do if we get a hw irq event on an illegal vector'.
54  * each architecture has to answer this themselves, it doesn't deserve
55  * a generic callback i think.
56  */
57 #ifdef CONFIG_X86
58         printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq);
59 #ifdef CONFIG_X86_LOCAL_APIC
60         /*
61          * Currently unexpected vectors happen only on SMP and APIC.
62          * We _must_ ack these because every local APIC has only N
63          * irq slots per priority level, and a 'hanging, unacked' IRQ
64          * holds up an irq slot - in excessive cases (when multiple
65          * unexpected vectors occur) that might lock up the APIC
66          * completely.
67          */
68         ack_APIC_irq();
69 #endif
70 #endif
71 }
72
73 /* startup is the same as "enable", shutdown is same as "disable" */
74 #define shutdown_none   disable_none
75 #define end_none        enable_none
76
77 struct hw_interrupt_type no_irq_type = {
78         "none",
79         startup_none,
80         shutdown_none,
81         enable_none,
82         disable_none,
83         ack_none,
84         end_none
85 };
86
87 /*
88  * Generic, controller-independent functions:
89  */
90
91 int show_interrupts(struct seq_file *p, void *v)
92 {
93         int i = *(loff_t *) v, j;
94         struct irqaction * action;
95         unsigned long flags;
96
97         if (i == 0) {
98                 seq_printf(p, "           ");
99                 for (j=0; j<NR_CPUS; j++)
100                         if (cpu_online(j))
101                                 seq_printf(p, "CPU%d       ",j);
102                 seq_putc(p, '\n');
103         }
104
105         if (i < NR_IRQS) {
106                 spin_lock_irqsave(&irq_desc[i].lock, flags);
107                 action = irq_desc[i].action;
108                 if (!action) 
109                         goto skip;
110                 seq_printf(p, "%3d: ",i);
111 #ifndef CONFIG_SMP
112                 seq_printf(p, "%10u ", kstat_irqs(i));
113 #else
114                 for (j = 0; j < NR_CPUS; j++)
115                         if (cpu_online(j))
116                                 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
117 #endif
118                 seq_printf(p, " %14s", irq_desc[i].handler->typename);
119                 seq_printf(p, "  %s", action->name);
120
121                 for (action=action->next; action; action = action->next)
122                         seq_printf(p, ", %s", action->name);
123
124                 seq_putc(p, '\n');
125 skip:
126                 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
127         } else if (i == NR_IRQS) {
128                 seq_printf(p, "NMI: ");
129                 for (j = 0; j < NR_CPUS; j++)
130                         if (cpu_online(j))
131                                 seq_printf(p, "%10u ", nmi_count(j));
132                 seq_putc(p, '\n');
133         }
134
135         return 0;
136 }
137
138 /*
139  * This should really return information about whether
140  * we should do bottom half handling etc. Right now we
141  * end up _always_ checking the bottom half, which is a
142  * waste of time and is not what some drivers would
143  * prefer.
144  */
145 int handle_IRQ_event(unsigned int irq, struct pt_regs * regs, 
146                      struct irqaction * action)
147 {
148         int status = 1; /* Force the "do bottom halves" bit */
149
150         if (!(action->flags & SA_INTERRUPT))
151                 local_irq_enable();
152
153         do {
154                 status |= action->flags;
155                 action->handler(irq, action->dev_id, regs);
156                 action = action->next;
157         } while (action);
158         if (status & SA_SAMPLE_RANDOM)
159                 add_interrupt_randomness(irq);
160
161         local_irq_disable();
162
163         return status;
164 }
165
166 /*
167  * Generic enable/disable code: this just calls
168  * down into the PIC-specific version for the actual
169  * hardware disable after having gotten the irq
170  * controller lock. 
171  */
172  
173 /**
174  *      disable_irq_nosync - disable an irq without waiting
175  *      @irq: Interrupt to disable
176  *
177  *      Disable the selected interrupt line. Disables of an interrupt
178  *      stack. Unlike disable_irq(), this function does not ensure existing
179  *      instances of the IRQ handler have completed before returning.
180  *
181  *      This function may be called from IRQ context.
182  */
183  
184 inline void disable_irq_nosync(unsigned int irq)
185 {
186         irq_desc_t *desc = irq_desc + irq;
187         unsigned long flags;
188
189         spin_lock_irqsave(&desc->lock, flags);
190         if (!desc->depth++) {
191                 desc->status |= IRQ_DISABLED;
192                 desc->handler->disable(irq);
193         }
194         spin_unlock_irqrestore(&desc->lock, flags);
195 }
196
197 #ifdef CONFIG_SMP
198 inline void synchronize_irq(unsigned int irq)
199 {
200         /* is there anything to synchronize with? */
201         if (!irq_desc[irq].action)
202                 return;
203  
204         while (irq_desc[irq].status & IRQ_INPROGRESS)
205                 cpu_relax();
206 }
207 #endif
208
209 /**
210  *      disable_irq - disable an irq and wait for completion
211  *      @irq: Interrupt to disable
212  *
213  *      Disable the selected interrupt line. Disables of an interrupt
214  *      stack. That is for two disables you need two enables. This
215  *      function waits for any pending IRQ handlers for this interrupt
216  *      to complete before returning. If you use this function while
217  *      holding a resource the IRQ handler may need you will deadlock.
218  *
219  *      This function may be called - with care - from IRQ context.
220  */
221  
222 void disable_irq(unsigned int irq)
223 {
224         disable_irq_nosync(irq);
225         synchronize_irq(irq);
226 }
227
228 /**
229  *      enable_irq - enable interrupt handling on an irq
230  *      @irq: Interrupt to enable
231  *
232  *      Re-enables the processing of interrupts on this IRQ line
233  *      providing no disable_irq calls are now in effect.
234  *
235  *      This function may be called from IRQ context.
236  */
237  
238 void enable_irq(unsigned int irq)
239 {
240         irq_desc_t *desc = irq_desc + irq;
241         unsigned long flags;
242
243         spin_lock_irqsave(&desc->lock, flags);
244         switch (desc->depth) {
245         case 1: {
246                 unsigned int status = desc->status & ~IRQ_DISABLED;
247                 desc->status = status;
248                 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
249                         desc->status = status | IRQ_REPLAY;
250                         hw_resend_irq(desc->handler,irq);
251                 }
252                 desc->handler->enable(irq);
253                 /* fall-through */
254         }
255         default:
256                 desc->depth--;
257                 break;
258         case 0:
259                 printk(KERN_ERR "enable_irq() unbalanced from %p\n",
260                        __builtin_return_address(0));
261         }
262         spin_unlock_irqrestore(&desc->lock, flags);
263 }
264
265 /*
266  * do_IRQ handles all normal device IRQ's (the special
267  * SMP cross-CPU interrupts have their own specific
268  * handlers).
269  */
270 unsigned int do_IRQ(int irq, union uml_pt_regs *regs)
271 {       
272         /* 
273          * 0 return value means that this irq is already being
274          * handled by some other CPU. (or is disabled)
275          */
276         irq_desc_t *desc = irq_desc + irq;
277         struct irqaction * action;
278         unsigned int status;
279
280         irq_enter();
281         kstat_this_cpu.irqs[irq]++;
282         spin_lock(&desc->lock);
283         desc->handler->ack(irq);
284         /*
285            REPLAY is when Linux resends an IRQ that was dropped earlier
286            WAITING is used by probe to mark irqs that are being tested
287            */
288         status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
289         status |= IRQ_PENDING; /* we _want_ to handle it */
290
291         /*
292          * If the IRQ is disabled for whatever reason, we cannot
293          * use the action we have.
294          */
295         action = NULL;
296         if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
297                 action = desc->action;
298                 status &= ~IRQ_PENDING; /* we commit to handling */
299                 status |= IRQ_INPROGRESS; /* we are handling it */
300         }
301         desc->status = status;
302
303         /*
304          * If there is no IRQ handler or it was disabled, exit early.
305            Since we set PENDING, if another processor is handling
306            a different instance of this same irq, the other processor
307            will take care of it.
308          */
309         if (!action)
310                 goto out;
311
312         /*
313          * Edge triggered interrupts need to remember
314          * pending events.
315          * This applies to any hw interrupts that allow a second
316          * instance of the same irq to arrive while we are in do_IRQ
317          * or in the handler. But the code here only handles the _second_
318          * instance of the irq, not the third or fourth. So it is mostly
319          * useful for irq hardware that does not mask cleanly in an
320          * SMP environment.
321          */
322         for (;;) {
323                 spin_unlock(&desc->lock);
324                 handle_IRQ_event(irq, (struct pt_regs *) regs, action);
325                 spin_lock(&desc->lock);
326                 
327                 if (!(desc->status & IRQ_PENDING))
328                         break;
329                 desc->status &= ~IRQ_PENDING;
330         }
331         desc->status &= ~IRQ_INPROGRESS;
332 out:
333         /*
334          * The ->end() handler has to deal with interrupts which got
335          * disabled while the handler was running.
336          */
337         desc->handler->end(irq);
338         spin_unlock(&desc->lock);
339
340         irq_exit();
341
342         return 1;
343 }
344
345 /**
346  *      request_irq - allocate an interrupt line
347  *      @irq: Interrupt line to allocate
348  *      @handler: Function to be called when the IRQ occurs
349  *      @irqflags: Interrupt type flags
350  *      @devname: An ascii name for the claiming device
351  *      @dev_id: A cookie passed back to the handler function
352  *
353  *      This call allocates interrupt resources and enables the
354  *      interrupt line and IRQ handling. From the point this
355  *      call is made your handler function may be invoked. Since
356  *      your handler function must clear any interrupt the board 
357  *      raises, you must take care both to initialise your hardware
358  *      and to set up the interrupt handler in the right order.
359  *
360  *      Dev_id must be globally unique. Normally the address of the
361  *      device data structure is used as the cookie. Since the handler
362  *      receives this value it makes sense to use it.
363  *
364  *      If your interrupt is shared you must pass a non NULL dev_id
365  *      as this is required when freeing the interrupt.
366  *
367  *      Flags:
368  *
369  *      SA_SHIRQ                Interrupt is shared
370  *
371  *      SA_INTERRUPT            Disable local interrupts while processing
372  *
373  *      SA_SAMPLE_RANDOM        The interrupt can be used for entropy
374  *
375  */
376  
377 int request_irq(unsigned int irq,
378                 irqreturn_t (*handler)(int, void *, struct pt_regs *),
379                 unsigned long irqflags, 
380                 const char * devname,
381                 void *dev_id)
382 {
383         int retval;
384         struct irqaction * action;
385
386 #if 1
387         /*
388          * Sanity-check: shared interrupts should REALLY pass in
389          * a real dev-ID, otherwise we'll have trouble later trying
390          * to figure out which interrupt is which (messes up the
391          * interrupt freeing logic etc).
392          */
393         if (irqflags & SA_SHIRQ) {
394                 if (!dev_id)
395                         printk(KERN_ERR "Bad boy: %s (at 0x%x) called us "
396                                "without a dev_id!\n", devname, (&irq)[-1]);
397         }
398 #endif
399
400         if (irq >= NR_IRQS)
401                 return -EINVAL;
402         if (!handler)
403                 return -EINVAL;
404
405         action = (struct irqaction *)
406                         kmalloc(sizeof(struct irqaction), GFP_KERNEL);
407         if (!action)
408                 return -ENOMEM;
409
410         action->handler = handler;
411         action->flags = irqflags;
412         action->mask = 0;
413         action->name = devname;
414         action->next = NULL;
415         action->dev_id = dev_id;
416
417         retval = setup_irq(irq, action);
418         if (retval)
419                 kfree(action);
420         return retval;
421 }
422
423 EXPORT_SYMBOL(request_irq);
424
425 int um_request_irq(unsigned int irq, int fd, int type,
426                    irqreturn_t (*handler)(int, void *, struct pt_regs *),
427                    unsigned long irqflags, const char * devname,
428                    void *dev_id)
429 {
430         int err;
431
432         err = request_irq(irq, handler, irqflags, devname, dev_id);
433         if(err) 
434                 return(err);
435
436         if(fd != -1)
437                 err = activate_fd(irq, fd, type, dev_id);
438         return(err);
439 }
440
441 /* this was setup_x86_irq but it seems pretty generic */
442 int setup_irq(unsigned int irq, struct irqaction * new)
443 {
444         int shared = 0;
445         unsigned long flags;
446         struct irqaction *old, **p;
447         irq_desc_t *desc = irq_desc + irq;
448
449         /*
450          * Some drivers like serial.c use request_irq() heavily,
451          * so we have to be careful not to interfere with a
452          * running system.
453          */
454         if (new->flags & SA_SAMPLE_RANDOM) {
455                 /*
456                  * This function might sleep, we want to call it first,
457                  * outside of the atomic block.
458                  * Yes, this might clear the entropy pool if the wrong
459                  * driver is attempted to be loaded, without actually
460                  * installing a new handler, but is this really a problem,
461                  * only the sysadmin is able to do this.
462                  */
463                 rand_initialize_irq(irq);
464         }
465
466         /*
467          * The following block of code has to be executed atomically
468          */
469         spin_lock_irqsave(&desc->lock,flags);
470         p = &desc->action;
471         old = *p;
472         if (old != NULL) {
473                 /* Can't share interrupts unless both agree to */
474                 if (!(old->flags & new->flags & SA_SHIRQ)) {
475                         spin_unlock_irqrestore(&desc->lock,flags);
476                         return -EBUSY;
477                 }
478
479                 /* add new interrupt at end of irq queue */
480                 do {
481                         p = &old->next;
482                         old = *p;
483                 } while (old);
484                 shared = 1;
485         }
486
487         *p = new;
488
489         if (!shared) {
490                 desc->depth = 0;
491                 desc->status &= ~IRQ_DISABLED;
492                 desc->handler->startup(irq);
493         }
494         spin_unlock_irqrestore(&desc->lock,flags);
495
496         register_irq_proc(irq);
497         return 0;
498 }
499
500 /**
501  *      free_irq - free an interrupt
502  *      @irq: Interrupt line to free
503  *      @dev_id: Device identity to free
504  *
505  *      Remove an interrupt handler. The handler is removed and if the
506  *      interrupt line is no longer in use by any driver it is disabled.
507  *      On a shared IRQ the caller must ensure the interrupt is disabled
508  *      on the card it drives before calling this function. The function
509  *      does not return until any executing interrupts for this IRQ
510  *      have completed.
511  *
512  *      This function may be called from interrupt context. 
513  *
514  *      Bugs: Attempting to free an irq in a handler for the same irq hangs
515  *            the machine.
516  */
517  
518 void free_irq(unsigned int irq, void *dev_id)
519 {
520         irq_desc_t *desc;
521         struct irqaction **p;
522         unsigned long flags;
523
524         if (irq >= NR_IRQS)
525                 return;
526
527         desc = irq_desc + irq;
528         spin_lock_irqsave(&desc->lock,flags);
529         p = &desc->action;
530         for (;;) {
531                 struct irqaction * action = *p;
532                 if (action) {
533                         struct irqaction **pp = p;
534                         p = &action->next;
535                         if (action->dev_id != dev_id)
536                                 continue;
537
538                         /* Found it - now remove it from the list of entries */
539                         *pp = action->next;
540                         if (!desc->action) {
541                                 desc->status |= IRQ_DISABLED;
542                                 desc->handler->shutdown(irq);
543                         }
544                         free_irq_by_irq_and_dev(irq, dev_id);
545                         spin_unlock_irqrestore(&desc->lock,flags);
546
547                         /* Wait to make sure it's not being used on another CPU */
548                         synchronize_irq(irq);
549                         kfree(action);
550                         return;
551                 }
552                 printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
553                 spin_unlock_irqrestore(&desc->lock,flags);
554                 return;
555         }
556 }
557
558 EXPORT_SYMBOL(free_irq);
559
560 /* These are initialized by sysctl_init, which is called from init/main.c */
561 static struct proc_dir_entry * root_irq_dir;
562 static struct proc_dir_entry * irq_dir [NR_IRQS];
563 static struct proc_dir_entry * smp_affinity_entry [NR_IRQS];
564
565 /* These are read and written as longs, so a read won't see a partial write
566  * even during a race.
567  */
568 static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
569
570 static int irq_affinity_read_proc (char *page, char **start, off_t off,
571                         int count, int *eof, void *data)
572 {
573         int len = cpumask_scnprintf(page, count, irq_affinity[(long)data]);
574         if (count - len < 2)
575                 return -EINVAL;
576         len += sprintf(page + len, "\n");
577         return len;
578 }
579
580 static int irq_affinity_write_proc (struct file *file, const char *buffer,
581                                         unsigned long count, void *data)
582 {
583         int irq = (long) data, full_count = count, err;
584         cpumask_t new_value;
585
586         if (!irq_desc[irq].handler->set_affinity)
587                 return -EIO;
588
589         err = cpumask_parse(buffer, count, new_value);
590         if(err)
591                 return(err);
592
593 #ifdef CONFIG_SMP
594         /*
595          * Do not allow disabling IRQs completely - it's a too easy
596          * way to make the system unusable accidentally :-) At least
597          * one online CPU still has to be targeted.
598          */
599         { cpumask_t tmp;
600           cpus_and(tmp, new_value, cpu_online_map);
601           if (cpus_empty(tmp))
602                   return -EINVAL;
603         }
604 #endif
605
606         irq_affinity[irq] = new_value;
607         irq_desc[irq].handler->set_affinity(irq, new_value);
608
609         return full_count;
610 }
611
612 static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
613                         int count, int *eof, void *data)
614 {
615         int len = cpumask_scnprintf(page, count, *(cpumask_t *)data);
616         if (count - len < 2)
617                 return -EINVAL;
618         len += sprintf(page + len, "\n");
619         return len;
620 }
621
622 static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
623                                         unsigned long count, void *data)
624 {
625         cpumask_t *mask = (cpumask_t *)data, new_value;
626         unsigned long full_count = count, err;
627
628         err = cpumask_parse(buffer, count, new_value);
629         if (err)
630                 return err;
631
632         *mask = new_value;
633         return full_count;
634 }
635
636 #define MAX_NAMELEN 10
637
638 static void register_irq_proc (unsigned int irq)
639 {
640         struct proc_dir_entry *entry;
641         char name [MAX_NAMELEN];
642
643         if (!root_irq_dir || (irq_desc[irq].handler == &no_irq_type) ||
644             irq_dir[irq])
645                 return;
646
647         memset(name, 0, MAX_NAMELEN);
648         sprintf(name, "%d", irq);
649
650         /* create /proc/irq/1234 */
651         irq_dir[irq] = proc_mkdir(name, root_irq_dir);
652
653         /* create /proc/irq/1234/smp_affinity */
654         entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
655
656         entry->nlink = 1;
657         entry->data = (void *)(long)irq;
658         entry->read_proc = irq_affinity_read_proc;
659         entry->write_proc = irq_affinity_write_proc;
660
661         smp_affinity_entry[irq] = entry;
662 }
663
664 /* Read and written as a long */
665 cpumask_t prof_cpu_mask = CPU_MASK_ALL;
666
667 void __init init_irq_proc (void)
668 {
669         struct proc_dir_entry *entry;
670         int i;
671
672         /* create /proc/irq */
673         root_irq_dir = proc_mkdir("irq", 0);
674
675         /* create /proc/irq/prof_cpu_mask */
676         entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
677
678         entry->nlink = 1;
679         entry->data = (void *)&prof_cpu_mask;
680         entry->read_proc = prof_cpu_mask_read_proc;
681         entry->write_proc = prof_cpu_mask_write_proc;
682
683         /*
684          * Create entries for all existing IRQs.
685          */
686         for (i = 0; i < NR_IRQS; i++)
687                 register_irq_proc(i);
688 }
689
690 static spinlock_t irq_spinlock = SPIN_LOCK_UNLOCKED;
691
692 unsigned long irq_lock(void)
693 {
694         unsigned long flags;
695
696         spin_lock_irqsave(&irq_spinlock, flags);
697         return(flags);
698 }
699
700 void irq_unlock(unsigned long flags)
701 {
702         spin_unlock_irqrestore(&irq_spinlock, flags);
703 }
704
705 unsigned long probe_irq_on(void)
706 {
707         return(0);
708 }
709
710 EXPORT_SYMBOL(probe_irq_on);
711
712 int probe_irq_off(unsigned long val)
713 {
714         return(0);
715 }
716
717 EXPORT_SYMBOL(probe_irq_off);
718
719 static unsigned int startup_SIGIO_irq(unsigned int irq)
720 {
721         return(0);
722 }
723
724 static void shutdown_SIGIO_irq(unsigned int irq)
725 {
726 }
727
728 static void enable_SIGIO_irq(unsigned int irq)
729 {
730 }
731
732 static void disable_SIGIO_irq(unsigned int irq)
733 {
734 }
735
736 static void mask_and_ack_SIGIO(unsigned int irq)
737 {
738 }
739
740 static void end_SIGIO_irq(unsigned int irq)
741 {
742 }
743
744 static unsigned int startup_SIGVTALRM_irq(unsigned int irq)
745 {
746         return(0);
747 }
748
749 static void shutdown_SIGVTALRM_irq(unsigned int irq)
750 {
751 }
752
753 static void enable_SIGVTALRM_irq(unsigned int irq)
754 {
755 }
756
757 static void disable_SIGVTALRM_irq(unsigned int irq)
758 {
759 }
760
761 static void mask_and_ack_SIGVTALRM(unsigned int irq)
762 {
763 }
764
765 static void end_SIGVTALRM_irq(unsigned int irq)
766 {
767 }
768
769 static struct hw_interrupt_type SIGIO_irq_type = {
770         "SIGIO",
771         startup_SIGIO_irq,
772         shutdown_SIGIO_irq,
773         enable_SIGIO_irq,
774         disable_SIGIO_irq,
775         mask_and_ack_SIGIO,
776         end_SIGIO_irq,
777         NULL
778 };
779
780 static struct hw_interrupt_type SIGVTALRM_irq_type = {
781         "SIGVTALRM",
782         startup_SIGVTALRM_irq,
783         shutdown_SIGVTALRM_irq,
784         enable_SIGVTALRM_irq,
785         disable_SIGVTALRM_irq,
786         mask_and_ack_SIGVTALRM,
787         end_SIGVTALRM_irq,
788         NULL
789 };
790
791 void __init init_IRQ(void)
792 {
793         int i;
794
795         irq_desc[TIMER_IRQ].status = IRQ_DISABLED;
796         irq_desc[TIMER_IRQ].action = 0;
797         irq_desc[TIMER_IRQ].depth = 1;
798         irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type;
799         enable_irq(TIMER_IRQ);
800         for(i=1;i<NR_IRQS;i++){
801                 irq_desc[i].status = IRQ_DISABLED;
802                 irq_desc[i].action = 0;
803                 irq_desc[i].depth = 1;
804                 irq_desc[i].handler = &SIGIO_irq_type;
805                 enable_irq(i);
806         }
807         init_irq_signals(0);
808 }
809
810 /*
811  * Overrides for Emacs so that we follow Linus's tabbing style.
812  * Emacs will notice this stuff at the end of the file and automatically
813  * adjust the settings for this buffer only.  This must remain at the end
814  * of the file.
815  * ---------------------------------------------------------------------------
816  * Local variables:
817  * c-file-style: "linux"
818  * End:
819  */