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位

转载于:https://www.cnblogs.com/simBCM/archive/2011/04/05/2005786.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值