avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines


From: Anatoly Sokolov
Subject: Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines
Date: Wed, 30 Jan 2008 00:09:28 +0300

Hi.

From: "David Brown" <address@hidden>
Sent: Sunday, January 27, 2008 10:57 PM

> I'd imagine that the use of pgm_read_*_far macros
> within interrupt functions is pretty rare - perhaps the best idea is to
> use the patch, but make "-mno-save-rampz" the default?

Rare for 128K devices, but are more required for 256K devices. Also, as the 
Dmitry wrote, some instructions ('LD R,Z+') can change the RAMPZ register. I 
consider that by default saving of the RAMPZ register in interrupt handler 
routines should be enabled.

> Or is there some
> practical way to let the interrupt function save rampz if and only if it
> is used (or if a function is called), just like the volatile registers?
>

With this patch avr-gcc should save the RAMPZ register, only if the Z 
register (r30:31) is used in interrupt handler routine.

Anatoly. 


begin 666 gcc-4.3-save_rampz-v2.txt
address@hidden(&=C8R]C;VYF:6<O879R+V%V<BYM9 H]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]"BTM+2!G8V,O8V]N9FEG+V%V<B]A=G(N;60)*')E=FES:6]N(#$S
M,3DT,RD**RLK(&=C8R]C;VYF:6<O879R+V%V<BYM9 DH=V]R:VEN9R!C;W!Y
M*0I 0" M-#<L,address@hidden($! "B @(" H6D523U]214=.3PDQ*0D[('IE
M<F\@<F5G:7-T97(@<C$*(" @( H@(" @*%-214=?041$4B @(#!X-48I"BL@
M(" H4D%-4%I?041$4B @,'@U0BD*(" @( H@(" @*%5.4U!%0U]35%),14X)
M,"D*(" @("A53E-014-?24Y$15A?2DU0"3$I"B @(" H54Y34$5#7U-%20D)
M,BD*(" @("A53E-014-?0TQ)"0DS*0HK(" @*%5.4U!%0U]35T%0"0DT*0H@
M"B @(" H54Y34$5#5E]04D],3T=515]3059%4PDP*0H@(" @*%5.4U!%0U9?
M15!)3$]'545?4D535$]215,),2E=*0I);F1E>address@hidden;F9I9R]A=G(O
M879R+F,*/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/address@hidden;F9I9R]A
M=G(O879R+F,)*')E=FES:6]N(#$S,3DT,RD**RLK(&=C8R]C;VYF:6<O879R
M+V%V<BYC"2AW;W)K:6YG(&-O<'DI"D! ("TU.#8L-B address@hidden<@0$ *(&5X
M<&%N9%]P<F]L;V=U92 H=F]I9"D*('L*(" @:6YT(&QI=F5?<V5Q.PHK("!(
M05)$7U)%1U]3150@<V5T.PH@("!I;G0@;6EN:6UI>F4["B @($A/4U1?5TE$
M15])3E0@<VEZ92 ](&=E=%]F<F%M95]S:7IE*"D["B @("\J($1E9FEN92!T
M96UP;&%T97,@9F]R('!U<V@@:6YS=')U8W1I;VYS+B @*B\*0$ @+38P.2PV
M("LV,3 L-R! 0 H@(" @(" @<F5T=7)N.PH@(" @('T*( HK("!A=G)?<F5G
M<U]T;U]S879E("@F<V5T*3L*(" @;&EV95]S97$@/2!S97%U96YT7W)E9W-?
M;&EV92 H*3L*(" @;6EN:6UI>F4@/2 H5$%21T547T-!3$Q?4%)/3$]'5453
M"B )(" @(" @)B8@(6-F=6XM/FUA8VAI;F4M/FES7VEN=&5R<G5P= I 0" M
M-C,Y+#<@*S8T,2PQ.2! 0 H@(" @(" @4E187T9204U%7U)%3$%4141?4" H
M:6YS;BD@/2 Q.PH@(" @(" @:6YS;B ](&5M:71?;6]V95]I;G-N("AP=7-H
address@hidden&UP7W)E9U]R='@I.PH@(" @(" @4E187T9204U%7U)%3$%4141?
M4" H:6YS;BD@/2 Q.PHM(" @(" @"BL**R @(" @("\J(%!U<V@@4D%-4%HN
M(" J+PHK(" @(" @:68H05927TA!5D5?4D%-4%H@"BL@(" @(" @(" F)B A
M5$%21T547TY/7U-!5D5?4D%-4%H**PD@)address@hidden
M("AS970L(%)%1U]:*2 F)B!415-47TA!4D1?4D5'7T))5" H<V5T+"!214=?
M6B K(#$I*2D**R @(" @(" @>PHK(" @(" @(" @(&EN<VX@/2!E;6ET7VUO
M=F5?:6YS;B H=&UP7W)E9U]R='@L( HK(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @9V5N7W)T>address@hidden);address@hidden" H4D%-
M4%I?041$4BDI*3L**R @(" @(" @("!25%A?1E)!345?4D5,051%1%]0("AI
M;G-N*2 ](#$["BL@(" @(" @(" @:6YS;B ](&5M:71?;6]V95]I;G-N("AP
address@hidden&UP7W)E9U]R='@I.PHK(" @(" @(" @(%)46%]&4D%-15]2
M14Q!5$5$7U @*&EN<VXI(#T@,3L**R @(" @(" @?0HK"0H@(" @(" @+RH@
M0VQE87(@>F5R;R!R96<N(" J+PH@(" @(" @:6YS;B ](&5M:71?;6]V95]I
M;G-N("AZ97)O7W)E9U]R='@L(&-O;G-T,%]R='@I.PH@(" @(" @4E187T92
M04U%7U)%3$%4141?4" H:6YS;BD@/2 Q.PI 0" M-C8P+#@@*S8W-"PV($! 
M"B @(" @?0H@("!E;'-E"B @(" @>PHM(" @(" @2$%21%]214=?4T54('-E
M=#L*+2 @(" @(&%V<address@hidden"9S970I.PH@(" @(" @:6YT
M(')E9SL*(" @(" @(&9O<B H<F5G(#T@,#L@<F5G(#P@,S([("LK<F5G*0H@
M(" @(" @("!["D! ("TX,3$L-B K.#(S+#<@0$ *('L*(" @:6YT(')E9SL*
M(" @:6YT(&QI=F5?<V5Q.PHK("!(05)$7U)%1U]3150@<V5T.R @(" @( H@
M("!I;G0@;6EN:6UI>F4["B @($A/4U1?5TE$15])3E0@<VEZ92 ](&=E=%]F
M<F%M95]S:7IE*"D["B @( I 0" M.#(address@hidden@S-"PW($! "B @(" @("!R
M971U<FX["B @(" @?0H@"BL@(&%V<address@hidden"9S970I.PH@
M("!L:79E7W-E<2 ]('-E<75E;G1?<F5G<U]L:79E("@I.PH@("!M:6YI;6EZ
M92 ]("A405)'151?0T%,3%]04D],3T=515,*( D@(" @(" F)B A8V9U;BT^
M;6%C:&EN92T^:7-?:6YT97)R=7!T"D! ("TX-3(L,3(@address@hidden 0 H@
M"2 @("!["B @(" @(" @(" @(" @("\J(%1R>2!T=V\@;65T:&]D<R!T;R!A
M9&IU<W0@<address@hidden('-E;&5C="!S:&]R=&5S="X@("HO"B @(" @(" @
M(" @(" @(&EN="!F<%]P;'5S7VQE;F=T:#L**R @(" @(" @(" @(" @<G1X
M(&UY9G ["B @(" @(" @(" @(" @("\J($UE=&AO9" Q+4%D:G5S="!F<F%M
M92!P;VEN=&5R+B @*B\**R @(" @(" @(" @(" @+RH@($9I<G-T(&UE=&AO
M9"X@("HO"BL)(" @(" @:address@hidden"0E["BL)
M"2 @address@hidden&AE(&AI9V@@8GET92 H<C(Y*2!D;V5S;B=T(&-H86YG92 M('!R
M969E<B G<W5B:2<@address@hidden;&4I"BL)"2 @("!O=F5R("=S8FEW)R H,B!C
M>6-L97,L('-A;64@<VEZ92DN(" J+PHK"0D@(&UY9G @/2!G96Y?<G1X7U)%
M1R H44EM;V1E+"!214=.3R H9G)A;65?<&]I;G1E<E]R='@I*3L**PD)?0HK
M"2 @(" @(&5L<V4@"BL)"7L**PD)(" O*B @3F]R;6%L('-I>F5D(&%D9&ET
M:6]N+B @*B\**PD)("!M>69P(address@hidden)A;65?<&]I;G1E<E]R='@["BL)"7T*
M*PH@(" @(" @(" @(" @("!F<%]P;'5S7VQE;F=T:" ]( HM"2 @(" @(" @
M9V5T7V%T=')?;&5N9W1H("AG96Y?;6]V95]I;G-N("AF<F%M95]P;VEN=&5R
M7W)T>"P*+2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(&=E;E]R='A?4$Q54R H2$EM;V1E+"!F<F%M95]P;VEN=&5R
M7W)T>"P**PD@(" @(" @(&=E=%]A='1R7VQE;F=T:" H9V5N7VUO=F5?:6YS
M;B H;7EF<"P**R @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(&=E;E]R='A?4$Q54R H1T547TU/1$4H;7EF<"DL(&UY
M9G L"B @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(&=E;E]I;G1?;6]D92 H<VEZ92P*+0D)
M"0D)"0D)"2 @("!(26UO9&4I*2DI.PHK"0D)"0D)"0D)(" @($=%5%]-3T1%
M*&UY9G I*2DI*3L*(" @(" @(" @(" @(" @address@hidden>2!T;R!S=&%C:R!P
M;VEN=&5R+B @*B\*(" @(" @(" @(" @(" @9G!?<&QU<U]L96YG=&@@*ST@
M"B )(" @(" @("!G971?871T<E]L96YG=&@@*&=E;E]M;W9E7VEN<address@hidden'-T
M86-K7W!O:6YT97)?<G1X+"!F<F%M95]P;VEN=&5R7W)T>"DI.R @(" *0$ @
address@hidden,2PY("LY,#DL.2! 0 H@(" @(" @(" @(" @(" @('T*(" @(" @(" @
M(" @(" @96QS90H@(" @(" @(" @(" @(" @('L*+2 @(" @(" @(" @(" @
M(" @(&5M:71?;6]V95]I;G-N("AF<F%M95]P;VEN=&5R7W)T>"P*+2 @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @("!G96Y?<G1X7U!,55,@*$A)
M;address@hidden)A;65?<&]I;G1E<E]R='@L"BT@(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @("!G96Y?:6YT7VUO9&address@hidden'-I
M>F4L($A);6]D92DI*3L**R @(" @(" @(" @(" @(" @(&5M:71?;6]V95]I
M;G-N("AM>69P+ HK(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(&=E;E]R='A?4$Q54R H1T547TU/1$4H;7EF<"DL(&UY9G L"BL@(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!G96Y?
M:6YT7VUO9&address@hidden'-I>F4L($=%5%]-3T1%*&UY9G I*2DI.PH@(" @(" @(" @
M(" @(" @(" @address@hidden>2!T;R!S=&%C:R!P;VEN=&5R+B @*B\*(" @(" @
M(" @(" @(" @(" @(&5M:71?;6]V95]I;G-N("AS=&%C:U]P;VEN=&5R7W)T
M>"address@hidden)A;65?<&]I;G1E<E]R='@I.PH@(" @(" @(" @(" @(" @('T*0$ @
M+3DP-2PV("LY,S,L,address@hidden *(" @(" @(&EF("AC9G5N+3YM86-H:6YE+3YI
M<U]I;G1E<G)U<'address@hidden'address@hidden;BT^;6%C:&EN92T^:7-?<VEG;F%L*0H@(" @
M(" @("!["B **R @(" @(" @(" O*B!297-T;W)E(%)!35!:('5S:6YG('1M
M<"!R96<@87,@<V-R871C:"X@("HO"BL)("!I9BA!5E)?2$%615]204U06B *
M*PD@(" @("8F("%405)'address@hidden"2 @(" @)address@hidden
M4U1?2$%21%]214=?0DE4("AS970L(%)%1U]:*2 F)B!415-47TA!4D1?4D5'
M7T))5" H<V5T+"!214=?6B K(#$I*2D**R @(" @(" @(" @('L**PD@(" @
M("!E;6ET7VEN<address@hidden&=E;E]P;W!Q:2 H=&UP7W)E9U]R='@I*3L**PD@(" @
M("!E;6ET7VUO=F5?:6YS;B H9V5N7W)T>%]-14TH44EM;V1E+"!'14Y?24Y4
M*%)!35!:7T%$1%(I*2P@"BL)"0D@(" @("!T;7!?<F5G7W)T>"D["BL)(" @
M('T**PH@(" @(" @(" @("\J(%)E<W1O<address@hidden)%1R!U<VEN9R!T;7 @<F5G
M(&%S('-C<address@hidden(" J+PH@(" @(" @(" @(&5M:71?:6YS;B H9V5N7W!O
M<'%I("AT;7!?<F5G7W)T>"DI.PH@(" @(" @"DEN9&5X.B!G8V,O8V]N9FEG
M+V%V<B]A=G(N;W!T"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*+2TM(&=C8R]C
M;VYF:6<O879R+V%V<BYO<'0)*')E=FES:6]N(#$S,3DT,RD**RLK(&=C8R]C
M;VYF:6<O879R+V%V<BYO<'0)*'=O<FMI;F<@8V]P>2D*0$ @+38V+#,@*S8V
M+#<@0$ *(&UP;65M+7=R87 M87)O=6YD"B!487)address@hidden;W)T"B!-86ME
M('1H92!L:6YK97(@<F5L87AA=&EO;B!M86-H:6YE(&%S<W5M92!T:&%T(&$@
M<')O9W)A;2!C;W5N=&5R('=R87 M87)O=6YD(&]C8W5R97,N"BL**VUN;RUS
M879E+7)A;7!Z"BM487)address@hidden;W)T(%)E:F5C=$YE9V%T:79E($UA<VLH
M3D]?4T%615]204U06BD**T1O;B=T('address@hidden@:6X@:6YT97)R=7!T
M('-E<G9I8V4@<F]U=&EN97,N"DEN9&5X.B!G8V,O8V]N9FEG+V%V<B]A=G(N
M: H]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]"BTM+2!G8V,O8V]N9FEG+V%V<B]A
M=G(N: DH<F5V:7-I;VX@,3,address@hidden;F9I9R]A=G(O879R
M+F@)*'=O<FMI;F<@8V]P>2D*0$ @address@hidden<@0$ *("-D969I;F4@
M05927TA!5D5?355,("AA=G)?:&%V95]M=6Q?<"D*("-D969I;address@hidden
M5D5?34]65R H879R7VAA=F5?;6]V=U]L<&UX7W I"B C9&5F:6YE($%64E](
M059%7TQ035@@*&%V<E]H879E7VUO=G=?;'!M>%]P*0HK(V1E9FEN92!!5E)?
M2$%615]204U06B H879R7V-U<G)E;G1?87)C:"T^:&%V95]E;'!M*0H@"B C
M9&5F:6YE($%64E\R7T)95$5?4$,@,0H@(V1E9FEN92!!5E)?,U]"651%7U!#
#(# *
`
end





reply via email to

[Prev in Thread] Current Thread [Next in Thread]