Chinaunix首页 | 论坛 | 博客
  • 博客访问: 707869
  • 博文数量: 165
  • 博客积分: 8218
  • 博客等级: 中将
  • 技术积分: 1749
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-07 19:48
文章分类

全部博文(165)

文章存档

2014年(4)

2011年(3)

2010年(6)

2009年(43)

2008年(109)

分类: LINUX

2009-01-02 22:46:15

Quick Reference
These symbols related to interrupt management were introduced in this chapter:
#include
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);
    Calls that register and unregister an interrupt handler.
#include
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
SA_INTERRUPT
SA_SHIRQ
SA_SAMPLE_RANDOM
    Flags for request_irq. SA_INTERRUPT requests installation of a fast handler (as
    opposed to a slow one). SA_SHIRQ installs a shared handler, and the third flag
    asserts that interrupt timestamps can be used to generate system entropy.
/proc/interrupts
/proc/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 after the interrupt has been generated. The return value of probe_
    irq_off is the detected interrupt number.
IRQ_NONE
IRQ_HANDLED
IRQ_RETVAL(int x)
    The possible return values from an interrupt handler, indicating whether an
    actual interrupt from 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 gen-
    erate 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 to local_irq_restore to restore the
    previous interrupt state.
void local_irq_disable(void);
void local_irq_enable(void);
    Functions that unconditionally disable and enable interrupts on the current
    processor.

阅读(590) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~