Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      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
     14 
     15 #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>
     27 
     28 #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
     35 
     36 #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
     42 
     43 #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
     48 
     49 #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
     54 
     55 struct 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 };
     65 
     66 #define local_irq_enable_in_hardirq() local_irq_enable()
     67 
     68 #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)
     71 
     72 #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
     76 
     77 #define save_flags(x) save_flags(&x)
     78 #define save_and_cli(x) save_and_cli(&x)
     79 
     80 enum
     81 {
     82  HI_SOFTIRQ=0,
     83  TIMER_SOFTIRQ,
     84  NET_TX_SOFTIRQ,
     85  NET_RX_SOFTIRQ,
     86  BLOCK_SOFTIRQ,
     87  TASKLET_SOFTIRQ
     88 };
     89 
     90 struct softirq_action
     91 {
     92  void (*action)(struct softirq_action *);
     93  void *data;
     94 };
     95 
     96 #define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
     97 
     98 struct 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 };
    106 
    107 #define DECLARE_TASKLET(name, func, data)  struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
    108 
    109 #define DECLARE_TASKLET_DISABLED(name, func, data)  struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
    110 
    111 enum
    112 {
    113  TASKLET_STATE_SCHED,
    114  TASKLET_STATE_RUN
    115 };
    116 
    117 #define tasklet_trylock(t) 1
    118 #define tasklet_unlock_wait(t) do { } while (0)
    119 #define tasklet_unlock(t) do { } while (0)
    120 
    121 #endif
    122