Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 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
 */
40
struct 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
 
51
typedef 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
 */
60
typedef 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
 
70
extern irq_desc_t irq_desc [NR_IRQS];
71
 
72
#include <asm/hw_irq.h> /* the arch dependent stuff */
73
 
74
extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
75
extern int setup_irq(unsigned int , struct irqaction * );
76
 
77
extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
78
 
79
#endif
80
 
81
#endif /* __irq_h */