home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / Linux / irq.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  3KB  |  86 lines

  1. /* $Id: irq.h,v 1.2 2002/04/26 23:09:08 smilcke Exp $ */
  2.  
  3. #ifndef __irq_h
  4. #define __irq_h
  5.  
  6. /*
  7.  * Please do not include this file in generic code.  There is currently
  8.  * no requirement for any architecture to implement anything held
  9.  * within this file.
  10.  *
  11.  * Thanks. --rmk
  12.  */
  13.  
  14. #ifdef TARGET_OS2
  15. #define ____cacheline_aligned
  16. #endif
  17.  
  18. #include <linux/config.h>
  19.  
  20. #if !defined(CONFIG_ARCH_S390)
  21.  
  22. #include <linux/cache.h>
  23. #include <linux/spinlock.h>
  24.  
  25. #include <asm/irq.h>
  26. #include <asm/ptrace.h>
  27.  
  28. /*
  29.  * IRQ line status.
  30.  */
  31. #define IRQ_INPROGRESS    1    /* IRQ handler active - do not enter! */
  32. #define IRQ_DISABLED    2    /* IRQ disabled - do not enter! */
  33. #define IRQ_PENDING    4    /* IRQ pending - replay on enable */
  34. #define IRQ_REPLAY    8    /* IRQ has been replayed but not acked yet */
  35. #define IRQ_AUTODETECT    16    /* IRQ is being autodetected */
  36. #define IRQ_WAITING    32    /* IRQ not yet seen - for autodetection */
  37. #define IRQ_LEVEL    64    /* IRQ level triggered */
  38. #define IRQ_MASKED    128    /* IRQ masked - shouldn't be seen again */
  39. #define IRQ_PER_CPU    256    /* IRQ is per CPU */
  40.  
  41. /*
  42.  * Interrupt controller descriptor. This is all we need
  43.  * to describe about the low-level hardware.
  44.  */
  45. struct hw_interrupt_type {
  46.     const char * typename;
  47.     unsigned int (*startup)(unsigned int irq);
  48.     void (*shutdown)(unsigned int irq);
  49.     void (*enable)(unsigned int irq);
  50.     void (*disable)(unsigned int irq);
  51.     void (*ack)(unsigned int irq);
  52.     void (*end)(unsigned int irq);
  53.     void (*set_affinity)(unsigned int irq, unsigned long mask);
  54. };
  55.  
  56. typedef struct hw_interrupt_type  hw_irq_controller;
  57.  
  58. /*
  59.  * This is the "IRQ descriptor", which contains various information
  60.  * about the irq, including what kind of hardware handling it has,
  61.  * whether it is disabled etc etc.
  62.  *
  63.  * Pad this out to 32 bytes for cache and indexing reasons.
  64.  */
  65. typedef struct {
  66.     unsigned int status;        /* IRQ status */
  67.     hw_irq_controller *handler;
  68.     struct irqaction *action;    /* IRQ action list */
  69.     unsigned int depth;        /* nested irq disables */
  70.     spinlock_t lock;
  71. } ____cacheline_aligned irq_desc_t;
  72.  
  73. extern irq_desc_t irq_desc [NR_IRQS];
  74.  
  75. #include <asm/hw_irq.h> /* the arch dependent stuff */
  76.  
  77. extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
  78. extern int setup_irq(unsigned int , struct irqaction * );
  79.  
  80. extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
  81. extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
  82.  
  83. #endif
  84.  
  85. #endif /* __asm_h */
  86.