Soft Interrupt Processing

Data Structures

struct  softirq_desc
 Soft interrupt descriptor. More...

Typedefs

typedef void(* softirq_handler_t )(void *data)
 Soft interrupt handler function.
typedef bool softirq_flags_t
 Type for holding the current softirq state (enabled/disabled).

Enumerations

enum  softirq_id { , SOFTIRQ_NR_IDS }
 

Enumeration of all soft interrupt IDs in the system.

More...

Functions

void softirq_set_handler (enum softirq_id id, softirq_handler_t handler, void *data)
 Install a soft interrupt handler.
static void softirq_raise (enum softirq_id id)
 Raise the soft interrupt id.
static void softirq_poll (void)
 Check for pending soft interrupts and handle them.
static void softirq_disable (void)
 Disable softirq processing.
static void softirq_enable (void)
 Enable softirq processing.
static bool softirq_is_enabled_flags (softirq_flags_t flags)
 Test if soft interrupts are enabled in flags.
static bool softirq_is_enabled (void)
 Test if soft interrupts are enabled.
static softirq_flags_t softirq_save (void)
 Save the current soft interrupt sate and disable soft interrupts.
static void softirq_restore (softirq_flags_t flags)
 Restore saved soft interrupt state.

Variables

bit_word_t softirq_priv_status [SOFTIRQ_BITMAP_WORDS]
 Bitmask indicating the active status of each soft interrupt.
struct softirq_desc softirq_priv_table [SOFTIRQ_NR_IDS]
 Table with a soft interrupt handler for each softirq.
bit_word_t softirq_priv_status [SOFTIRQ_BITMAP_WORDS]
 Bitmask indicating the active status of each soft interrupt.
struct softirq_desc softirq_priv_table [SOFTIRQ_NR_IDS]
 Table with a soft interrupt handler for each softirq.

Detailed Description

Soft interrupts are virtual interrupts which are defined, raised and handled by software. They run at lower priority than hardware interrupts, but higher priority than work queues.

Applications which need to use soft interrupts must provide a header file app/softirq.h providing a enum softirq_id with a unique value for each soft interrupt ID in the system. The application must also define SOFTIRQ_NR_IDS, usually as a member of this enum.


Typedef Documentation

typedef bool softirq_flags_t

Type for holding the current softirq state (enabled/disabled).

Definition at line 56 of file softirq.h.

typedef void(* softirq_handler_t)(void *data)

Soft interrupt handler function.

Parameters:
data Data pointer that was passed to softirq_set_handler().

Definition at line 69 of file softirq.h.


Enumeration Type Documentation

enum softirq_id

Enumeration of all soft interrupt IDs in the system.

Application-provided enumeration of all the soft interrupt IDs in the system. This enum also defines the priority of each soft interrupt -- the pending softirq with the lowest ID will be handled first.

Enumerator:
SOFTIRQ_NR_IDS 

The total number of soft interrupts in the system.

This constant is provided by the application, usually as a part of the softirq_id enum, and determines the size of some internal data structures used by the soft interrupt system.

Definition at line 41 of file softirq.h.


Function Documentation

void softirq_disable ( void   )  [inline, static]

Disable softirq processing.

No pending softirqs will be processed until softirq_enable() is called.

Definition at line 82 of file softirq.h.

References barrier.

void softirq_enable ( void   )  [inline, static]

Enable softirq processing.

This function will also process any softirqs raised while softirq processing was disabled.

Precondition:
Interrupts are not masked

Definition at line 88 of file softirq.h.

References barrier.

Referenced by softirq_restore().

bool softirq_is_enabled ( void   )  [inline, static]

Test if soft interrupts are enabled.

Return values:
true If soft interrups are enabled
false If soft interrupts are disabled

Definition at line 99 of file softirq.h.

Referenced by mainloop_run().

bool softirq_is_enabled_flags ( softirq_flags_t  flags  )  [inline, static]

Test if soft interrupts are enabled in flags.

Parameters:
flags Saved soft interrupt state
Return values:
true If flags indicates soft interrups are enabled
false If flags indicates soft interrupts are disabled

Definition at line 94 of file softirq.h.

Referenced by softirq_restore().

void softirq_poll ( void   )  [inline, static]

Check for pending soft interrupts and handle them.

This function should be called from the main loop in order to process any pending soft interrupts on architectures which don't run soft interrupt handlers automatically after an interrupt. On architectures which do run soft interrupts handlers automatically, this function does nothing.

Definition at line 58 of file softirq.h.

References assert, bit_array_find_first_one_bit(), clear_bit, cpu_irq_disable, cpu_irq_enable, cpu_irq_is_enabled, softirq_desc::data, softirq_desc::handler, SOFTIRQ_NR_IDS, softirq_priv_status, and softirq_priv_table.

Referenced by mainloop_run().

static void softirq_raise ( enum softirq_id  id  )  [inline, static]

Raise the soft interrupt id.

Calling this function will flag soft interrupt id as active, which will cause the associated handler to be run at the first opportunity.

Note that if this function is called from a non-interrupt context with softirqs enabled, it is undefined when the handler will actually be run.

Definition at line 102 of file softirq.h.

References atomic_set_bit(), and softirq_priv_status.

Referenced by touch_priv_adc_handler().

void softirq_restore ( softirq_flags_t  flags  )  [inline, static]

Restore saved soft interrupt state.

Parameters:
flags A cookie returned by softirq_save()

Definition at line 117 of file softirq.h.

References softirq_enable(), and softirq_is_enabled_flags().

softirq_flags_t softirq_save ( void   )  [inline, static]

Save the current soft interrupt sate and disable soft interrupts.

Returns:
A cookie indicating the soft interrupt state before disabling.

Definition at line 108 of file softirq.h.

void softirq_set_handler ( enum softirq_id  id,
softirq_handler_t  handler,
void *  data 
)

Install a soft interrupt handler.

Parameters:
id Soft interrupt number for which to install a handler
handler Function to be called when soft interrupt is active
data Arbitrary data to be passed to handler

Referenced by touch_init().


Variable Documentation

bit_word_t softirq_priv_status[SOFTIRQ_BITMAP_WORDS]

Bitmask indicating the active status of each soft interrupt.

For internal use only.

Definition at line 51 of file softirq_common.c.

Referenced by softirq_poll(), and softirq_raise().

bit_word_t softirq_priv_status[SOFTIRQ_BITMAP_WORDS]

Bitmask indicating the active status of each soft interrupt.

For internal use only.

Definition at line 51 of file softirq_common.c.

Referenced by softirq_poll(), and softirq_raise().

struct softirq_desc softirq_priv_table[SOFTIRQ_NR_IDS]

Table with a soft interrupt handler for each softirq.

For internal use only.

Definition at line 57 of file softirq_common.c.

Referenced by softirq_poll().

struct softirq_desc softirq_priv_table[SOFTIRQ_NR_IDS]

Table with a soft interrupt handler for each softirq.

For internal use only.

Definition at line 57 of file softirq_common.c.

Referenced by softirq_poll().

Generated on Thu Apr 29 15:18:23 2010 for display-training by  doxygen 1.6.3