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