diff options
| author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-06-15 09:14:50 +0200 |
|---|---|---|
| committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2009-07-02 09:32:34 +0200 |
| commit | cf92e58afe3f38a349491fe5675336c2c0212dad (patch) | |
| tree | dd8a02e3d741ebae025656c19bb8e31e9cb898f6 /libpthread/nptl/sysdeps/unix/sysv/linux | |
| parent | c5d3c1a6d2d77ff57872147731463c3ff728062a (diff) | |
| download | uClibc-alpine-cf92e58afe3f38a349491fe5675336c2c0212dad.tar.bz2 uClibc-alpine-cf92e58afe3f38a349491fe5675336c2c0212dad.tar.xz | |
sh_nptl: Fix pthread_barrier_wait epilog to properly restore r9
In the pthread_barrier_wait function's epilog implementation do not
use the macro ret (that is defined as rts; nop) to correctly execute
in the delay slot the instruction "mov.l @r15+, r9" that will
restore the r9 register to the previous value saved on the stack and
as side effect will restore the stack pointer register back to the correct value.
Same fix is applied to __lll_mutex_lock_wait, even if in the delay slot
we have actually a nop, so using the macro would be safe here.
Signed-off-by: Christian Bruel <christian.bruel@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux')
| -rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S | 4 | ||||
| -rw-r--r-- | libpthread/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S index c19de07fc..e8a1928af 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S @@ -53,8 +53,8 @@ __lll_mutex_lock_wait: tst r2, r2 bf 1b - ret - nop + rts + nop .size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S index a122d0d22..ff3197ba0 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S @@ -135,7 +135,7 @@ pthread_barrier_wait: mov #-1, r0 /* == PTHREAD_BARRIER_SERIAL_THREAD */ lds.l @r15+, pr mov.l @r15+, r8 - ret + rts mov.l @r15+, r9 1: |
