This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, OR1K] Support for optional delay slot


Dear all,

this patch adds support for the different variants of delay slots (its optional). or1knd is the machine name without delay slot, or1k is the (standard) one with delay slot, and for compatibility we simply put a nop into the delay slot.

Bye,
Stefan

commit 0790c6718f2e51b45b03a8c77600bf8db22ef07b
Author: Stefan Wallentowitz <stefan.wallentowitz@tum.de>
Date:   Thu Dec 11 15:21:06 2014 +0100

    OR1K: Optional delay slot support

    The machine or1knd are OpenRISC implementations without delay slot

    newlib/Changelog:
        * configure.host: or1knd support, OpenRISC without delay slot
        * libc/include/machine/setjmp.h: Add or1knd
        * libc/machine/or1k/setjmp.S: Optional delay slot

diff --git a/config.guess b/config.guess
index 2055429..5e86705 100755
--- a/config.guess
+++ b/config.guess
@@ -967,6 +967,9 @@ EOF
     or32:Linux:*:*)
     echo ${UNAME_MACHINE}-unknown-linux-gnu
     exit ;;
+    or1knd:Linux:*:*)
+    echo or1knd-unknown-linux-gnu
+    exit ;;
     padre:Linux:*:*)
     echo sparc-unknown-linux-gnu
     exit ;;
diff --git a/config.sub b/config.sub
index 8b612ab..86e5a86 100755
--- a/config.sub
+++ b/config.sub
@@ -296,7 +296,7 @@ case $basic_machine in
     | nios | nios2 | nios2eb | nios2el \
     | ns16k | ns32k \
     | open8 \
-    | or1k | or32 \
+    | or1k | or1knd | or32 \
     | pdp10 | pdp11 | pj | pjl \
     | powerpc | powerpc64 | powerpc64le | powerpcle \
     | pyramid \
@@ -1589,7 +1589,7 @@ case $basic_machine in
     mips*-*)
         os=-elf
         ;;
-    or1k-*)
+    or1k-* | or1knd-*)
         os=-elf
         ;;
     or32-*)
diff --git a/newlib/configure.host b/newlib/configure.host
index c7a0401..d405d22 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -245,7 +245,7 @@ case "${host_cpu}" in
   nios2*)
     machine_dir=nios2
     ;;
-  or1k*)
+  or1k*|or1knd*)
     machine_dir=or1k
     ;;
   powerpc*)
diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h
index 596e64b..a9e0d71 100644
--- a/newlib/libc/include/machine/setjmp.h
+++ b/newlib/libc/include/machine/setjmp.h
@@ -1,7 +1,7 @@

 _BEGIN_STD_C

-#ifdef __or1k__
+#if defined(__or1k__) || defined(__or1knd__)
 #define _JBLEN 31 /* 32 GPRs - r0 */
 #define _JBTYPE unsigned long
 #endif
diff --git a/newlib/libc/machine/or1k/setjmp.S b/newlib/libc/machine/or1k/setjmp.S
index 13ccf8a..5c02327 100644
--- a/newlib/libc/machine/or1k/setjmp.S
+++ b/newlib/libc/machine/or1k/setjmp.S
@@ -49,8 +49,18 @@ setjmp:
     l.mfspr    r13, r0, 17
     l.sw    124(r3), r13
 /* Set result register to 0 and jump */
+// Different cases for optional delay slot
+#if defined(__OR1K_NODELAY__)
+    l.addi    r11, r0, 0
+    l.jr    r9
+#elif defined(__OR1K_DELAY__)
     l.jr    r9
     l.addi    r11, r0, 0
+#else
+    l.addi    r11, r0, 0
+    l.jr    r9
+    l.nop
+#endif

 .align  4
 .global longjmp
@@ -83,7 +93,16 @@ longjmp:
     l.lwz    r24, 92(r3)
     l.lwz    r26, 100(r3)
     l.lwz    r28, 108(r3)
-    l.lwz    r30, 116(r3)

+// Different cases for optional delay slot
+#if defined(__OR1K_NODELAY__)
+    l.lwz    r30, 116(r3)
+    l.jr    r9
+#elif defined(__OR1K_DELAY__)
+    l.jr    r9
+    l.lwz    r30, 116(r3)
+#else
+    l.lwz    r30, 116(r3)
     l.jr    r9
     l.nop
+#endif


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]