Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
hardirq.h File Reference
#include <linux/preempt.h>
#include <linux/lockdep.h>
#include <linux/ftrace_irq.h>
#include <asm/hardirq.h>

Go to the source code of this file.

Macros

#define PREEMPT_BITS   8
 
#define SOFTIRQ_BITS   8
 
#define NMI_BITS   1
 
#define MAX_HARDIRQ_BITS   10
 
#define HARDIRQ_BITS   MAX_HARDIRQ_BITS
 
#define PREEMPT_SHIFT   0
 
#define SOFTIRQ_SHIFT   (PREEMPT_SHIFT + PREEMPT_BITS)
 
#define HARDIRQ_SHIFT   (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
#define NMI_SHIFT   (HARDIRQ_SHIFT + HARDIRQ_BITS)
 
#define __IRQ_MASK(x)   ((1UL << (x))-1)
 
#define PREEMPT_MASK   (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
 
#define SOFTIRQ_MASK   (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
 
#define HARDIRQ_MASK   (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
 
#define NMI_MASK   (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
 
#define PREEMPT_OFFSET   (1UL << PREEMPT_SHIFT)
 
#define SOFTIRQ_OFFSET   (1UL << SOFTIRQ_SHIFT)
 
#define HARDIRQ_OFFSET   (1UL << HARDIRQ_SHIFT)
 
#define NMI_OFFSET   (1UL << NMI_SHIFT)
 
#define SOFTIRQ_DISABLE_OFFSET   (2 * SOFTIRQ_OFFSET)
 
#define PREEMPT_ACTIVE_BITS   1
 
#define PREEMPT_ACTIVE_SHIFT   (NMI_SHIFT + NMI_BITS)
 
#define PREEMPT_ACTIVE   (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
 
#define hardirq_count()   (preempt_count() & HARDIRQ_MASK)
 
#define softirq_count()   (preempt_count() & SOFTIRQ_MASK)
 
#define irq_count()
 
#define in_irq()   (hardirq_count())
 
#define in_softirq()   (softirq_count())
 
#define in_interrupt()   (irq_count())
 
#define in_serving_softirq()   (softirq_count() & SOFTIRQ_OFFSET)
 
#define in_nmi()   (preempt_count() & NMI_MASK)
 
#define PREEMPT_CHECK_OFFSET   0
 
#define in_atomic()   ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
 
#define in_atomic_preempt_off()   ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
 
#define preemptible()   0
 
#define IRQ_EXIT_OFFSET   HARDIRQ_OFFSET
 
#define synchronize_irq(irq)   barrier()
 
#define __irq_enter()
 
#define __irq_exit()
 
#define nmi_enter()
 
#define nmi_exit()
 

Functions

void rcu_nmi_enter (void)
 
void rcu_nmi_exit (void)
 
void irq_enter (void)
 
void irq_exit (void)
 

Macro Definition Documentation

#define __irq_enter ( )
Value:
do { \
vtime_account(current); \
add_preempt_count(HARDIRQ_OFFSET); \
trace_hardirq_enter(); \
} while (0)

Definition at line 163 of file hardirq.h.

#define __irq_exit ( )
Value:
do { \
trace_hardirq_exit(); \
vtime_account(current); \
sub_preempt_count(HARDIRQ_OFFSET); \
} while (0)

Definition at line 178 of file hardirq.h.

#define __IRQ_MASK (   x)    ((1UL << (x))-1)

Definition at line 51 of file hardirq.h.

#define HARDIRQ_BITS   MAX_HARDIRQ_BITS

Definition at line 39 of file hardirq.h.

#define hardirq_count ( )    (preempt_count() & HARDIRQ_MASK)

Definition at line 75 of file hardirq.h.

#define HARDIRQ_MASK   (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)

Definition at line 55 of file hardirq.h.

#define HARDIRQ_OFFSET   (1UL << HARDIRQ_SHIFT)

Definition at line 60 of file hardirq.h.

#define HARDIRQ_SHIFT   (SOFTIRQ_SHIFT + SOFTIRQ_BITS)

Definition at line 48 of file hardirq.h.

#define in_atomic ( )    ((preempt_count() & ~PREEMPT_ACTIVE) != 0)

Definition at line 109 of file hardirq.h.

#define in_atomic_preempt_off ( )    ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)

Definition at line 115 of file hardirq.h.

#define in_interrupt ( )    (irq_count())

Definition at line 88 of file hardirq.h.

#define in_irq ( )    (hardirq_count())

Definition at line 86 of file hardirq.h.

#define in_nmi ( )    (preempt_count() & NMI_MASK)

Definition at line 94 of file hardirq.h.

#define in_serving_softirq ( )    (softirq_count() & SOFTIRQ_OFFSET)

Definition at line 89 of file hardirq.h.

#define in_softirq ( )    (softirq_count())

Definition at line 87 of file hardirq.h.

#define irq_count ( )
Value:

Definition at line 77 of file hardirq.h.

#define IRQ_EXIT_OFFSET   HARDIRQ_OFFSET

Definition at line 123 of file hardirq.h.

#define MAX_HARDIRQ_BITS   10

Definition at line 36 of file hardirq.h.

#define NMI_BITS   1

Definition at line 34 of file hardirq.h.

#define nmi_enter ( )
Value:
do { \
ftrace_nmi_enter(); \
BUG_ON(in_nmi()); \
add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
lockdep_off(); \
rcu_nmi_enter(); \
trace_hardirq_enter(); \
} while (0)

Definition at line 190 of file hardirq.h.

#define nmi_exit ( )
Value:
do { \
trace_hardirq_exit(); \
rcu_nmi_exit(); \
lockdep_on(); \
BUG_ON(!in_nmi()); \
sub_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
ftrace_nmi_exit(); \
} while (0)

Definition at line 200 of file hardirq.h.

#define NMI_MASK   (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)

Definition at line 56 of file hardirq.h.

#define NMI_OFFSET   (1UL << NMI_SHIFT)

Definition at line 61 of file hardirq.h.

#define NMI_SHIFT   (HARDIRQ_SHIFT + HARDIRQ_BITS)

Definition at line 49 of file hardirq.h.

#define PREEMPT_ACTIVE   (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)

Definition at line 68 of file hardirq.h.

#define PREEMPT_ACTIVE_BITS   1

Definition at line 66 of file hardirq.h.

#define PREEMPT_ACTIVE_SHIFT   (NMI_SHIFT + NMI_BITS)

Definition at line 67 of file hardirq.h.

#define PREEMPT_BITS   8

Definition at line 32 of file hardirq.h.

#define PREEMPT_CHECK_OFFSET   0

Definition at line 99 of file hardirq.h.

#define PREEMPT_MASK   (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)

Definition at line 53 of file hardirq.h.

#define PREEMPT_OFFSET   (1UL << PREEMPT_SHIFT)

Definition at line 58 of file hardirq.h.

#define PREEMPT_SHIFT   0

Definition at line 46 of file hardirq.h.

#define preemptible ( )    0

Definition at line 122 of file hardirq.h.

#define SOFTIRQ_BITS   8

Definition at line 33 of file hardirq.h.

#define softirq_count ( )    (preempt_count() & SOFTIRQ_MASK)

Definition at line 76 of file hardirq.h.

#define SOFTIRQ_DISABLE_OFFSET   (2 * SOFTIRQ_OFFSET)

Definition at line 63 of file hardirq.h.

#define SOFTIRQ_MASK   (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)

Definition at line 54 of file hardirq.h.

#define SOFTIRQ_OFFSET   (1UL << SOFTIRQ_SHIFT)

Definition at line 59 of file hardirq.h.

#define SOFTIRQ_SHIFT   (PREEMPT_SHIFT + PREEMPT_BITS)

Definition at line 47 of file hardirq.h.

#define synchronize_irq (   irq)    barrier()

Definition at line 129 of file hardirq.h.

Function Documentation

void irq_enter ( void  )

Definition at line 305 of file softirq.c.

void irq_exit ( void  )

Definition at line 342 of file softirq.c.

void rcu_nmi_enter ( void  )

rcu_nmi_enter - inform RCU of entry to NMI context

If the CPU was idle with dynamic ticks active, and there is no irq handler running, this updates rdtp->dynticks_nmi to let the RCU grace-period handling know that the CPU is active.

Definition at line 668 of file rcutree.c.

void rcu_nmi_exit ( void  )

rcu_nmi_exit - inform RCU of exit from NMI context

If the CPU was idle with dynamic ticks active, and there is no irq handler running, this updates rdtp->dynticks_nmi to let the RCU grace-period handling know that the CPU is no longer active.

Definition at line 690 of file rcutree.c.