diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 2ddca08a8..e2abf4200 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2003-07-10 Alexandre Oliva + + 2000-04-27 Alexandre Oliva + * libc/include/machine/setjmp.h (_JBLEN, AM33/2.0): Set to 26. + * libc/machine/mn10300/setjmp.S (setjmp, longjmp): Save and + restore callee-saved FP registers. + 2003-07-10 J"orn Rennecke * libc/include/sys/unistd.h (ftruncate, truncate): Also declare diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h index 7f08a017a..e6d5e3944 100644 --- a/newlib/libc/include/machine/setjmp.h +++ b/newlib/libc/include/machine/setjmp.h @@ -135,9 +135,13 @@ typedef int jmp_buf[_JBLEN]; #endif #if defined(__mn10300__) || defined(__mn10200__) +#ifdef __AM33_2__ +#define _JBLEN 26 +#else /* A guess */ #define _JBLEN 10 #endif +#endif #ifdef __v850 /* I think our setjmp is saving 15 regs at the moment. Gives us one word diff --git a/newlib/libc/machine/mn10300/setjmp.S b/newlib/libc/machine/mn10300/setjmp.S index a95f12c5a..cf42f9542 100644 --- a/newlib/libc/machine/mn10300/setjmp.S +++ b/newlib/libc/machine/mn10300/setjmp.S @@ -6,6 +6,9 @@ #ifdef __AM33__ .am33 #endif +#ifdef __AM33_2__ + .am33_2 +#endif _setjmp: mov d0,a0 mov d2,(0,a0) @@ -22,6 +25,24 @@ _setjmp: mov r5,(a0+) mov r6,(a0+) mov r7,(a0+) +#ifdef __AM33_2__ + fmov fs4,(a0+) + fmov fs5,(a0+) + fmov fs6,(a0+) + fmov fs7,(a0+) + fmov fs8,(a0+) + fmov fs9,(a0+) + fmov fs10,(a0+) + fmov fs11,(a0+) + fmov fs12,(a0+) + fmov fs13,(a0+) + fmov fs14,(a0+) + fmov fs15,(a0+) + fmov fs16,(a0+) + fmov fs17,(a0+) + fmov fs18,(a0+) + fmov fs19,(a0+) +#endif #endif sub d0,d0 rets @@ -43,6 +64,24 @@ _longjmp: mov (a0+),r5 mov (a0+),r6 mov (a0+),r7 +#ifdef __AM33_2__ + fmov (a0+),fs4 + fmov (a0+),fs5 + fmov (a0+),fs6 + fmov (a0+),fs7 + fmov (a0+),fs8 + fmov (a0+),fs9 + fmov (a0+),fs10 + fmov (a0+),fs11 + fmov (a0+),fs12 + fmov (a0+),fs13 + fmov (a0+),fs14 + fmov (a0+),fs15 + fmov (a0+),fs16 + fmov (a0+),fs17 + fmov (a0+),fs18 + fmov (a0+),fs19 +#endif #endif cmp 0,d1 bne L1