Control interfaces

The generic IRQ layer provides routines to carry out control operations on IRQ lines. Following is the list of functions for masking and unmasking specific IRQ lines:

void disable_irq(unsigned int irq);

This disables the specified IRQ line by manipulating the counter in the IRQ descriptor structure. This routine is a possible blocking call, as it waits until any running handlers for this interrupt complete. Alternatively, the function disable_irq_nosync() can also be used to disable the given IRQ line; this call does not check and wait for any running handlers for the given interrupt line to complete:

void disable_irq_nosync(unsigned int irq);

Disabled IRQ lines can be enabled with a call to:

void enable_irq(unsigned int irq);

Note that IRQ enable and disable operations nest, that is, multiple calls to disable an IRQ line require the same number of enable calls for that IRQ line to be reenabled. This means that enable_irq() will enable the given IRQ only when a call to it matches the last disable operation.

By choice, interrupts can also be disabled/enabled for the local CPU; the following pairs of macros can be used for the same:

  • local_irq_disable(): To disable interrupts on the local processor.
  • local_irq_enable(): Enables interrupts for the local processor.
  • local_irq_save(unsigned long flags): Disables interrupts on the local CPU by saving current interrupt state in flags.
  • local_irq_restore(unsigned long flags): Enables interrupts on the local CPU by restoring interrupts to a previous state.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.138.230