首页 > 代码库 > distributor之Interrupt Processor Targets Registers, GICD_ITARGETSRn
distributor之Interrupt Processor Targets Registers, GICD_ITARGETSRn
此组寄存器主要设置某个中断对应的目标处理器,即某个中断应该发往哪个处理器进行处理;和上一组优先级设置寄存器一样,本组寄存器同样是每个寄存器可以设置4个中断的目标处理器,每个中断有8个bit位可进行设置;此组寄存器的个数同样也由GICD_TYPER.ITLinesNumber决定,为(8*(GICD_TYPER.ITLinesNumber+1))个. 相对偏移区间为0x800-0xbf8;每个寄存器的域划分为:
[31:24] CPU targets, byte offset 3
[23:16] CPU targets, byte offset 2
[15:8] CPU targets, byte offset 1
[7:0] CPU targets, byte offset 0
Meaning of CPU targets field bit values
0bxxxxxxx1目标处理器为cpuinterface0
0bxxxxxx1x目标处理器为cpuinterface1
0bxxxxx1xx目标处理器为cpuinterface2
0bxxxx1xxx目标处理器为cpuinterface3
0bxxx1xxxx目标处理器为cpuinterface4
0bxx1xxxxx目标处理器为cpuinterface5
0bx1xxxxxx目标处理器为cpuinterface6
0b1xxxxxxx目标处理器为cpuinterface7
如果一个中断对应的8bit位值为0x3,那么就代表此中断要发往处理器0和1;
某个中断要操作的寄存器及操作域的计算方法为:
For interrupt IDm, when DIV and MOD are the integer division and modulo operations:
the corresponding GICD_ITARGETSRn number,n, is given byn=mDIV 4
the offset of the required GICD_ITARGETSR is (0x800+ (4*n))
the byte offset of the required Priority field in this register is mMOD 4, where:
byte offset 0 refers to register bits [7:0]
byte offset 1 refers to register bits [15:8]
byte offset 2 refers to register bits [23:16]
byte offset 3 refers to register bits [31:24].
对于不同状态的中断,我们操作其对应的操作域会产生不同的影响:
如果一个中断处于active状态,那么我们操作更改其目标处理器寄存器,对此轮响应这个中断的目标处理器没有任何影响,只有下次再来这个中断时才会发往我们更改的目标处理器;
如果一个中断处于pending状态,那么我们更改其目标处理器寄存器,接下来我们设定的目标处理器就会响应这个中断;
如果一个中断处于active and pending状态,那么此轮目标处理器不会被更改,但是再次响应此中断时设置值就会生效;
distributor之Interrupt Processor Targets Registers, GICD_ITARGETSRn