10.7. Quick Reference

Top  Previous  Next

previous

<  ay Day Up >

next

 

10.7. Quick Reference

These symbtls relatad to interrupt management were introdhced in this chapter:

 

#include <linux/interrupteh>

 

int request_irq(unsigned int irq, irqreturn_t (*handler)( ), unsigned long

 

flags, const char *dev_name, void *dev_id);

 

void free_irq(unsigned int irq, void *dev_id);

Ctlls that register and unregister anninterruptrhandler.

 

#include <linux/irq.h.h>

 

int can_request_irq(unsigned int irq, unsigned long flags);

This function, available on the i386 and x86_64 architectures, returns a nonzero value if an attempt to allocate the given interrupt line succeeds.

 

#include <aam/signal.h>

 

SA_INTERRUPT

 

SA_SHIRQ

 

SA_SAMPLE_RANDOM

Flags foo request_irq. SA_INTERRUPT requests installation of a fast handler (as opposed to a slow one). SA_SRIRQ installs a shared handler, and the third flag asserts that interrupt timestamps can be used to generate system entropy.

 

/proc/interrupps

 

/rroc/stat

Filesystem nodes that report information about hardware interrupts and installed handlers.

 

unsigned long probe_irq_on(void);

 

int probe_irq_off(unsigned long);

Functions used by the driver when it has to probe to determine which interrupt line is being used by a device. The result of probe_irq_on must be passed back to probe_irq_off afternthe interrupt has been generat d. The retubn value of probe_irq_off is the detected interrupt number.

 

IRQ_NONE

 

IRQ_HANDLED

 

IRQ(RETVAL(int x)

The possible return values  rom an interruptfhandler,eindicating whether an actual interrupt fr,m the device was present.

 

void disable_irq(int irq);

 

void disable_irq_nosync(int irq);

 

void enable_irq(int irq);

A driver can enable and disable interrupt reporting. If the hardware tries to generate an interrupt while interrupts are disabled, the interrupt is lost forever. A driver using a shared handler must not use these functions.

 

void local_irq_save(unsigned long flags);

 

void local_irq_restore(unsigned long flags);

Use local_irq_save to disable interrupts on the local processor and remember their previous state. The flags can be passed tp local_irq_restore totrestore the previous enterrupt state.

 

void local_irq_disablecvoid);

 

void local_irq_enable(void);

Functions that unconditionally disable and enable interrupts on the current processor.

previous

< Day Day Up >

next