Skip to content

Commit

Permalink
Update cfi offsets for pthread_cond_broadcast and signal fir x86.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinakar Guniguntala authored and Ulrich Drepper committed Nov 18, 2009
1 parent 7429b19 commit dd7106b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 38 deletions.
7 changes: 7 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2009-11-18 Dinakar Guniguntala <dino@in.ibm.com>

* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S:
Remove redundant code. Fix cfi offsets.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S:
Fix cfi offsets.

2009-11-17 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Minimally
Expand Down
41 changes: 10 additions & 31 deletions nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ __pthread_cond_broadcast:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
cfi_rel_offset(%ebx, 0)
pushl %esi
cfi_adjust_cfa_offset(4)
cfi_rel_offset(%esi, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
cfi_rel_offset(%edi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
cfi_offset(%ebx, -8)
cfi_offset(%esi, -12)
cfi_offset(%edi, -16)
cfi_offset(%ebp, -20)
cfi_rel_offset(%ebp, 0)
cfi_remember_state

movl 20(%esp), %ebx

Expand Down Expand Up @@ -120,7 +121,7 @@ __pthread_cond_broadcast:
cmpl $0xfffff001, %eax
jae 9f

10: xorl %eax, %eax
6: xorl %eax, %eax
popl %ebp
cfi_adjust_cfa_offset(-4)
cfi_restore(%ebp)
Expand All @@ -135,37 +136,15 @@ __pthread_cond_broadcast:
cfi_restore(%ebx)
ret

cfi_adjust_cfa_offset(16)
cfi_offset(%ebx, -8)
cfi_offset(%esi, -12)
cfi_offset(%edi, -16)
cfi_offset(%ebp, -20)
cfi_restore_state

.align 16
/* Unlock. */
4: LOCK
subl $1, cond_lock-cond_futex(%ebx)
jne 5f
jmp 6b

6: xorl %eax, %eax
popl %ebp
cfi_adjust_cfa_offset(-4)
cfi_restore(%ebp)
popl %edi
cfi_adjust_cfa_offset(-4)
cfi_restore(%edi)
popl %esi
cfi_adjust_cfa_offset(-4)
cfi_restore(%esi)
popl %ebx
cfi_adjust_cfa_offset(-4)
cfi_restore(%ebx)
ret

cfi_adjust_cfa_offset(16)
cfi_offset(%ebx, -8)
cfi_offset(%esi, -12)
cfi_offset(%edi, -16)
cfi_offset(%ebp, -20)
/* Initial locking failed. */
1:
#if cond_lock == 0
Expand Down Expand Up @@ -232,7 +211,7 @@ __pthread_cond_broadcast:
addl $FUTEX_WAKE, %ecx
movl $SYS_futex, %eax
ENTER_KERNEL
jmp 10b
jmp 6b
cfi_endproc
.size __pthread_cond_broadcast, .-__pthread_cond_broadcast
versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast,
Expand Down
13 changes: 6 additions & 7 deletions nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ __pthread_cond_signal:
cfi_startproc
pushl %ebx
cfi_adjust_cfa_offset(4)
cfi_rel_offset(%ebx, 0)
pushl %edi
cfi_adjust_cfa_offset(4)
cfi_offset(%ebx, -8)
cfi_offset(%edi, -12)
cfi_rel_offset(%edi, 0)
cfi_remember_state

movl 12(%esp), %edi

Expand Down Expand Up @@ -75,10 +76,10 @@ __pthread_cond_signal:
/* Wake up one thread. */
pushl %esi
cfi_adjust_cfa_offset(4)
cfi_rel_offset(%esi, 0)
pushl %ebp
cfi_adjust_cfa_offset(4)
cfi_offset(%esi, -16)
cfi_offset(%ebp, -20)
cfi_rel_offset(%ebp, 0)

#if FUTEX_PRIVATE_FLAG > 255
xorl %ecx, %ecx
Expand Down Expand Up @@ -121,9 +122,7 @@ __pthread_cond_signal:
cfi_restore(%ebx)
ret

cfi_adjust_cfa_offset(8)
cfi_offset(%ebx, -8)
cfi_offset(%edi, -12)
cfi_restore_state

7: /* %ecx should be either FUTEX_WAKE_OP or
FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */
Expand Down

0 comments on commit dd7106b

Please sign in to comment.