c - ARM设备树文件中,三个中断值是什么意思

标签 c linux arm interrupt device-tree

典型 ARM 设备的设备树源将包含中断 Controller 部分:

interrupt-controller@f8f01000 {
    compatible = "arm,cortex-a9-gic";
    #interrupt-cells = <0x3>;
    interrupt-controller;
    reg = <0xf8f01000 0x1000 0xf8f00100 0x100>;
    num_cpus = <0x2>;
    num_interrupts = <0x60>;
    linux,phandle = <0x3>;
    phandle = <0x3>;
};

属性(property)#interrupt-cells定义用于注册中断的元组的大小。因此,在定义设备时,必须定义三个整数来指定中断及其属性。

ocmc@f800c000 {
    compatible = "xlnx,zynq-ocmc-1.0";
    interrupt-parent = <0x3>;
    interrupts = <0x0 0x3 0x4>;
    reg = <0xf800c000 0x1000>;
};

问题是,这三个值分别代表什么?那么,interrupts = <0x0 0x3 0x4>; 行是什么意思?意思是?以及在为其注册中断处理程序时必须添加什么偏移量(通过 signal.h/csignalsignal(<signal id>, <function name>); )

最佳答案

从链接的网站解析:

The first number is a flag indicating if the interrupt is an SPI (shared peripheral interrupt). A nonzero value means it is an SPI. This impacts offsets added to translate the interrupt number (16 for SPI, 32 for non-SPI).

The second number is the interrupt number.

The third number is the type of interrupt: 0 = Leave it as it was (power-up default or what the bootloader set it to, if it did). 1 = Rising edge. 4 = Level sensitive, active high.

关于c - ARM设备树文件中,三个中断值是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48188392/

相关文章:

c - 十六进制枚举或整数(ASCII)枚举来填充字节数组?

c - 测试使用文件描述符的 C 函数

MYSQL:版本 libmysqlclient_16 未在具有链接时间引用的文件 libmysqlclient.so.16 中定义

arm - 如何检测Cortex M中的FPU?

Golang 和 DBUS

c - 在保护模式下设置中断 (x86)

c - 初学者关于C程序函数调用栈、序列点(sequencing)的疑问

c - 使用 lfind 检索元素的索引

linux - 将本地文件从 Mac 复制到终端中的 ssh session

GCC for ARM -- ELF 输出文件段错位