]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/arm/sysdep.h: Define __USE_BX__ if bx is available.
authorRoland McGrath <roland@gnu.org>
Sat, 4 Dec 2004 21:20:42 +0000 (21:20 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 4 Dec 2004 21:20:42 +0000 (21:20 +0000)
Use it instead of __THUMB_INTERWORK__.  Make RETINSTR take
only a condition and a register.
* sysdeps/arm/dl-machine.h: Use __USE_BX__ instead of
__THUMB_INTERWORK__.
(_dl_start_user): Use BX.
* sysdeps/arm/strlen.S: Use DO_RET.
* sysdeps/unix/arm/brk.S, sysdeps/unix/arm/fork.S,
sysdeps/unix/arm/sysdep.S, sysdeps/unix/arm/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/arm/clone.S,
sysdeps/unix/sysv/linux/arm/mmap.S,
sysdeps/unix/sysv/linux/arm/mmap64.S,
sysdeps/unix/sysv/linux/arm/socket.S,
sysdeps/unix/sysv/linux/arm/sysdep.h,
sysdeps/unix/sysv/linux/arm/vfork.S: Update uses of RETINSTR.

17 files changed:
ChangeLog
linuxthreads/ChangeLog
linuxthreads/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/arm/vfork.S
sysdeps/arm/dl-machine.h
sysdeps/arm/strlen.S
sysdeps/arm/sysdep.h
sysdeps/unix/arm/brk.S
sysdeps/unix/arm/fork.S
sysdeps/unix/arm/sysdep.S
sysdeps/unix/arm/sysdep.h
sysdeps/unix/sysv/linux/arm/clone.S
sysdeps/unix/sysv/linux/arm/mmap.S
sysdeps/unix/sysv/linux/arm/mmap64.S
sysdeps/unix/sysv/linux/arm/socket.S
sysdeps/unix/sysv/linux/arm/sysdep.h
sysdeps/unix/sysv/linux/arm/vfork.S

index 2d1126eac07b7d99c3a88768ba875d1afbe71f57..37b677a4b043b43cbe4c530d108fcd73d9f28116 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * sysdeps/arm/sysdep.h: Define __USE_BX__ if bx is available.
+       Use it instead of __THUMB_INTERWORK__.  Make RETINSTR take
+       only a condition and a register.
+       * sysdeps/arm/dl-machine.h: Use __USE_BX__ instead of
+       __THUMB_INTERWORK__.
+       (_dl_start_user): Use BX.
+       * sysdeps/arm/strlen.S: Use DO_RET.
+       * sysdeps/unix/arm/brk.S, sysdeps/unix/arm/fork.S,
+       sysdeps/unix/arm/sysdep.S, sysdeps/unix/arm/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/arm/clone.S,
+       sysdeps/unix/sysv/linux/arm/mmap.S,
+       sysdeps/unix/sysv/linux/arm/mmap64.S,
+       sysdeps/unix/sysv/linux/arm/socket.S,
+       sysdeps/unix/sysv/linux/arm/sysdep.h,
+       sysdeps/unix/sysv/linux/arm/vfork.S: Update uses of RETINSTR.
+
 2004-12-02  Roland McGrath  <roland@redhat.com>
 
        * extra-lib.mk (object-suffixes-$(lib)): Add .oS when
index e983f61b342dd8f33369a93742e27945d1dca140..d9cf6d79519f93048cbdf537443a09234b7c60f3 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Update RETINSTR use.
+       * sysdeps/unix/sysv/linux/arm/vfork.S: Likewise.
+
 2004-12-02  Roland McGrath  <roland@redhat.com>
 
        * Makefile (libpthread-nonshared): Variable removed.
index 92d8460e26b516391b8e06a094729da0e0517d59..019bd549139725cc17c9f8c1d44d64b691b7b0a5 100644 (file)
@@ -112,7 +112,7 @@ extern int __local_multiple_threads attribute_hidden;
 #   define MAYBE_SAVE_LR                                               \
   str lr, [sp, $-4]!;
 #   define PSEUDO_RET_MOV                                              \
-  RETINSTR(movcc, pc, lr);                                             \
+  RETINSTR(cc, lr);                                                    \
   b PLTJMP(SYSCALL_ERROR)
 #   define PSEUDO_PROLOGUE
 #  else
index 23687342d1e63dedc4198b9e7545871f25cc2029..2708c701eb206290960e1dcb00359b1a39de1d2b 100644 (file)
@@ -46,7 +46,7 @@ ENTRY (__vfork)
                
        swi     __NR_vfork
        cmn     a1, #4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
 
 #ifndef __ASSUME_VFORK_SYSCALL
        /* Check if vfork syscall is known at all.  */
@@ -60,7 +60,7 @@ ENTRY (__vfork)
        /* If we don't have vfork, fork is close enough.  */
        swi     __NR_fork
        cmn     a1, #4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
 #elif !defined __NR_vfork
 # error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"
 #endif
index 5dfe3346f55c8897b1186481e79fdaa898d261dc..761f8daeaabe75e002285c9f9e429c7200c291d6 100644 (file)
@@ -123,7 +123,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
   return lazy;
 }
 
-#if defined(__THUMB_INTERWORK__)
+#if defined(__USE_BX__)
 #define BX(x) "bx\t" #x
 #else
 #define BX(x) "mov\tpc, " #x
@@ -293,7 +293,7 @@ _dl_start_user:\n\
        ldr     r0, .L_FINI_PROC\n\
        add     r0, sl, r0\n\
        @ jump to the user_s entry point\n\
-       mov     pc, r6\n\
+       " BX(r6) "\n\
 .L_GET_GOT:\n\
        .word   _GLOBAL_OFFSET_TABLE_ - .L_GOT_GOT - 4\n\
 .L_SKIP_ARGS:\n\
index a83c41d26af5b030241b8f19dc8bfcb78c322fb4..86e16652e41b385d6069daa82a3bf2567afffa05 100644 (file)
@@ -68,6 +68,6 @@ Llastword:                            @ drop through to here once we find a
        tstne   r2, $0x00ff0000         @ (if first three all non-zero, 4th
        addne   r0, r0, $1              @  must be zero)
 #endif
-       RETINSTR(mov,pc,lr)
+       DO_RET(lr)
 END(strlen)
 libc_hidden_builtin_def (strlen)
index cb3f105afe4a235204c122ede70ae8b468dcc164..8ca77a60cbea921a03b077a3af115a6abcf2af99 100644 (file)
 
 #include <sysdeps/generic/sysdep.h>
 
+#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
+     && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
+# define __USE_BX__
+#endif
+
 #ifdef __ASSEMBLER__
 
 /* Syntactic details of assembler.  */
 #ifdef __APCS_32__
 #define LOADREGS(cond, base, reglist...)\
        ldm##cond       base,reglist
-#define RETINSTR(instr, regs...)\
-       instr   regs
-#ifdef __THUMB_INTERWORK__
+#ifdef __USE_BX__
+#define RETINSTR(cond, reg)    \
+       bx##cond        reg
 #define DO_RET(_reg)           \
        bx _reg
 #else
+#define RETINSTR(cond, reg)    \
+       mov##cond       pc, reg
 #define DO_RET(_reg)           \
        mov pc, _reg
 #endif
 #else  /* APCS-26 */
 #define LOADREGS(cond, base, reglist...)\
        ldm##cond       base,reglist^
-#define RETINSTR(instr, regs...)\
-       instr##s        regs
+#define RETINSTR(cond, reg)    \
+       mov##cond##s    pc, reg
 #define DO_RET(_reg)           \
        movs pc, _reg
 #endif
index 9e20dc6932698f5a6af48cae3b0ab2702c73430b..914e8a8bbe36d58ae8a239a6dc34f777ae8dea61 100644 (file)
@@ -43,7 +43,7 @@ SYSCALL__ (brk, 1)
 #endif
        str r0, [r1]
        mov r0, $0
-       RETINSTR(mov, pc, r14)
+       DO_RET (r14)
 #ifdef PIC
 1:     .long _GLOBAL_OFFSET_TABLE_ - 2b - 8
 _cb_addr:
index b317b66a976c712a90c335038cd09903b7a16b25..bd00c92cfe5c7ab3ff860deab3dc5b4b030a0218 100644 (file)
@@ -27,7 +27,7 @@ SYSCALL__ (fork, 0)
           R0&-1==R0, and the child gets R0&0==0.  */
        sub r1, r1, $1
        and r0, r0, r1
-       RETINSTR(mov, pc, r14)
+       DO_RET (r14)
 PSEUDO_END (__fork)
 libc_hidden_def (__fork)
 
index 5fc80a872eb7ddd02b609b578530f60861e584e8..4810805d856b421bf951ea0173c4a0e4af150e3a 100644 (file)
@@ -50,7 +50,7 @@ syscall_error:
        ldr r1, 1f
        str r0, [r1]
        mvn r0, $0
-       RETINSTR(mov, pc, r14)
+       DO_RET (r14)
 
 1:     .long C_SYMBOL_NAME(errno)
 #else
@@ -60,7 +60,7 @@ syscall_error:
 0:     add r2, pc, r2
        str r0, [r1, r2]
        mvn r0, $0
-       RETINSTR(mov, pc, r14)
+       DO_RET (r14)
 
 1:     .word _GLOBAL_OFFSET_TABLE_ - 0b - 8
 2:     .word C_SYMBOL_NAME(errno)(GOTOFF)
index d776b45aa2cbaed08f283d588883a0f43906f10e..5f36272f27e6a3f8547546c367f13728ac869f5b 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifdef __ASSEMBLER__
 
-#define ret            RETINSTR(mov, pc, r14)
+#define ret            DO_RET (r14)
 #define MOVE(a,b)      mov b,a
 
 #endif
index 1c6f7861cfafa448b54dbc192ce49b5186ccd5d2..bf07fb39528812f0e02a0402e1f1243747200daf 100644 (file)
@@ -45,7 +45,7 @@ ENTRY(__clone)
        swi     SYS_ify(clone)
        movs    a1, a1
        blt     PLTJMP(C_SYMBOL_NAME(__syscall_error))
-       RETINSTR(movne, pc, lr)
+       RETINSTR(ne, lr)
 
        @ pick the function arg and call address off the stack and execute
        ldr     r0, [sp, #4]
index 7beba6841ce73362ae09229c52b00ae9c6f1eb9b..cf6f253378cc6fb882547df2fb4c6a3c2b18cde4 100644 (file)
@@ -51,7 +51,7 @@ ENTRY (__mmap)
        ldr     r5, [sp], #4
 
        cmn     r0, $4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
        b       PLTJMP(syscall_error)
 
 .Linval:
@@ -83,7 +83,7 @@ ENTRY (__mmap)
        add     sp, sp, #16
 
        cmn     r0, $4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
        b       PLTJMP(syscall_error);
 #endif
 
index f8361b5cbf6831d537f84cc23830bc4d5ec5f2c6..b4b712c2f28c472eb246a6f856cbb535c7c781ed 100644 (file)
@@ -43,12 +43,12 @@ ENTRY (__mmap64)
 # ifdef __ASSUME_MMAP2_SYSCALL
        ldr     r4, [sp], #4
        ldr     r5, [sp], #4
-       RETINSTR(movcc, pc, lr) 
+       RETINSTR(cc, lr)        
        b       PLTJMP(syscall_error)
 # else
        ldrcc   r4, [sp], #4
        ldrcc   r5, [sp], #4
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
        cmn     r0, $ENOSYS
        bne     .Lerror
        /* The current kernel does not support mmap2.  Fall back to plain
index 3e93ceb6d20949503518f06af6eaf27802644e5c..212a489afedbba5b3f09fd9a9af85df192cd3428 100644 (file)
@@ -91,7 +91,7 @@ ENTRY (__socket)
 
        /* r0 is < 0 if there was an error.  */
        cmn r0, $124
-       RETINSTR(movcc, pc, r14)
+       RETINSTR(cc, r14)
        b PLTJMP(SYSCALL_ERROR)
 
 #if defined NEED_CANCELLATION && defined CENABLE
@@ -114,7 +114,7 @@ ENTRY (__socket)
 
        /* r0 is < 0 if there was an error.  */
        cmn r0, $124
-       RETINSTR(movcc, pc, r14)
+       RETINSTR(cc, r14)
        b PLTJMP(SYSCALL_ERROR)
 #endif
 
index fda7c5b26706e977096bc27ca843c0b4e10c1435..668aa1a2f18f26a591908e4f24f3a6da8aac0509 100644 (file)
@@ -54,7 +54,7 @@
     cmn r0, $4096;
 
 #define PSEUDO_RET                                                           \
-    RETINSTR(movcc, pc, lr);                                                 \
+    RETINSTR(cc, lr);                                                        \
     b PLTJMP(SYSCALL_ERROR)
 #undef ret
 #define ret PSEUDO_RET
@@ -71,7 +71,7 @@
     DO_CALL (syscall_name, args);
 
 #define PSEUDO_RET_NOERRNO                                                   \
-    RETINSTR(mov, pc, lr);
+    DO_RET (lr);
 
 #undef ret_NOERRNO
 #define ret_NOERRNO PSEUDO_RET_NOERRNO
index bba1a548ba81405c00ff544189674ec28c0df812..9ef5114b244ec964df3c1e2fe5d391007d22f846 100644 (file)
@@ -32,7 +32,7 @@ ENTRY (__vfork)
 #ifdef __NR_vfork
        swi     __NR_vfork
        cmn     a1, #4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
 
 # ifdef __ASSUME_VFORK_SYSCALL
        b       PLTJMP(C_SYMBOL_NAME(__syscall_error))
@@ -47,7 +47,7 @@ ENTRY (__vfork)
        /* If we don't have vfork, fork is close enough.  */
        swi     __NR_fork
        cmn     a1, #4096
-       RETINSTR(movcc, pc, lr)
+       RETINSTR(cc, lr)
        b       PLTJMP(C_SYMBOL_NAME(__syscall_error))
 #elif !defined __NR_vfork
 # error "__NR_vfork not available and __ASSUME_VFORK_SYSCALL defined"