[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
RE: [coldfire-gnu-discuss] ColdFire Interrupts
- To: <coldfire-gnu-discuss@xxxxxxxxxxxxxxxx>
- Subject: RE: [coldfire-gnu-discuss] ColdFire Interrupts
- From: "Corrin Meyer" <Corrin.Meyer@xxxxxxxxxxxxxxx>
- Date: Wed, 2 Jul 2008 09:11:45 -0400
>Corrin Meyer wrote:
>> According to the ColdFire datasheets, on entering of an ISR, the only
>> first instruction is guaranteed to run with interrupts disabled, and
>> therefore should modify the status register. Since on interrupt, the
>> processor creates an exception stack frame in which the status
register
>> (SR) is stored, the first instruction in an ISR should load an
immediate
>> value into SR. Either that, or use the 'STRLDSR' instruction.
However,
>> even with a function marked with "__attribute__((interrupt))" GCC
>> doesn't seem to generate these instructions. I also noticed that
none
>> of the CS3 default interrupts do this.
>
>> Is this the intended functionality? Am I correct in assuming that
the
>> only way to write truly correct ISRs is to do so in assembly (or at
>> least use assembly as a wrapper before calling C code)?
>
>The SR interrupt mask is automatically set to the level of the current
>interrupt, so you only need the functionality you ask for when you want
to
>disable all interrupts from the very start of the interrupt routine.
You >could
>of course disable all interrupts later within the routine, but that
does >mean
>there is a part of the routine that is preemptable (but not necessarily
>reentrant)
>
>I have filed an internal enhancement request.
>
>nathan
Thank you for filing an enhancement request. My other question is in
regards to the "__attribute__((interrupt))". Should I be using
"interrupt" or "interrupt_handler". I saw that there had been some
discussion on which name to use, but I never found a resolution.
Corrin
|