blob: f48592fcbdb9469a9f36e9789d89e8f1f8573dbb [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_INTERRUPT_H
13#define _LINUX_INTERRUPT_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/kernel.h>
16#include <linux/linkage.h>
17#include <linux/bitops.h>
18#include <linux/preempt.h>
19#include <linux/cpumask.h>
20#include <linux/irqreturn.h>
21#include <linux/hardirq.h>
22#include <linux/sched.h>
23#include <linux/irqflags.h>
24#include <asm/atomic.h>
25#include <asm/ptrace.h>
26#include <asm/system.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080027
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080028#define IRQF_TRIGGER_NONE 0x00000000
29#define IRQF_TRIGGER_RISING 0x00000001
30#define IRQF_TRIGGER_FALLING 0x00000002
31#define IRQF_TRIGGER_HIGH 0x00000004
32#define IRQF_TRIGGER_LOW 0x00000008
33#define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
34#define IRQF_TRIGGER_PROBE 0x00000010
Ben Cheng4b29af02012-03-07 16:14:53 -080035
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036#define IRQF_DISABLED 0x00000020
37#define IRQF_SAMPLE_RANDOM 0x00000040
38#define IRQF_SHARED 0x00000080
39#define IRQF_PROBE_SHARED 0x00000100
40#define IRQF_TIMER 0x00000200
41#define IRQF_PERCPU 0x00000400
Ben Cheng4b29af02012-03-07 16:14:53 -080042
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080043#define SA_INTERRUPT IRQF_DISABLED
44#define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM
45#define SA_SHIRQ IRQF_SHARED
46#define SA_PROBEIRQ IRQF_PROBE_SHARED
47#define SA_PERCPU IRQF_PERCPU
Ben Cheng4b29af02012-03-07 16:14:53 -080048
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define SA_TRIGGER_LOW IRQF_TRIGGER_LOW
50#define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH
51#define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING
52#define SA_TRIGGER_RISING IRQF_TRIGGER_RISING
53#define SA_TRIGGER_MASK IRQF_TRIGGER_MASK
Ben Cheng4b29af02012-03-07 16:14:53 -080054
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080055struct irqaction {
56 irqreturn_t (*handler)(int, void *, struct pt_regs *);
57 unsigned long flags;
58 cpumask_t mask;
59 const char *name;
60 void *dev_id;
61 struct irqaction *next;
62 int irq;
63 struct proc_dir_entry *dir;
64};
Ben Cheng4b29af02012-03-07 16:14:53 -080065
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080066#define local_irq_enable_in_hardirq() local_irq_enable()
Ben Cheng4b29af02012-03-07 16:14:53 -080067
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080068#define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
69#define disable_irq_lockdep(irq) disable_irq(irq)
70#define enable_irq_lockdep(irq) enable_irq(irq)
Ben Cheng4b29af02012-03-07 16:14:53 -080071
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080072#ifndef __ARCH_SET_SOFTIRQ_PENDING
73#define set_softirq_pending(x) (local_softirq_pending() = (x))
74#define or_softirq_pending(x) (local_softirq_pending() |= (x))
75#endif
Ben Cheng4b29af02012-03-07 16:14:53 -080076
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080077#define save_flags(x) save_flags(&x)
78#define save_and_cli(x) save_and_cli(&x)
Ben Cheng4b29af02012-03-07 16:14:53 -080079
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080080enum
81{
82 HI_SOFTIRQ=0,
83 TIMER_SOFTIRQ,
84 NET_TX_SOFTIRQ,
85 NET_RX_SOFTIRQ,
86 BLOCK_SOFTIRQ,
87 TASKLET_SOFTIRQ
88};
Ben Cheng4b29af02012-03-07 16:14:53 -080089
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080090struct softirq_action
91{
92 void (*action)(struct softirq_action *);
93 void *data;
94};
Ben Cheng4b29af02012-03-07 16:14:53 -080095
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080096#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
Ben Cheng4b29af02012-03-07 16:14:53 -080097
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080098struct tasklet_struct
99{
100 struct tasklet_struct *next;
101 unsigned long state;
102 atomic_t count;
103 void (*func)(unsigned long);
104 unsigned long data;
105};
Ben Cheng4b29af02012-03-07 16:14:53 -0800106
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800107#define DECLARE_TASKLET(name, func, data) struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
Ben Cheng4b29af02012-03-07 16:14:53 -0800108
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800109#define DECLARE_TASKLET_DISABLED(name, func, data) struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
Ben Cheng4b29af02012-03-07 16:14:53 -0800110
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800111enum
112{
113 TASKLET_STATE_SCHED,
114 TASKLET_STATE_RUN
115};
Ben Cheng4b29af02012-03-07 16:14:53 -0800116
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800117#define tasklet_trylock(t) 1
118#define tasklet_unlock_wait(t) do { } while (0)
119#define tasklet_unlock(t) do { } while (0)
Ben Cheng4b29af02012-03-07 16:14:53 -0800120
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800121#endif