求助 request_irq函数中 flags参数的疑问

liuyang39 2012-04-20 02:06:30
request_irq 中flags设为0表示什么意思
在spi_s3c24xx.c中 err = request_irq(IRQ_SPI1, s3c24xx_spi_irq, 0, pdev->name, hw);这句话什么意思
...全文
918 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Iris_Zhou 2013-03-11
  • 打赏
  • 举报
回复
貌似这些宏里没有为0的
pengchy 2012-04-20
  • 打赏
  • 举报
回复

/*
* These flags used only by the kernel as part of the
* irq handling routines.
*
* IRQF_DISABLED - keep irqs disabled when calling the action handler
* IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
* IRQF_SHARED - allow sharing the irq among several devices
* IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
* IRQF_TIMER - Flag to mark this interrupt as timer interrupt
* IRQF_PERCPU - Interrupt is per cpu
* IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
* IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
* registered first in an shared interrupt is considered for
* performance reasons)
*/
#define IRQF_DISABLED 0x00000020
#define IRQF_SAMPLE_RANDOM 0x00000040
#define IRQF_SHARED 0x00000080
#define IRQF_PROBE_SHARED 0x00000100
#define IRQF_TIMER 0x00000200
#define IRQF_PERCPU 0x00000400
#define IRQF_NOBALANCING 0x00000800
#define IRQF_IRQPOLL 0x00001000
fantasy115 2012-04-20
  • 打赏
  • 举报
回复
中断的属性标志,你搜一下IRQF_SHARED这个宏,相邻的一些值都是针对flags进行设置的。具体怎么设看自己需要了。
request_irq主要是向系统申请一个中断,并将中断号IRQ_SPI1和中断处理函数s3c24xx_spi_irq关联起来,pdev->name是传入的名字——随便起。hw是传入到处理函数中的的一个结构体指针,这个主要是在处理中断的时候获取hw里面的一些信息。

在后面发送或者接收数据时,等你是能中断后,s3c24xx_spi_irq里面就可以处理数据了。

21,597

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 驱动开发/核心开发
社区管理员
  • 驱动开发/核心开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧