gic_irq_domain_xlate
来源:互联网 发布:mac代购 编辑:程序博客网 时间:2024/05/19 16:06
在dts文件中,我们经常看到下面的code
interrupts = <0,120,6>
解析的code 是
static int gic_irq_domain_xlate(struct irq_domain *d,
612 struct device_node *controller,
613 const u32 *intspec, unsigned int intsize,
614 unsigned long *out_hwirq, unsigned int *out_type)
615 {
616 if (d->of_node != controller)
617 return -EINVAL;
618 if (intsize < 3)
619 return -EINVAL;
620
621 switch(intspec[0]) {
622 case 0: /* SPI */
623 *out_hwirq = intspec[1] + 32;
624 break;
625 case 1: /* PPI */
626 *out_hwirq = intspec[1] + 16;
627 break;
628 default:
629 return -EINVAL;
630 }
631
632 *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
633 return 0;
634 }
可知0代表是SPI 中断,1代表的是PPI中断。interrupts 第二个参数代表中断号,第三个代表中断类型.
636 static const struct irq_domain_ops gic_irq_domain_ops = {
637 .map = gic_irq_domain_map,
638 .xlate = gic_irq_domain_xlate,
639 };
而domain是在gic_of_init 中设置的.
ic_data.domain = irq_domain_add_tree(node, &gic_irq_domain_ops,
interrupts = <0,120,6>
解析的code 是
static int gic_irq_domain_xlate(struct irq_domain *d,
612 struct device_node *controller,
613 const u32 *intspec, unsigned int intsize,
614 unsigned long *out_hwirq, unsigned int *out_type)
615 {
616 if (d->of_node != controller)
617 return -EINVAL;
618 if (intsize < 3)
619 return -EINVAL;
620
621 switch(intspec[0]) {
622 case 0: /* SPI */
623 *out_hwirq = intspec[1] + 32;
624 break;
625 case 1: /* PPI */
626 *out_hwirq = intspec[1] + 16;
627 break;
628 default:
629 return -EINVAL;
630 }
631
632 *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
633 return 0;
634 }
可知0代表是SPI 中断,1代表的是PPI中断。interrupts 第二个参数代表中断号,第三个代表中断类型.
636 static const struct irq_domain_ops gic_irq_domain_ops = {
637 .map = gic_irq_domain_map,
638 .xlate = gic_irq_domain_xlate,
639 };
而domain是在gic_of_init 中设置的.
ic_data.domain = irq_domain_add_tree(node, &gic_irq_domain_ops,
0 0
- gic_irq_domain_xlate
- OpenWrt patch方法
- android studio下使用TUTK SDK
- 【转】缓存更新的套路
- OpenCV学习笔记(十):非线性滤波:中值滤波、双边滤波
- Node.js用ES6原生Promise对异步函数进行封装
- gic_irq_domain_xlate
- P2物理引擎中文文档
- php父类调用子类方法
- golang中container/list包用法
- 计算机网络笔记--TCP流量控制中滑动窗口协议分析
- 238. Product of Array Except Self
- JavaWeb-监听器Listener解析与实例
- android中handler用法总结
- eclipse内存溢出报错:java.lang.OutOfMemoryError:Java heap space