Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations
interrupt.h File Reference
#include <linux/kernel.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
#include <linux/preempt.h>
#include <linux/cpumask.h>
#include <linux/irqreturn.h>
#include <linux/irqnr.h>
#include <linux/hardirq.h>
#include <linux/irqflags.h>
#include <linux/smp.h>
#include <linux/percpu.h>
#include <linux/hrtimer.h>
#include <linux/kref.h>
#include <linux/workqueue.h>
#include <linux/atomic.h>
#include <asm/ptrace.h>

Go to the source code of this file.

Data Structures

struct  irqaction
 
struct  softirq_action
 
struct  tasklet_struct
 
struct  tasklet_hrtimer
 

Macros

#define IRQF_TRIGGER_NONE   0x00000000
 
#define IRQF_TRIGGER_RISING   0x00000001
 
#define IRQF_TRIGGER_FALLING   0x00000002
 
#define IRQF_TRIGGER_HIGH   0x00000004
 
#define IRQF_TRIGGER_LOW   0x00000008
 
#define IRQF_TRIGGER_MASK
 
#define IRQF_TRIGGER_PROBE   0x00000010
 
#define IRQF_DISABLED   0x00000020
 
#define IRQF_SHARED   0x00000080
 
#define IRQF_PROBE_SHARED   0x00000100
 
#define __IRQF_TIMER   0x00000200
 
#define IRQF_PERCPU   0x00000400
 
#define IRQF_NOBALANCING   0x00000800
 
#define IRQF_IRQPOLL   0x00001000
 
#define IRQF_ONESHOT   0x00002000
 
#define IRQF_NO_SUSPEND   0x00004000
 
#define IRQF_FORCE_RESUME   0x00008000
 
#define IRQF_NO_THREAD   0x00010000
 
#define IRQF_EARLY_RESUME   0x00020000
 
#define IRQF_TIMER   (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
 

Typedefs

typedef irqreturn_t(* irq_handler_t )(int, void *)
 

Enumerations

enum  { IRQC_IS_HARDIRQ = 0, IRQC_IS_NESTED }
 

: name of the device

struct irqaction - per interrupt action descriptor : interrupt handler function

: cookie to identify the device : cookie to identify the device : pointer to the next irqaction for shared interrupts : interrupt number : flags (see IRQF_* above) : interrupt handler function for threaded interrupts : thread pointer for threaded interrupts : flags related to : bitmask for keeping track of activity

#define local_irq_enable_in_hardirq()   local_irq_enable()
 
#define disable_irq_nosync_lockdep(irq)   disable_irq_nosync(irq)
 
#define disable_irq_nosync_lockdep_irqsave(irq, flags)   disable_irq_nosync(irq)
 
#define disable_irq_lockdep(irq)   disable_irq(irq)
 
#define enable_irq_lockdep(irq)   enable_irq(irq)
 
#define enable_irq_lockdep_irqrestore(irq, flags)   enable_irq(irq)
 
#define force_irqthreads   (0)
 
#define set_softirq_pending(x)   (local_softirq_pending() = (x))
 
#define or_softirq_pending(x)   (local_softirq_pending() |= (x))
 
#define hard_irq_disable()   do { } while(0)
 
#define SOFTIRQ_STOP_IDLE_MASK   (~(1 << RCU_SOFTIRQ))
 
#define DECLARE_TASKLET(name, func, data)   struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
 
#define DECLARE_TASKLET_DISABLED(name, func, data)   struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
 
#define tasklet_trylock(t)   1
 
#define tasklet_unlock_wait(t)   do { } while (0)
 
#define tasklet_unlock(t)   do { } while (0)
 
enum  {
  HI_SOFTIRQ =0, TIMER_SOFTIRQ, NET_TX_SOFTIRQ, NET_RX_SOFTIRQ,
  BLOCK_SOFTIRQ, BLOCK_IOPOLL_SOFTIRQ, TASKLET_SOFTIRQ, SCHED_SOFTIRQ,
  HRTIMER_SOFTIRQ, RCU_SOFTIRQ, NR_SOFTIRQS
}
 
enum  { TASKLET_STATE_SCHED, TASKLET_STATE_RUN }
 
struct irqaction ____cacheline_internodealigned_in_smp
 
charsoftirq_to_name [NR_SOFTIRQS]
 
irqreturn_t no_action (int cpl, void *dev_id)
 
int __must_check request_irq (unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev)
 
void free_irq (unsigned int, void *)
 
void free_percpu_irq (unsigned int, void __percpu *)
 
int __must_check devm_request_threaded_irq (struct device *dev, unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long irqflags, const char *devname, void *dev_id)
 
void devm_free_irq (struct device *dev, unsigned int irq, void *dev_id)
 
void disable_irq_nosync (unsigned int irq)
 
void disable_irq (unsigned int irq)
 
void disable_percpu_irq (unsigned int irq)
 
void enable_irq (unsigned int irq)
 
void enable_percpu_irq (unsigned int irq, unsigned int type)
 
asmlinkage void do_softirq (void)
 
asmlinkage void __do_softirq (void)
 
void open_softirq (int nr, void(*action)(struct softirq_action *))
 
void softirq_init (void)
 
void __raise_softirq_irqoff (unsigned int nr)
 
void raise_softirq_irqoff (unsigned int nr)
 
void raise_softirq (unsigned int nr)
 
 DECLARE_PER_CPU (struct list_head[NR_SOFTIRQS], softirq_work_list)
 
 DECLARE_PER_CPU (struct task_struct *, ksoftirqd)
 
void send_remote_softirq (struct call_single_data *cp, int cpu, int softirq)
 
void __send_remote_softirq (struct call_single_data *cp, int cpu, int this_cpu, int softirq)
 
void __tasklet_schedule (struct tasklet_struct *t)
 
void __tasklet_hi_schedule (struct tasklet_struct *t)
 
void __tasklet_hi_schedule_first (struct tasklet_struct *t)
 
void tasklet_kill (struct tasklet_struct *t)
 
void tasklet_kill_immediate (struct tasklet_struct *t, unsigned int cpu)
 
void tasklet_init (struct tasklet_struct *t, void(*func)(unsigned long), unsigned long data)
 
void tasklet_hrtimer_init (struct tasklet_hrtimer *ttimer, enum hrtimer_restart(*function)(struct hrtimer *), clockid_t which_clock, enum hrtimer_mode mode)
 
unsigned long probe_irq_on (void)
 
int probe_irq_off (unsigned long)
 
unsigned int probe_irq_mask (unsigned long)
 
int show_interrupts (struct seq_file *p, void *v)
 
int arch_show_interrupts (struct seq_file *p, int prec)
 
int early_irq_init (void)
 
int arch_probe_nr_irqs (void)
 
int arch_early_irq_init (void)
 

Macro Definition Documentation

#define __IRQF_TIMER   0x00000200

Definition at line 65 of file interrupt.h.

#define DECLARE_TASKLET (   name,
  func,
  data 
)    struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }

Definition at line 514 of file interrupt.h.

#define DECLARE_TASKLET_DISABLED (   name,
  func,
  data 
)    struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }

Definition at line 517 of file interrupt.h.

#define disable_irq_lockdep (   irq)    disable_irq(irq)

Definition at line 372 of file interrupt.h.

#define disable_irq_nosync_lockdep (   irq)    disable_irq_nosync(irq)

Definition at line 369 of file interrupt.h.

#define disable_irq_nosync_lockdep_irqsave (   irq,
  flags 
)    disable_irq_nosync(irq)

Definition at line 370 of file interrupt.h.

#define enable_irq_lockdep (   irq)    enable_irq(irq)

Definition at line 373 of file interrupt.h.

#define enable_irq_lockdep_irqrestore (   irq,
  flags 
)    enable_irq(irq)

Definition at line 374 of file interrupt.h.

#define force_irqthreads   (0)

Definition at line 393 of file interrupt.h.

#define hard_irq_disable ( )    do { } while(0)

Definition at line 408 of file interrupt.h.

#define IRQF_DISABLED   0x00000020

Definition at line 62 of file interrupt.h.

#define IRQF_EARLY_RESUME   0x00020000

Definition at line 73 of file interrupt.h.

#define IRQF_FORCE_RESUME   0x00008000

Definition at line 71 of file interrupt.h.

#define IRQF_IRQPOLL   0x00001000

Definition at line 68 of file interrupt.h.

#define IRQF_NO_SUSPEND   0x00004000

Definition at line 70 of file interrupt.h.

#define IRQF_NO_THREAD   0x00010000

Definition at line 72 of file interrupt.h.

#define IRQF_NOBALANCING   0x00000800

Definition at line 67 of file interrupt.h.

#define IRQF_ONESHOT   0x00002000

Definition at line 69 of file interrupt.h.

#define IRQF_PERCPU   0x00000400

Definition at line 66 of file interrupt.h.

#define IRQF_PROBE_SHARED   0x00000100

Definition at line 64 of file interrupt.h.

#define IRQF_SHARED   0x00000080

Definition at line 63 of file interrupt.h.

#define IRQF_TIMER   (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)

Definition at line 75 of file interrupt.h.

#define IRQF_TRIGGER_FALLING   0x00000002

Definition at line 32 of file interrupt.h.

#define IRQF_TRIGGER_HIGH   0x00000004

Definition at line 33 of file interrupt.h.

#define IRQF_TRIGGER_LOW   0x00000008

Definition at line 34 of file interrupt.h.

#define IRQF_TRIGGER_MASK
Value:

Definition at line 35 of file interrupt.h.

#define IRQF_TRIGGER_NONE   0x00000000

Definition at line 30 of file interrupt.h.

#define IRQF_TRIGGER_PROBE   0x00000010

Definition at line 37 of file interrupt.h.

#define IRQF_TRIGGER_RISING   0x00000001

Definition at line 31 of file interrupt.h.

#define local_irq_enable_in_hardirq ( )    local_irq_enable()

Definition at line 214 of file interrupt.h.

#define or_softirq_pending (   x)    (local_softirq_pending() |= (x))

Definition at line 398 of file interrupt.h.

#define set_softirq_pending (   x)    (local_softirq_pending() = (x))

Definition at line 397 of file interrupt.h.

#define SOFTIRQ_STOP_IDLE_MASK   (~(1 << RCU_SOFTIRQ))

Definition at line 433 of file interrupt.h.

#define tasklet_trylock (   t)    1

Definition at line 544 of file interrupt.h.

#define tasklet_unlock (   t)    do { } while (0)

Definition at line 546 of file interrupt.h.

#define tasklet_unlock_wait (   t)    do { } while (0)

Definition at line 545 of file interrupt.h.

Typedef Documentation

typedef irqreturn_t(* irq_handler_t)(int, void *)

Definition at line 89 of file interrupt.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
IRQC_IS_HARDIRQ 
IRQC_IS_NESTED 

Definition at line 84 of file interrupt.h.

anonymous enum
Enumerator:
HI_SOFTIRQ 
TIMER_SOFTIRQ 
NET_TX_SOFTIRQ 
NET_RX_SOFTIRQ 
BLOCK_SOFTIRQ 
BLOCK_IOPOLL_SOFTIRQ 
TASKLET_SOFTIRQ 
SCHED_SOFTIRQ 
HRTIMER_SOFTIRQ 
RCU_SOFTIRQ 
NR_SOFTIRQS 

Definition at line 417 of file interrupt.h.

anonymous enum
Enumerator:
TASKLET_STATE_SCHED 
TASKLET_STATE_RUN 

Definition at line 521 of file interrupt.h.

Function Documentation

asmlinkage void __do_softirq ( void  )

Definition at line 208 of file softirq.c.

void __raise_softirq_irqoff ( unsigned int  nr)

Definition at line 388 of file softirq.c.

void __send_remote_softirq ( struct call_single_data cp,
int  cpu,
int  this_cpu,
int  softirq 
)

__send_remote_softirq - try to schedule softirq work on a remote cpu : private SMP call function data area : the remote cpu : the currently executing cpu : the softirq for the work

Attempt to schedule softirq work on a remote cpu. If this cannot be done, the work is instead queued up on the local cpu.

Interrupts must be disabled.

Definition at line 664 of file softirq.c.

void __tasklet_hi_schedule ( struct tasklet_struct t)

Definition at line 425 of file softirq.c.

void __tasklet_hi_schedule_first ( struct tasklet_struct t)

Definition at line 439 of file softirq.c.

void __tasklet_schedule ( struct tasklet_struct t)

Definition at line 411 of file softirq.c.

int arch_early_irq_init ( void  )

Definition at line 667 of file irq.c.

int arch_probe_nr_irqs ( void  )

Definition at line 3490 of file io_apic.c.

int arch_show_interrupts ( struct seq_file p,
int  prec 
)

Definition at line 69 of file irq.c.

DECLARE_PER_CPU ( struct list_head  [NR_SOFTIRQS],
softirq_work_list   
)
DECLARE_PER_CPU ( struct task_struct ,
ksoftirqd   
)
void devm_free_irq ( struct device dev,
unsigned int  irq,
void dev_id 
)

devm_free_irq - free an interrupt : device to free interrupt for : Interrupt line to free : Device identity to free

Except for the extra argument, this function takes the same arguments and performs the same function as free_irq(). This function instead of free_irq() should be used to manually free IRQs allocated with devm_request_irq().

Definition at line 86 of file devres.c.

int __must_check devm_request_threaded_irq ( struct device dev,
unsigned int  irq,
irq_handler_t  handler,
irq_handler_t  thread_fn,
unsigned long  irqflags,
const char devname,
void dev_id 
)

devm_request_threaded_irq - allocate an interrupt line for a managed device : device to request interrupt for : Interrupt line to allocate : Function to be called when the IRQ occurs : function to be called in a threaded interrupt context. NULL for devices which handle everything in : Interrupt type flags : An ascii name for the claiming device : A cookie passed back to the handler function

Except for the extra argument, this function takes the same arguments and performs the same function as request_irq(). IRQs requested with this function will be automatically freed on driver detach.

If an IRQ allocated with this function needs to be freed separately, devm_free_irq() must be used.

Definition at line 47 of file devres.c.

void disable_irq ( unsigned int  irq)

disable_irq - disable an irq and wait for completion : Interrupt to disable

Disable the selected interrupt line. Enables and Disables are nested. This function waits for any pending IRQ handlers for this interrupt to complete before returning. If you use this function while holding a resource the IRQ handler may need you will deadlock.

This function may be called - with care - from IRQ context.

Definition at line 412 of file manage.c.

void disable_irq_nosync ( unsigned int  irq)

disable_irq_nosync - disable an irq without waiting : Interrupt to disable

Disable the selected interrupt line. Disables and Enables are nested. Unlike disable_irq(), this function does not ensure existing instances of the IRQ handler have completed before returning.

This function may be called from IRQ context.

Definition at line 394 of file manage.c.

void disable_percpu_irq ( unsigned int  irq)

Definition at line 1491 of file manage.c.

asmlinkage void do_softirq ( void  )

Definition at line 609 of file irq.c.

int early_irq_init ( void  )

Definition at line 251 of file irqdesc.c.

void enable_irq ( unsigned int  irq)

enable_irq - enable handling of an irq : Interrupt to enable

Undoes the effect of one call to disable_irq(). If this matches the last disable, processing of interrupts on this IRQ line is re-enabled.

This function may be called from IRQ context only when desc->irq_data.chip->bus_lock and desc->chip->bus_sync_unlock are NULL !

Definition at line 463 of file manage.c.

void enable_percpu_irq ( unsigned int  irq,
unsigned int  type 
)

Definition at line 1465 of file manage.c.

void free_irq ( unsigned int  irq,
void dev_id 
)

free_irq - free an interrupt allocated with request_irq : Interrupt line to free : Device identity to free

Remove an interrupt handler. The handler is removed and if the interrupt line is no longer in use by any driver it is disabled. On a shared IRQ the caller must ensure the interrupt is disabled on the card it drives before calling this function. The function does not return until any executing interrupts for this IRQ have completed.

This function must not be called from interrupt context.

Definition at line 1297 of file manage.c.

void free_percpu_irq ( unsigned int  irq,
void __percpu dev_id 
)

free_percpu_irq - free an interrupt allocated with request_percpu_irq : Interrupt line to free : Device identity to free

Remove a percpu interrupt handler. The handler is removed, but the interrupt line is not disabled. This must be done on each CPU before calling this function. The function does not return until any executing interrupts for this IRQ have completed.

This function must not be called from interrupt context.

Definition at line 1574 of file manage.c.

irqreturn_t no_action ( int  cpl,
void dev_id 
)

Definition at line 40 of file handle.c.

void open_softirq ( int  nr,
void(*)(struct softirq_action *)  action 
)

Definition at line 394 of file softirq.c.

unsigned int probe_irq_mask ( unsigned long  val)

probe_irq_mask - scan a bitmap of interrupt lines : mask of interrupts to consider

Scan the interrupt lines and return a bitmap of active autodetect interrupts. The interrupt probe logic state is then returned to its previous value.

Note: we need to scan all the irq's even though we will only return autodetect irq numbers - just so that we reset them all to a known state.

Definition at line 118 of file autoprobe.c.

int probe_irq_off ( unsigned long  val)

probe_irq_off - end an interrupt autodetect : mask of potential interrupts (unused)

Scans the unused interrupt lines and returns the line which appears to have triggered the interrupt. If no interrupt was found then zero is returned. If more than one interrupt is found then minus the first candidate is returned to indicate their is doubt.

The interrupt probe logic state is returned to its previous value.

BUGS: When used in a module (which arguably shouldn't happen) nothing prevents two IRQ probe callers from overlapping. The results of this are non-optimal.

Definition at line 158 of file autoprobe.c.

unsigned long probe_irq_on ( void  )

probe_irq_on - begin an interrupt autodetect

Commence probing for an interrupt. The interrupts are scanned and a mask of potential interrupt lines is returned.

Definition at line 31 of file autoprobe.c.

void raise_softirq ( unsigned int  nr)

Definition at line 379 of file softirq.c.

void raise_softirq_irqoff ( unsigned int  nr)
inline

Definition at line 362 of file softirq.c.

int __must_check request_irq ( unsigned int  irq,
irq_handler_t  handler,
unsigned long  flags,
const char name,
void dev 
)
void send_remote_softirq ( struct call_single_data cp,
int  cpu,
int  softirq 
)

send_remote_softirq - try to schedule softirq work on a remote cpu : private SMP call function data area : the remote cpu : the softirq for the work

Like __send_remote_softirq except that disabling interrupts and computing the current cpu is done for the caller.

Definition at line 680 of file softirq.c.

int show_interrupts ( struct seq_file p,
void v 
)

Definition at line 155 of file irq.c.

void softirq_init ( void  )

Definition at line 725 of file softirq.c.

void tasklet_hrtimer_init ( struct tasklet_hrtimer ttimer,
enum hrtimer_restart(*)(struct hrtimer *)  function,
clockid_t  which_clock,
enum hrtimer_mode  mode 
)

tasklet_hrtimer_init - Init a tasklet/hrtimer combo for softirq callbacks : tasklet_hrtimer which is initialized : hrtimer callback function which gets called from softirq context : clock id (CLOCK_MONOTONIC/CLOCK_REALTIME) : hrtimer mode (HRTIMER_MODE_ABS/HRTIMER_MODE_REL)

Definition at line 588 of file softirq.c.

void tasklet_init ( struct tasklet_struct t,
void(*)(unsigned long func,
unsigned long  data 
)

Definition at line 521 of file softirq.c.

void tasklet_kill ( struct tasklet_struct t)

Definition at line 533 of file softirq.c.

void tasklet_kill_immediate ( struct tasklet_struct t,
unsigned int  cpu 
)

Variable Documentation

struct irqaction ____cacheline_internodealigned_in_smp
char* softirq_to_name[NR_SOFTIRQS]

Definition at line 60 of file softirq.c.