pthread_cond_timedwait.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /* Copyright (C) 2002-2004,2006-2007,2009,2010 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #include <sysdep.h>
  17. #include <lowlevellock.h>
  18. #include <lowlevelcond.h>
  19. #include <pthread-errnos.h>
  20. #include <pthread-pi-defines.h>
  21. #include <bits/kernel-features.h>
  22. .text
  23. /* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
  24. const struct timespec *abstime) */
  25. .globl __pthread_cond_timedwait
  26. .type __pthread_cond_timedwait, @function
  27. .align 16
  28. __pthread_cond_timedwait:
  29. .LSTARTCODE:
  30. cfi_startproc
  31. #ifdef SHARED
  32. cfi_personality(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect,
  33. DW.ref.__gcc_personality_v0)
  34. cfi_lsda(DW_EH_PE_pcrel | DW_EH_PE_sdata4, .LexceptSTART)
  35. #else
  36. cfi_personality(DW_EH_PE_udata4, __gcc_personality_v0)
  37. cfi_lsda(DW_EH_PE_udata4, .LexceptSTART)
  38. #endif
  39. pushl %ebp
  40. cfi_adjust_cfa_offset(4)
  41. cfi_rel_offset(%ebp, 0)
  42. pushl %edi
  43. cfi_adjust_cfa_offset(4)
  44. cfi_rel_offset(%edi, 0)
  45. pushl %esi
  46. cfi_adjust_cfa_offset(4)
  47. cfi_rel_offset(%esi, 0)
  48. pushl %ebx
  49. cfi_adjust_cfa_offset(4)
  50. cfi_rel_offset(%ebx, 0)
  51. movl 20(%esp), %ebx
  52. movl 28(%esp), %ebp
  53. cmpl $1000000000, 4(%ebp)
  54. movl $EINVAL, %eax
  55. jae 18f
  56. /* Get internal lock. */
  57. movl $1, %edx
  58. xorl %eax, %eax
  59. LOCK
  60. #if cond_lock == 0
  61. cmpxchgl %edx, (%ebx)
  62. #else
  63. cmpxchgl %edx, cond_lock(%ebx)
  64. #endif
  65. jnz 1f
  66. /* Store the reference to the mutex. If there is already a
  67. different value in there this is a bad user bug. */
  68. 2: cmpl $-1, dep_mutex(%ebx)
  69. movl 24(%esp), %eax
  70. je 17f
  71. movl %eax, dep_mutex(%ebx)
  72. /* Unlock the mutex. */
  73. 17: xorl %edx, %edx
  74. call __pthread_mutex_unlock_usercnt
  75. testl %eax, %eax
  76. jne 16f
  77. addl $1, total_seq(%ebx)
  78. adcl $0, total_seq+4(%ebx)
  79. addl $1, cond_futex(%ebx)
  80. addl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
  81. #define FRAME_SIZE 32
  82. subl $FRAME_SIZE, %esp
  83. cfi_adjust_cfa_offset(FRAME_SIZE)
  84. cfi_remember_state
  85. /* Get and store current wakeup_seq value. */
  86. movl wakeup_seq(%ebx), %edi
  87. movl wakeup_seq+4(%ebx), %edx
  88. movl broadcast_seq(%ebx), %eax
  89. movl %edi, 12(%esp)
  90. movl %edx, 16(%esp)
  91. movl %eax, 20(%esp)
  92. /* Reset the pi-requeued flag. */
  93. 8: movl $0, 24(%esp)
  94. /* Get the current time. */
  95. movl %ebx, %edx
  96. #ifdef __NR_clock_gettime
  97. /* Get the clock number. */
  98. movl cond_nwaiters(%ebx), %ebx
  99. andl $((1 << nwaiters_shift) - 1), %ebx
  100. /* Only clocks 0 and 1 are allowed so far. Both are handled in the
  101. kernel. */
  102. leal 4(%esp), %ecx
  103. movl $__NR_clock_gettime, %eax
  104. ENTER_KERNEL
  105. # ifndef __ASSUME_POSIX_TIMERS
  106. cmpl $-ENOSYS, %eax
  107. je 19f
  108. # endif
  109. movl %edx, %ebx
  110. /* Compute relative timeout. */
  111. movl (%ebp), %ecx
  112. movl 4(%ebp), %edx
  113. subl 4(%esp), %ecx
  114. subl 8(%esp), %edx
  115. #else
  116. /* Get the current time. */
  117. leal 4(%esp), %ebx
  118. xorl %ecx, %ecx
  119. movl $__NR_gettimeofday, %eax
  120. ENTER_KERNEL
  121. movl %edx, %ebx
  122. /* Compute relative timeout. */
  123. movl 8(%esp), %eax
  124. movl $1000, %edx
  125. mul %edx /* Milli seconds to nano seconds. */
  126. movl (%ebp), %ecx
  127. movl 4(%ebp), %edx
  128. subl 4(%esp), %ecx
  129. subl %eax, %edx
  130. #endif
  131. jns 12f
  132. addl $1000000000, %edx
  133. subl $1, %ecx
  134. 12: testl %ecx, %ecx
  135. movl $-ETIMEDOUT, %esi
  136. js 6f
  137. /* Store relative timeout. */
  138. 21: movl %ecx, 4(%esp)
  139. movl %edx, 8(%esp)
  140. movl cond_futex(%ebx), %edi
  141. movl %edi, 28(%esp)
  142. /* Unlock. */
  143. LOCK
  144. #if cond_lock == 0
  145. subl $1, (%ebx)
  146. #else
  147. subl $1, cond_lock(%ebx)
  148. #endif
  149. jne 3f
  150. .LcleanupSTART:
  151. 4: call __pthread_enable_asynccancel
  152. movl %eax, (%esp)
  153. #if FUTEX_PRIVATE_FLAG > 255
  154. xorl %ecx, %ecx
  155. #endif
  156. cmpl $-1, dep_mutex(%ebx)
  157. sete %cl
  158. je 40f
  159. movl dep_mutex(%ebx), %edi
  160. /* Requeue to a non-robust PI mutex if the PI bit is set and
  161. the robust bit is not set. */
  162. movl MUTEX_KIND(%edi), %eax
  163. andl $(ROBUST_BIT|PI_BIT), %eax
  164. cmpl $PI_BIT, %eax
  165. jne 40f
  166. movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
  167. /* The following only works like this because we only support
  168. two clocks, represented using a single bit. */
  169. testl $1, cond_nwaiters(%ebx)
  170. /* XXX Need to implement using sete instead of a jump. */
  171. jne 42f
  172. orl $FUTEX_CLOCK_REALTIME, %ecx
  173. /* Requeue-PI uses absolute timeout */
  174. 42: leal (%ebp), %esi
  175. movl 28(%esp), %edx
  176. addl $cond_futex, %ebx
  177. movl $SYS_futex, %eax
  178. ENTER_KERNEL
  179. subl $cond_futex, %ebx
  180. movl %eax, %esi
  181. /* Set the pi-requeued flag only if the kernel has returned 0. The
  182. kernel does not hold the mutex on ETIMEDOUT or any other error. */
  183. cmpl $0, %eax
  184. sete 24(%esp)
  185. je 41f
  186. /* Normal and PI futexes dont mix. Use normal futex functions only
  187. if the kernel does not support the PI futex functions. */
  188. cmpl $-ENOSYS, %eax
  189. jne 41f
  190. xorl %ecx, %ecx
  191. 40: subl $1, %ecx
  192. #ifdef __ASSUME_PRIVATE_FUTEX
  193. andl $FUTEX_PRIVATE_FLAG, %ecx
  194. #else
  195. andl %gs:PRIVATE_FUTEX, %ecx
  196. #endif
  197. #if FUTEX_WAIT != 0
  198. addl $FUTEX_WAIT, %ecx
  199. #endif
  200. leal 4(%esp), %esi
  201. movl 28(%esp), %edx
  202. addl $cond_futex, %ebx
  203. .Ladd_cond_futex:
  204. movl $SYS_futex, %eax
  205. ENTER_KERNEL
  206. subl $cond_futex, %ebx
  207. .Lsub_cond_futex:
  208. movl %eax, %esi
  209. 41: movl (%esp), %eax
  210. call __pthread_disable_asynccancel
  211. .LcleanupEND:
  212. /* Lock. */
  213. movl $1, %edx
  214. xorl %eax, %eax
  215. LOCK
  216. #if cond_lock == 0
  217. cmpxchgl %edx, (%ebx)
  218. #else
  219. cmpxchgl %edx, cond_lock(%ebx)
  220. #endif
  221. jnz 5f
  222. 6: movl broadcast_seq(%ebx), %eax
  223. cmpl 20(%esp), %eax
  224. jne 23f
  225. movl woken_seq(%ebx), %eax
  226. movl woken_seq+4(%ebx), %ecx
  227. movl wakeup_seq(%ebx), %edi
  228. movl wakeup_seq+4(%ebx), %edx
  229. cmpl 16(%esp), %edx
  230. jne 7f
  231. cmpl 12(%esp), %edi
  232. je 15f
  233. 7: cmpl %ecx, %edx
  234. jne 9f
  235. cmp %eax, %edi
  236. jne 9f
  237. 15: cmpl $-ETIMEDOUT, %esi
  238. jne 8b
  239. addl $1, wakeup_seq(%ebx)
  240. adcl $0, wakeup_seq+4(%ebx)
  241. addl $1, cond_futex(%ebx)
  242. movl $ETIMEDOUT, %esi
  243. jmp 14f
  244. 23: xorl %esi, %esi
  245. jmp 24f
  246. 9: xorl %esi, %esi
  247. 14: addl $1, woken_seq(%ebx)
  248. adcl $0, woken_seq+4(%ebx)
  249. 24: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
  250. /* Wake up a thread which wants to destroy the condvar object. */
  251. movl total_seq(%ebx), %eax
  252. andl total_seq+4(%ebx), %eax
  253. cmpl $0xffffffff, %eax
  254. jne 25f
  255. movl cond_nwaiters(%ebx), %eax
  256. andl $~((1 << nwaiters_shift) - 1), %eax
  257. jne 25f
  258. addl $cond_nwaiters, %ebx
  259. movl $SYS_futex, %eax
  260. #if FUTEX_PRIVATE_FLAG > 255
  261. xorl %ecx, %ecx
  262. #endif
  263. cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
  264. sete %cl
  265. subl $1, %ecx
  266. #ifdef __ASSUME_PRIVATE_FUTEX
  267. andl $FUTEX_PRIVATE_FLAG, %ecx
  268. #else
  269. andl %gs:PRIVATE_FUTEX, %ecx
  270. #endif
  271. addl $FUTEX_WAKE, %ecx
  272. movl $1, %edx
  273. ENTER_KERNEL
  274. subl $cond_nwaiters, %ebx
  275. 25: LOCK
  276. #if cond_lock == 0
  277. subl $1, (%ebx)
  278. #else
  279. subl $1, cond_lock(%ebx)
  280. #endif
  281. jne 10f
  282. 11: movl 24+FRAME_SIZE(%esp), %eax
  283. /* With requeue_pi, the mutex lock is held in the kernel. */
  284. movl 24(%esp), %ecx
  285. testl %ecx, %ecx
  286. jnz 27f
  287. call __pthread_mutex_cond_lock
  288. 26: addl $FRAME_SIZE, %esp
  289. cfi_adjust_cfa_offset(-FRAME_SIZE);
  290. /* We return the result of the mutex_lock operation if it failed. */
  291. testl %eax, %eax
  292. #ifdef HAVE_CMOV
  293. cmovel %esi, %eax
  294. #else
  295. jne 22f
  296. movl %esi, %eax
  297. 22:
  298. #endif
  299. 18: popl %ebx
  300. cfi_adjust_cfa_offset(-4)
  301. cfi_restore(%ebx)
  302. popl %esi
  303. cfi_adjust_cfa_offset(-4)
  304. cfi_restore(%esi)
  305. popl %edi
  306. cfi_adjust_cfa_offset(-4)
  307. cfi_restore(%edi)
  308. popl %ebp
  309. cfi_adjust_cfa_offset(-4)
  310. cfi_restore(%ebp)
  311. ret
  312. cfi_restore_state
  313. 27: call __pthread_mutex_cond_lock_adjust
  314. xorl %eax, %eax
  315. jmp 26b
  316. cfi_adjust_cfa_offset(-FRAME_SIZE);
  317. /* Initial locking failed. */
  318. 1:
  319. #if cond_lock == 0
  320. movl %ebx, %edx
  321. #else
  322. leal cond_lock(%ebx), %edx
  323. #endif
  324. #if (LLL_SHARED-LLL_PRIVATE) > 255
  325. xorl %ecx, %ecx
  326. #endif
  327. cmpl $-1, dep_mutex(%ebx)
  328. setne %cl
  329. subl $1, %ecx
  330. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  331. #if LLL_PRIVATE != 0
  332. addl $LLL_PRIVATE, %ecx
  333. #endif
  334. call __lll_lock_wait
  335. jmp 2b
  336. /* The initial unlocking of the mutex failed. */
  337. 16:
  338. LOCK
  339. #if cond_lock == 0
  340. subl $1, (%ebx)
  341. #else
  342. subl $1, cond_lock(%ebx)
  343. #endif
  344. jne 18b
  345. movl %eax, %esi
  346. #if cond_lock == 0
  347. movl %ebx, %eax
  348. #else
  349. leal cond_lock(%ebx), %eax
  350. #endif
  351. #if (LLL_SHARED-LLL_PRIVATE) > 255
  352. xorl %ecx, %ecx
  353. #endif
  354. cmpl $-1, dep_mutex(%ebx)
  355. setne %cl
  356. subl $1, %ecx
  357. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  358. #if LLL_PRIVATE != 0
  359. addl $LLL_PRIVATE, %ecx
  360. #endif
  361. call __lll_unlock_wake
  362. movl %esi, %eax
  363. jmp 18b
  364. cfi_adjust_cfa_offset(FRAME_SIZE)
  365. /* Unlock in loop requires wakeup. */
  366. 3:
  367. #if cond_lock == 0
  368. movl %ebx, %eax
  369. #else
  370. leal cond_lock(%ebx), %eax
  371. #endif
  372. #if (LLL_SHARED-LLL_PRIVATE) > 255
  373. xorl %ecx, %ecx
  374. #endif
  375. cmpl $-1, dep_mutex(%ebx)
  376. setne %cl
  377. subl $1, %ecx
  378. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  379. #if LLL_PRIVATE != 0
  380. addl $LLL_PRIVATE, %ecx
  381. #endif
  382. call __lll_unlock_wake
  383. jmp 4b
  384. /* Locking in loop failed. */
  385. 5:
  386. #if cond_lock == 0
  387. movl %ebx, %edx
  388. #else
  389. leal cond_lock(%ebx), %edx
  390. #endif
  391. #if (LLL_SHARED-LLL_PRIVATE) > 255
  392. xorl %ecx, %ecx
  393. #endif
  394. cmpl $-1, dep_mutex(%ebx)
  395. setne %cl
  396. subl $1, %ecx
  397. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  398. #if LLL_PRIVATE != 0
  399. addl $LLL_PRIVATE, %ecx
  400. #endif
  401. call __lll_lock_wait
  402. jmp 6b
  403. /* Unlock after loop requires wakeup. */
  404. 10:
  405. #if cond_lock == 0
  406. movl %ebx, %eax
  407. #else
  408. leal cond_lock(%ebx), %eax
  409. #endif
  410. #if (LLL_SHARED-LLL_PRIVATE) > 255
  411. xorl %ecx, %ecx
  412. #endif
  413. cmpl $-1, dep_mutex(%ebx)
  414. setne %cl
  415. subl $1, %ecx
  416. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  417. #if LLL_PRIVATE != 0
  418. addl $LLL_PRIVATE, %ecx
  419. #endif
  420. call __lll_unlock_wake
  421. jmp 11b
  422. #if defined __NR_clock_gettime && !defined __ASSUME_POSIX_TIMERS
  423. /* clock_gettime not available. */
  424. 19: leal 4(%esp), %ebx
  425. xorl %ecx, %ecx
  426. movl $__NR_gettimeofday, %eax
  427. ENTER_KERNEL
  428. movl %edx, %ebx
  429. /* Compute relative timeout. */
  430. movl 8(%esp), %eax
  431. movl $1000, %edx
  432. mul %edx /* Milli seconds to nano seconds. */
  433. movl (%ebp), %ecx
  434. movl 4(%ebp), %edx
  435. subl 4(%esp), %ecx
  436. subl %eax, %edx
  437. jns 20f
  438. addl $1000000000, %edx
  439. subl $1, %ecx
  440. 20: testl %ecx, %ecx
  441. movl $-ETIMEDOUT, %esi
  442. js 6b
  443. jmp 21b
  444. #endif
  445. .size __pthread_cond_timedwait, .-__pthread_cond_timedwait
  446. weak_alias(__pthread_cond_timedwait, pthread_cond_timedwait)
  447. .type __condvar_tw_cleanup2, @function
  448. __condvar_tw_cleanup2:
  449. subl $cond_futex, %ebx
  450. .size __condvar_tw_cleanup2, .-__condvar_tw_cleanup2
  451. .type __condvar_tw_cleanup, @function
  452. __condvar_tw_cleanup:
  453. movl %eax, %esi
  454. /* Get internal lock. */
  455. movl $1, %edx
  456. xorl %eax, %eax
  457. LOCK
  458. #if cond_lock == 0
  459. cmpxchgl %edx, (%ebx)
  460. #else
  461. cmpxchgl %edx, cond_lock(%ebx)
  462. #endif
  463. jz 1f
  464. #if cond_lock == 0
  465. movl %ebx, %edx
  466. #else
  467. leal cond_lock(%ebx), %edx
  468. #endif
  469. #if (LLL_SHARED-LLL_PRIVATE) > 255
  470. xorl %ecx, %ecx
  471. #endif
  472. cmpl $-1, dep_mutex(%ebx)
  473. setne %cl
  474. subl $1, %ecx
  475. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  476. #if LLL_PRIVATE != 0
  477. addl $LLL_PRIVATE, %ecx
  478. #endif
  479. call __lll_lock_wait
  480. 1: movl broadcast_seq(%ebx), %eax
  481. cmpl 20(%esp), %eax
  482. jne 3f
  483. /* We increment the wakeup_seq counter only if it is lower than
  484. total_seq. If this is not the case the thread was woken and
  485. then canceled. In this case we ignore the signal. */
  486. movl total_seq(%ebx), %eax
  487. movl total_seq+4(%ebx), %edi
  488. cmpl wakeup_seq+4(%ebx), %edi
  489. jb 6f
  490. ja 7f
  491. cmpl wakeup_seq(%ebx), %eax
  492. jbe 7f
  493. 6: addl $1, wakeup_seq(%ebx)
  494. adcl $0, wakeup_seq+4(%ebx)
  495. addl $1, cond_futex(%ebx)
  496. 7: addl $1, woken_seq(%ebx)
  497. adcl $0, woken_seq+4(%ebx)
  498. 3: subl $(1 << nwaiters_shift), cond_nwaiters(%ebx)
  499. /* Wake up a thread which wants to destroy the condvar object. */
  500. xorl %edi, %edi
  501. movl total_seq(%ebx), %eax
  502. andl total_seq+4(%ebx), %eax
  503. cmpl $0xffffffff, %eax
  504. jne 4f
  505. movl cond_nwaiters(%ebx), %eax
  506. andl $~((1 << nwaiters_shift) - 1), %eax
  507. jne 4f
  508. addl $cond_nwaiters, %ebx
  509. movl $SYS_futex, %eax
  510. #if FUTEX_PRIVATE_FLAG > 255
  511. xorl %ecx, %ecx
  512. #endif
  513. cmpl $-1, dep_mutex-cond_nwaiters(%ebx)
  514. sete %cl
  515. subl $1, %ecx
  516. #ifdef __ASSUME_PRIVATE_FUTEX
  517. andl $FUTEX_PRIVATE_FLAG, %ecx
  518. #else
  519. andl %gs:PRIVATE_FUTEX, %ecx
  520. #endif
  521. addl $FUTEX_WAKE, %ecx
  522. movl $1, %edx
  523. ENTER_KERNEL
  524. subl $cond_nwaiters, %ebx
  525. movl $1, %edi
  526. 4: LOCK
  527. #if cond_lock == 0
  528. subl $1, (%ebx)
  529. #else
  530. subl $1, cond_lock(%ebx)
  531. #endif
  532. je 2f
  533. #if cond_lock == 0
  534. movl %ebx, %eax
  535. #else
  536. leal cond_lock(%ebx), %eax
  537. #endif
  538. #if (LLL_SHARED-LLL_PRIVATE) > 255
  539. xorl %ecx, %ecx
  540. #endif
  541. cmpl $-1, dep_mutex(%ebx)
  542. setne %cl
  543. subl $1, %ecx
  544. andl $(LLL_SHARED-LLL_PRIVATE), %ecx
  545. #if LLL_PRIVATE != 0
  546. addl $LLL_PRIVATE, %ecx
  547. #endif
  548. call __lll_unlock_wake
  549. /* Wake up all waiters to make sure no signal gets lost. */
  550. 2: testl %edi, %edi
  551. jnz 5f
  552. addl $cond_futex, %ebx
  553. #if FUTEX_PRIVATE_FLAG > 255
  554. xorl %ecx, %ecx
  555. #endif
  556. cmpl $-1, dep_mutex-cond_futex(%ebx)
  557. sete %cl
  558. subl $1, %ecx
  559. #ifdef __ASSUME_PRIVATE_FUTEX
  560. andl $FUTEX_PRIVATE_FLAG, %ecx
  561. #else
  562. andl %gs:PRIVATE_FUTEX, %ecx
  563. #endif
  564. addl $FUTEX_WAKE, %ecx
  565. movl $SYS_futex, %eax
  566. movl $0x7fffffff, %edx
  567. ENTER_KERNEL
  568. 5: movl 24+FRAME_SIZE(%esp), %eax
  569. call __pthread_mutex_cond_lock
  570. movl %esi, (%esp)
  571. .LcallUR:
  572. call _Unwind_Resume
  573. hlt
  574. .LENDCODE:
  575. cfi_endproc
  576. .size __condvar_tw_cleanup, .-__condvar_tw_cleanup
  577. .section .gcc_except_table,"a",@progbits
  578. .LexceptSTART:
  579. .byte DW_EH_PE_omit # @LPStart format (omit)
  580. .byte DW_EH_PE_omit # @TType format (omit)
  581. .byte DW_EH_PE_sdata4 # call-site format
  582. # DW_EH_PE_sdata4
  583. .uleb128 .Lcstend-.Lcstbegin
  584. .Lcstbegin:
  585. .long .LcleanupSTART-.LSTARTCODE
  586. .long .Ladd_cond_futex-.LcleanupSTART
  587. .long __condvar_tw_cleanup-.LSTARTCODE
  588. .uleb128 0
  589. .long .Ladd_cond_futex-.LSTARTCODE
  590. .long .Lsub_cond_futex-.Ladd_cond_futex
  591. .long __condvar_tw_cleanup2-.LSTARTCODE
  592. .uleb128 0
  593. .long .Lsub_cond_futex-.LSTARTCODE
  594. .long .LcleanupEND-.Lsub_cond_futex
  595. .long __condvar_tw_cleanup-.LSTARTCODE
  596. .uleb128 0
  597. .long .LcallUR-.LSTARTCODE
  598. .long .LENDCODE-.LcallUR
  599. .long 0
  600. .uleb128 0
  601. .Lcstend:
  602. #ifdef SHARED
  603. .hidden DW.ref.__gcc_personality_v0
  604. .weak DW.ref.__gcc_personality_v0
  605. .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
  606. .align 4
  607. .type DW.ref.__gcc_personality_v0, @object
  608. .size DW.ref.__gcc_personality_v0, 4
  609. DW.ref.__gcc_personality_v0:
  610. .long __gcc_personality_v0
  611. #endif