Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include/machine')
-rw-r--r--newlib/libc/include/machine/ieeefp.h13
-rw-r--r--newlib/libc/include/machine/setjmp.h53
2 files changed, 56 insertions, 10 deletions
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index f8795c072..dd1fceda9 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -359,6 +359,11 @@
#define __IEEE_BIG_ENDIAN
#endif
+#ifdef __MSP430__
+#define __IEEE_LITTLE_ENDIAN
+#define __SMALL_BITFIELDS /* 16 Bit INT */
+#endif
+
#ifdef __RL78__
#define __IEEE_LITTLE_ENDIAN
#define __SMALL_BITFIELDS /* 16 Bit INT */
@@ -388,6 +393,14 @@
#define __SMALL_BITFIELDS /* 16 Bit INT */
#endif
+#ifdef __NIOS2__
+# ifdef __nios2_big_endian__
+# define __IEEE_BIG_ENDIAN
+# else
+# define __IEEE_LITTLE_ENDIAN
+# endif
+#endif
+
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!
diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 31a8032d8..78fbdd78b 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -68,19 +68,24 @@ _BEGIN_STD_C
#define _JBLEN 9
#endif
-#if defined(__CYGWIN__) && !defined (_JBLEN)
-#define _JBLEN (13 * 4)
-#elif defined (__i386__)
-#if defined(__unix__) || defined(__rtems__)
-# define _JBLEN 9
-#else
-#include "setjmp-dj.h"
-#endif
+#ifdef __i386__
+# if defined(__CYGWIN__) && !defined (_JBLEN)
+# define _JBLEN (13 * 4)
+# elif defined(__unix__) || defined(__rtems__)
+# define _JBLEN 9
+# else
+# include "setjmp-dj.h"
+# endif
#endif
#ifdef __x86_64__
-#define _JBTYPE long long
-#define _JBLEN 8
+# ifdef __CYGWIN__
+# define _JBTYPE long
+# define _JBLEN 32
+# else
+# define _JBTYPE long long
+# define _JBLEN 8
+# endif
#endif
#ifdef __i960__
@@ -276,12 +281,40 @@ _BEGIN_STD_C
#define _JBTYPE unsigned short
#endif /* __m32c__ */
+#ifdef __MSP430__
+#define _JBLEN 9
+
+#ifdef __MSP430X_LARGE__
+#define _JBTYPE unsigned long
+#else
+#define _JBTYPE unsigned short
+#endif
+#endif
+
#ifdef __RL78__
/* Three banks of registers, SP, CS, ES, PC */
#define _JBLEN (8*3+8)
#define _JBTYPE unsigned char
#endif
+/*
+ * There are two versions of setjmp()/longjmp():
+ * 1) Compiler (gcc) built-in versions.
+ * 2) Function-call versions.
+ *
+ * The built-in versions are used most of the time. When used, gcc replaces
+ * calls to setjmp()/longjmp() with inline assembly code. The built-in
+ * versions save/restore a variable number of registers.
+
+ * _JBLEN is set to 40 to be ultra-safe with the built-in versions.
+ * It only needs to be 12 for the function-call versions
+ * but this data structure is used by both versions.
+ */
+#ifdef __NIOS2__
+#define _JBLEN 40
+#define _JBTYPE unsigned long
+#endif
+
#ifdef __RX__
#define _JBLEN 0x44
#endif