# arch/avr32/include/arch/softirq.h File Reference

Architecture-specific soft interrupt definitions. More...

`#include <bitops.h>`
`#include <compiler.h>`
`#include <arch/sysreg.h>`

Include dependency graph for softirq.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Typedefs
typedef void(* | softirq_handler_t )(void *data)
| Soft interrupt handler function.
## Functions
void | softirq_set_handler (unsigned int id, softirq_handler_t handler, void *data)
| Install a soft interrupt handler.
void | softirq_priv_do_pending (void)
| Execute handlers for all pending softirqs.
void | softirq_enable (void)
| Enable softirq processing.
static void | softirq_disable (void)
| Disable softirq processing.
static void | softirq_raise (unsigned int id)
| Raise the soft interrupt id.
static bool | softirq_is_enabled_flags (unsigned long flags)
| Test if soft interrupts are enabled in flags.
static bool | softirq_is_enabled (void)
| Test if soft interrupts are enabled.
static unsigned long | softirq_save (void)
| Save the current soft interrupt sate and disable soft interrupts.
static void | softirq_restore (unsigned long flags)
| Restore saved soft interrupt state.
## Variables
unsigned long | softirq_priv_status
| Bitmask indicating the active status of each soft interrupt.

## Detailed Description

Architecture-specific soft interrupt definitions.

- Compiler: IAR EWAVR32 and GNU GCC for AVR32
- Supported devices: All AVR32 devices
- AppNote:

Author:
  Atmel Corporation: http://www.atmel.com
  Support and FAQ: http://support.atmel.no/

Definition in file softirq.h.

## Typedef Documentation

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 52 of file softirq.h.

## Function Documentation

static void softirq_disable | ( | void |  | ) | `[inline, static]`

Disable softirq processing.

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

Definition at line 67 of file softirq.h.

References avr32_set_sr_bit, barrier, and SYSREG_SR_T_BIT.

Referenced by led_blink_start(), led_blink_stop(), and softirq_save().

void softirq_enable | ( | void |  | ) |

Enable softirq processing.

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

Precondition:
  Interrupts are not masked

Definition at line 129 of file softirq.c.

References assert, avr32_clear_sr_bit, cpu_irq_disable, cpu_irq_enable, cpu_irq_is_enabled, softirq_priv_do_pending(), softirq_priv_status, and SYSREG_SR_T_BIT.

Referenced by led_blink_start(), led_blink_stop(), and softirq_restore().

Here is the call graph for this function:

static 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 104 of file softirq.h.

References softirq_is_enabled_flags().

Here is the call graph for this function:

static bool softirq_is_enabled_flags | ( | unsigned long | 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_is_enabled(), and softirq_restore().

void softirq_priv_do_pending | ( | void |  | ) |

Execute handlers for all pending softirqs.

For internal use only.

This function is called with interrupts disabled and returns with interrupts disabled, but interrupts are enabled most of the time while the function is running.

Precondition:
  Interrupts are disabled

  All interrupt levels are enabled

  At least one softirq is pending

Postcondition:
  Interrupts are disabled

Definition at line 94 of file softirq.c.

References __ffs(), ARRAY_LEN, assert, clear_bit(), cpu_irq_disable, cpu_irq_enable, cpu_irq_is_enabled, and softirq_priv_status.

Referenced by softirq_enable().

Here is the call graph for this function:

static void softirq_raise | ( | unsigned int | 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 83 of file softirq.h.

References atomic_set_bit(), and softirq_priv_status.

Referenced by timer_irq_handler(), and usbb_udc_interrupt().

Here is the call graph for this function:

static void softirq_restore | ( | unsigned long | flags | ) | `[inline, static]`

Restore saved soft interrupt state.

Parameters:

  | flags | A cookie returned by softirq_save()

Definition at line 130 of file softirq.h.

References softirq_enable(), and softirq_is_enabled_flags().

Here is the call graph for this function:

static unsigned long 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 116 of file softirq.h.

References softirq_disable().

Here is the call graph for this function:

void softirq_set_handler | ( | unsigned int | id,
|  | softirq_handler_t | handler,
|  | void * | data |
| ) |  |  |

Install a soft interrupt handler.

Parameters:

  | handler | Function to be called when soft interrupt is active
  | data | Arbitrary data to be passed to handler

Definition at line 67 of file softirq.c.

References ARRAY_LEN, assert, build_assert, and softirq_priv_status.

Referenced by sdmmc_mcihost_init(), timer_init(), and usbb_udc_init().

## Variable Documentation

unsigned long softirq_priv_status

Bitmask indicating the active status of each soft interrupt.

For internal use only.

Definition at line 57 of file softirq.c.

Referenced by softirq_enable(), softirq_priv_do_pending(), softirq_raise(), and softirq_set_handler().