Am 16.09.2002 21:54:51, schrieb Galen Seitz <[email protected]>:
>[email protected] said:
>> Within ISR interrups are disabled unless you reenable it (with
>> enablenested attribute).
>>
>> For non-IRS: Yes, there is an attribute 'critical' (read doc.txt)
>> which does as follows:
>>
>> funct:
>>      push r2 ; save status
>>      dint    ; disable ints
>>      ...pushes
>>      .... funct body follows
>>      ...pops
>>      reti    ; restore r2 and return.
>>      
>
>Isn't there a potential problem with this?  If an interrupt occurs between
>the push r2 and the dint, and the interrupt routine returns with interrupts
>disabled, interrupts will get reenabled by the reti.  Or is this a case of
>"don't do that"?

true, but there is not simple solution to that. you must first save r2/SR
before disabling the interrupts and you can't check after dint if an irq
switched it off, cause dint did it....

so, you should not disable the GIE in an interrupt. however, you may
disable any individual interrupt sources through their respecitive IE bits.

chris




Reply via email to