summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/machine
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include/machine')
-rw-r--r--newlib/libc/include/machine/ieeefp.h8
-rw-r--r--newlib/libc/include/machine/setjmp.h18
2 files changed, 26 insertions, 0 deletions
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index f8795c072..bf6060c53 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -388,6 +388,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 97749c0cb..1c68ce45c 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -287,6 +287,24 @@ _BEGIN_STD_C
#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