[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-commit] [2484] patch #8716: Enable setjmp/ longjmp functions f
From: |
Pitchumani |
Subject: |
[avr-libc-commit] [2484] patch #8716: Enable setjmp/ longjmp functions for AVR_TINY architecture |
Date: |
Mon, 17 Aug 2015 06:34:44 +0000 |
Revision: 2484
http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2484
Author: pitchumani
Date: 2015-08-17 06:34:41 +0000 (Mon, 17 Aug 2015)
Log Message:
-----------
patch #8716: Enable setjmp/longjmp functions for AVR_TINY architecture
Ticket Links:
------------
http://savannah.gnu.org/patch/?8716
Modified Paths:
--------------
trunk/avr-libc/ChangeLog
trunk/avr-libc/NEWS
trunk/avr-libc/include/setjmp.h
trunk/avr-libc/libc/stdlib/setjmp.S
Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog 2015-08-06 09:16:30 UTC (rev 2483)
+++ trunk/avr-libc/ChangeLog 2015-08-17 06:34:41 UTC (rev 2484)
@@ -1,3 +1,11 @@
+2015-08-17 Praveen Kumar Kaushik
+ Pitchumani Sivanupandi <address@hidden>
+
+ patch #8716: Enable setjmp/longjmp functions for AVR_TINY architecture
+ * include/setjmp.h (_JBLEN): Update for AVR_TINY arch conditionally.
+ * libc/stdlib/setjmp.S: Enable setjmp and longjmp for AVR_TINY
+ (setjmp, longjmp): Update call-saved registers for AVR_TINY
+
2015-08-06 Morten Engelhardt Olsen <address@hidden>
Fix typos and incorrect defines in header files.
Modified: trunk/avr-libc/NEWS
===================================================================
--- trunk/avr-libc/NEWS 2015-08-06 09:16:30 UTC (rev 2483)
+++ trunk/avr-libc/NEWS 2015-08-17 06:34:41 UTC (rev 2484)
@@ -35,6 +35,7 @@
[#8587] Move device specific functions to libdev.a
[#8590] WDT enable/disable for devices with CCP
[#8610] Remove eeprom function name mangling
+ [#8716] Enable setjmp/longjmp functions for AVR_TINY architecture
* Other changes:
Modified: trunk/avr-libc/include/setjmp.h
===================================================================
--- trunk/avr-libc/include/setjmp.h 2015-08-06 09:16:30 UTC (rev 2483)
+++ trunk/avr-libc/include/setjmp.h 2015-08-17 06:34:41 UTC (rev 2484)
@@ -40,17 +40,20 @@
/*
jmp_buf:
offset size description
- 0 16 call-saved registers (r2-r17)
- 16 2 frame pointer (r29:r28)
- 18 2 stack pointer (SPH:SPL)
- 20 1 status register (SREG)
- 21 2/3 return address (PC) (2 bytes used for <=128Kw flash)
- 23/24 = total size
+ 0 16/2 call-saved registers (r2-r17)
+ (AVR_TINY arch has only 2 call saved registers
(r18,r19))
+ 16/2 2 frame pointer (r29:r28)
+ 18/4 2 stack pointer (SPH:SPL)
+ 20/6 1 status register (SREG)
+ 21/7 2/3 return address (PC) (2 bytes used for <=128Kw flash)
+ 23/24/9 = total size (AVR_TINY arch always has 2 bytes PC)
*/
#if !defined(__DOXYGEN__)
-#if defined(__AVR_3_BYTE_PC__) && __AVR_3_BYTE_PC__
+#if defined(__AVR_TINY__)
+# define _JBLEN 9
+#elif defined(__AVR_3_BYTE_PC__) && __AVR_3_BYTE_PC__
# define _JBLEN 24
#else
# define _JBLEN 23
Modified: trunk/avr-libc/libc/stdlib/setjmp.S
===================================================================
--- trunk/avr-libc/libc/stdlib/setjmp.S 2015-08-06 09:16:30 UTC (rev 2483)
+++ trunk/avr-libc/libc/stdlib/setjmp.S 2015-08-17 06:34:41 UTC (rev 2484)
@@ -29,9 +29,7 @@
/* $Id$ */
-#if !defined(__AVR_TINY__)
-
/*
setjmp.S
@@ -42,12 +40,13 @@
/*
jmp_buf:
offset size description
- 0 16 call-saved registers (r2-r17)
- 16 2 frame pointer (r29:r28)
- 18 2 stack pointer (SPH:SPL)
- 20 1 status register (SREG)
- 21 2/3 return address (PC) (2 bytes used for <=128Kw flash)
- 23/24 = total size
+ 0 16/2 call-saved registers (r2-r17)
+ (AVR_TINY arch has only 2 call saved registers
(r18,r19))
+ 16/2 2 frame pointer (r29:r28)
+ 18/4 2 stack pointer (SPH:SPL)
+ 20/6 1 status register (SREG)
+ 21/7 2/3 return address (PC) (2 bytes used for <=128Kw flash)
+ 23/24/9 = total size (AVR_TINY arch always has 2 bytes PC)
All multibytes are stored as little-endian.
int setjmp(jmp_buf __jmpb);
@@ -82,7 +81,11 @@
_U(setjmp):
X_movw XL, jmpb_lo
; save call-saved registers and frame pointer
+#if !defined(__AVR_TINY__)
.irp .L_regno, 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,28,29
+#else
+ .irp .L_regno, 18,19,28,29
+#endif
st X+, r\.L_regno
.endr
; get return address
@@ -129,7 +132,11 @@
cpc ret_hi, __zero_reg__
adc ret_lo, __zero_reg__
; restore call-saved registers and frame pointer
+#if !defined(__AVR_TINY__)
.irp .L_regno, 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,28,29
+#else
+ .irp .L_regno, 18,19,28,29
+#endif
ld r\.L_regno, X+
.endr
; restore stack pointer (SP value before the setjmp() call) and SREG
@@ -169,5 +176,3 @@
.size _U(longjmp), . - _U(longjmp)
#endif /* !__DOXYGEN__ */
-
-#endif /* !defined(__AVR_TINY__) */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avr-libc-commit] [2484] patch #8716: Enable setjmp/ longjmp functions for AVR_TINY architecture,
Pitchumani <=