On 09/13/2011 08:08 AM, Alexander Graf wrote:
> Fabien Chouteau wrote:
>> static void booke_update_irq(CPUState *env)
>> {
>>     ppc_set_irq(env, PPC_INTERRUPT_DECR,
>>                 (env->spr[SPR_BOOKE_TSR] & TSR_DIS
>>                  && env->spr[SPR_BOOKE_TCR] & TCR_DIE));
>>
>>     ppc_set_irq(env, PPC_INTERRUPT_WDT,
>>                 (env->spr[SPR_BOOKE_TSR] & TSR_WIS
>>                  && env->spr[SPR_BOOKE_TCR] & TCR_WIE));
>>
>>     ppc_set_irq(env, PPC_INTERRUPT_FIT,
>>                 (env->spr[SPR_BOOKE_TSR] & TSR_FIS
>>                  && env->spr[SPR_BOOKE_TCR] & TCR_FIE));
>> }
>>   
> 
> Awesome! Please also check on MSR.EE and send a new patch then :)

If you check on EE here, then you'll need to call booke_update_irq()
when EE changes (not sure whether that's the plan).  Another option
would be to unset the irq if the condition is not valid.  This would
also be better in that you could have all three set (DIS, DIE, EE) and
not deliver the interrupt because there's a higher priority exception.

-Scott


Reply via email to