2009-03-08 12:48:58 +00:00
|
|
|
#ifndef _SETJMP_H_
|
|
|
|
#define _SETJMP_H_
|
|
|
|
|
|
|
|
/* Combined parts of include/setjmp.h and include/machine/setjmp.h in
|
|
|
|
* newlib 1.17.0, with minor changes for Rockbox.
|
|
|
|
*/
|
|
|
|
|
2010-08-24 12:38:42 +00:00
|
|
|
#include "config.h"
|
2009-03-08 12:48:58 +00:00
|
|
|
#ifdef CPU_ARM
|
|
|
|
/*
|
|
|
|
* All callee preserved registers:
|
|
|
|
* v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7
|
|
|
|
*/
|
|
|
|
#define _JBLEN 23
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* necv70 was 9 as well. */
|
|
|
|
|
|
|
|
#ifdef CPU_COLDFIRE
|
|
|
|
/*
|
|
|
|
* onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
|
2010-02-22 19:44:05 +00:00
|
|
|
* fp2-fp7 for 68881.
|
2009-03-08 12:48:58 +00:00
|
|
|
* All else recovered by under/over(flow) handling.
|
|
|
|
*/
|
2010-02-22 19:44:05 +00:00
|
|
|
#define _JBLEN 34
|
2009-03-08 12:48:58 +00:00
|
|
|
#endif
|
|
|
|
|
2009-04-16 13:48:34 +00:00
|
|
|
#ifdef CPU_MIPS
|
|
|
|
#if CPU_MIPS == 64
|
2009-03-08 12:48:58 +00:00
|
|
|
#define _JBTYPE long long
|
|
|
|
#endif
|
|
|
|
#ifdef __mips_soft_float
|
|
|
|
#define _JBLEN 11
|
|
|
|
#else
|
|
|
|
#define _JBLEN 23
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2010-08-24 12:38:42 +00:00
|
|
|
#ifdef CPU_SH
|
|
|
|
#define __SH5__ 0
|
2009-03-08 12:48:58 +00:00
|
|
|
#if __SH5__
|
|
|
|
#define _JBLEN 50
|
|
|
|
#define _JBTYPE long long
|
|
|
|
#else
|
2010-08-24 12:38:42 +00:00
|
|
|
/* r8 through r15 (callee saved), pr, fp regs if available */
|
2009-03-08 12:48:58 +00:00
|
|
|
#define _JBLEN 20
|
|
|
|
#endif /* __SH5__ */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _JBLEN
|
|
|
|
#ifdef _JBTYPE
|
2010-02-22 19:44:05 +00:00
|
|
|
typedef _JBTYPE jmp_buf[_JBLEN];
|
2009-03-08 12:48:58 +00:00
|
|
|
#else
|
2010-02-22 19:44:05 +00:00
|
|
|
typedef int jmp_buf[_JBLEN];
|
2009-03-08 12:48:58 +00:00
|
|
|
#endif
|
2009-04-22 15:04:26 +00:00
|
|
|
#else
|
|
|
|
typedef int jmp_buf;
|
2009-03-08 12:48:58 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
extern void longjmp(jmp_buf __jmpb, int __retval);
|
|
|
|
extern int setjmp(jmp_buf __jmpb);
|
|
|
|
|
|
|
|
#endif // _SETJMP_H_
|