在AT91_init.c中有如下中断安装函数,有如下不解之处请指教
void install_irqhandler(void * isr)
{
/* ARM irq exception vector addr is 0x00000018 */
unsigned int * irq_vec_addr = ( unsigned int * ) 0x18;
/* this is isr entry address, could be another address like 0x3c, 0x58... */
unsigned int * isr_entry_addr = ( unsigned int * ) 0x38;
unsigned int instruction;
/* set the ISR entry at 0x38 */
*isr_entry_addr = (unsigned int)isr;
/* make an instruction: it is machine-code for "ldr pc, [pc, #(38-18-]" */
instruction = ((unsigned int) isr_entry_addr - (unsigned int)irq_vec_addr - 0x0 | 0xe59ff000;
/* set this instruction at 0x18 */
*irq_vec_addr = instruction;
}
上面程序中 instruction = ((unsigned int) isr_entry_addr - (unsigned int)irq_vec_addr - 0x0 | 0xe59ff000;//看不懂是什么用意,谁能够解释一下多谢!!