pthread_cond_timedwait.S 14 KB

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