root/arch/sparc/kernel/irq.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. disable_irq
  2. enable_irq
  3. get_irq_list
  4. do_IRQ
  5. do_fast_IRQ
  6. irqaction
  7. request_irq
  8. free_irq
  9. probe_irq_on
  10. probe_irq_off
  11. init_IRQ

   1 /*  arch/sparc/kernel/irq.c:  Interrupt request handling routines. On the
   2  *                            Sparc the IRQ's are basically 'cast in stone'
   3  *                            and you are supposed to probe the prom's device
   4  *                            node trees to find out who's got which IRQ.
   5  *
   6  *  Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
   7  *
   8  */
   9 
  10 /*
  11  * IRQ's are in fact implemented a bit like signal handlers for the kernel.
  12  * The same sigaction struct is used, and with similar semantics (ie there
  13  * is a SA_INTERRUPT flag etc). Naturally it's not a 1:1 relation, but there
  14  * are similarities.
  15  *
  16  * sa_handler(int irq_NR) is the default function called (0 if no).
  17  * sa_mask is horribly ugly (I won't even mention it)
  18  * sa_flags contains various info: SA_INTERRUPT etc
  19  * sa_restorer is the unused
  20  */
  21 
  22 #include <asm/ptrace.h>
  23 #include <asm/system.h>
  24 #include <linux/linkage.h>
  25 #include <linux/kernel_stat.h>
  26 #include <linux/signal.h>
  27 
  28 void disable_irq(unsigned int irq_nr)
     /* [previous][next][first][last][top][bottom][index][help] */
  29 {
  30   unsigned long flags;
  31 
  32   save_flags(flags);
  33   restore_flags(flags);
  34   return;
  35 }
  36 
  37 void enable_irq(unsigned int irq_nr)
     /* [previous][next][first][last][top][bottom][index][help] */
  38 {
  39   unsigned long flags;
  40 
  41   save_flags(flags);
  42   restore_flags(flags);
  43   return;
  44 }
  45 
  46 int get_irq_list(char *buf)
     /* [previous][next][first][last][top][bottom][index][help] */
  47 {
  48   int len = 0;
  49 
  50   return len;
  51 }
  52 
  53 /*
  54  * do_IRQ handles IRQ's that have been installed without the
  55  * SA_INTERRUPT flag: it uses the full signal-handling return
  56  * and runs with other interrupts enabled. All relatively slow
  57  * IRQ's should use this format: notably the keyboard/timer
  58  * routines.
  59  */
  60 asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
  61 {
  62   kstat.interrupts[irq]++;
  63   return;
  64 }
  65 
  66 /*
  67  * do_fast_IRQ handles IRQ's that don't need the fancy interrupt return
  68  * stuff - the handler is also running with interrupts disabled unless
  69  * it explicitly enables them later.
  70  */
  71 asmlinkage void do_fast_IRQ(int irq)
     /* [previous][next][first][last][top][bottom][index][help] */
  72 {
  73   kstat.interrupts[irq]++;
  74   return;
  75 }
  76 
  77 #define SA_PROBE SA_ONESHOT
  78 
  79 /*
  80  * Using "struct sigaction" is slightly silly, but there
  81  * are historical reasons and it works well, so..
  82  */
  83 static int irqaction(unsigned int irq, struct sigaction * new_sa)
     /* [previous][next][first][last][top][bottom][index][help] */
  84 {
  85         unsigned long flags;
  86 
  87         save_flags(flags);
  88         restore_flags(flags);
  89         return 0;
  90 }
  91                 
  92 int request_irq(unsigned int irq, void (*handler)(int),
     /* [previous][next][first][last][top][bottom][index][help] */
  93         unsigned long flags, const char * devname)
  94 {
  95         return irqaction(irq, (struct sigaction *) 0);
  96 }
  97 
  98 void free_irq(unsigned int irq)
     /* [previous][next][first][last][top][bottom][index][help] */
  99 {
 100   unsigned long flags;
 101 
 102   save_flags(flags);
 103   restore_flags(flags);
 104   return;
 105 }
 106 
 107 unsigned int probe_irq_on (void)
     /* [previous][next][first][last][top][bottom][index][help] */
 108 {
 109   unsigned int irqs = 0;
 110 
 111   return irqs;
 112 }
 113 
 114 int probe_irq_off (unsigned int irqs)
     /* [previous][next][first][last][top][bottom][index][help] */
 115 {
 116   unsigned int i = 0;
 117 
 118   return i;
 119 }
 120 
 121 void init_IRQ(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 122 {
 123   int i;
 124 
 125   for (i = 0; i < 16 ; i++)
 126     set_intr_gate(0x20+i,bad_interrupt[i]);
 127 
 128   return;
 129 }

/* [previous][next][first][last][top][bottom][index][help] */