[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Clarification for interrupt specific changes inoutput
From: |
Anatoly Sokolov |
Subject: |
Re: [avr-gcc-list] Clarification for interrupt specific changes inoutput_movhi() in revision 136238 |
Date: |
Wed, 25 Aug 2010 22:20:58 +0400 |
Hi.
There is one issue I would like to get clarified. In prologue, conditional
check for is_OS_main is happening but not the same in epilogue.
expand_prologue() {
...
+ else if (TARGET_NO_INTERRUPTS
+ || cfun->machine->is_signal
+ || cfun->machine->is_OS_main)
+ {
insn =
emit_insn (gen_movhi_sp_r_>>>irq_off<<< (stack_pointer_rtx,
frame_pointer_rtx));
In time when prologue of the "main" function or interrupt handler declared
with "signal" attribute is executed the interrupt is disabled and need not
to save-disable-restore "I" flag when new value is written in SP.
expand_epilogue() {
...
+ else if (TARGET_NO_INTERRUPTS
+ || cfun->machine->is_signal)
+ {
...
emit_insn (gen_movhi_sp_r_>>>irq_off<<< (stack_pointer_rtx,
frame_pointer_rtx));
In time when prologue of the interrupt handler declared with "signal"
attribute is executed the interrupt is disabled and need not to
save-disable-restore "I" flag when new value is written in SP.
On the other hand in "main" function interrupt may be enabled and writing to
SP soul be de done in safe way.
Anatoly.