关于ucos移植到at91的问题???
最近在研究ucos移植, 在os_cpu_a.S文件中, 中断服务子程序种,我把BL do_irq换成BL OSTimeTick后,任务调度就出现问题了.下面是do_irq的源码,void do_irq(void)
{
int irq_num;
void (*isr)(void);
//chy 2003-02-16 : IVR could have some irqs at the same time, so should check it untile IVR=0
//irqnum is the highest irq number
label_again:
irq_num = __arch_getl(AIC_IVR);
if(irq_num!=0){
//close this interrupt
at91_mask_irq(irq_num);
isr = (void *)svr;
if( isr != 0 )
isr();
if(irq_num == KERNEL_TIMER_IRQ_NUM){
//do some extra work for skyeye timer interrupt
register volatile struct at91_timers* tt = (struct at91_timers*) (AT91_TC_BASE);
register volatile struct at91_timer_channel* tc = &tt->chans.ch;
/* clear TC Status Register to continue interrupt */
unsigned long tmp = tc->sr; // only read status register, must do!
tmp = tmp; // just use it to avoid compiler warnings!
}
//reenable this interrupt
at91_unmask_irq(irq_num);
/* clear AIC : indicate the end of interrupts */
__arch_putl(irq_num,AIC_EOICR);// only write AIC_EOICR
//chy 2003-02-16 : IVR could have some irqs at the same time, so should check it untile IVR=0
goto label_again;
}
}
在该函数里面也就是调用中断程序,我只是直接调用,为什么就不行呢??/
页:
[1]