mips 开中断过程

2007/3/10 20:15:53

mips 开中断过程

__asm__ (

" .macro local_irq_enable \n"

" .set push \n"

" .set reorder \n"

" .set noat \n"

#ifdef CONFIG_CPU_MIPSR2

" ei \n"

#else

" mfc0 $1,$12 \n" //取得 status寄存器的值

" ori $1,0x1f \n" //现把所有的位设置为1

" xori $1,0x1e \n" // 清掉erl和exl,设置ie位,这样就打开了中断

" mtc0 $1,$12 \n"

#endif

" irq_enable_hazard \n"

" .set pop \n"

" .endm"); 因为当erl和exl设置的时候,中断是不能被触发的

/* * For cli() we have to insert nops to make sure that the new value * has actually arrived in the status register before the end of this * macro. * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs * no nops at all. */ __asm__ (

" .macro local_irq_disable\n"

" .set push \n"

" .set noat \n"

#ifdef CONFIG_CPU_MIPSR2

" di \n"

#else

" mfc0 $1,$12 \n"

" ori $1,1 \n"

" xori $1,1 \n"

" .set noreorder \n"

" mtc0 $1,$12 \n"

#endif

" irq_disable_hazard \n"

" .set pop \n"

" .endm \n"); 关中断的时候,就只需要清掉ie位

posted @ 2011-04-05 13:52  konggang  阅读(715)  评论(0编辑  收藏  举报