pthread_cond_timedwait.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. /* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #include <sysdep.h>
  15. #include <lowlevellock.h>
  16. #include <lowlevelcond.h>
  17. #include <pthread-errnos.h>
  18. #include <bits/kernel-features.h>
  19. #include <tcb-offsets.h>
  20. #include "lowlevel-atomic.h"
  21. .text
  22. /* int pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex,
  23. const struct timespec *abstime) */
  24. .globl __pthread_cond_timedwait
  25. .type __pthread_cond_timedwait, @function
  26. .protected __pthread_cond_timedwait
  27. .align 5
  28. __pthread_cond_timedwait:
  29. .LSTARTCODE:
  30. mov.l r8, @-r15
  31. .Lpush_r8:
  32. mov.l r9, @-r15
  33. .Lpush_r9:
  34. mov.l r10, @-r15
  35. .Lpush_r10:
  36. mov.l r11, @-r15
  37. .Lpush_r11:
  38. mov.l r12, @-r15
  39. .Lpush_r12:
  40. mov.l r13, @-r15
  41. .Lpush_r13:
  42. sts.l pr, @-r15
  43. .Lpush_pr:
  44. add #-64, r15
  45. .Lalloc:
  46. mov r4, r8
  47. mov r5, r9
  48. mov r6, r13
  49. #ifdef __PIC__
  50. mova .Lgot0, r0
  51. mov.l .Lgot0, r12
  52. add r0, r12
  53. #endif
  54. mov.l @(4,r13), r0
  55. mov.l .L1g, r1
  56. cmp/hs r1, r0
  57. bf 0f
  58. bra 18f
  59. mov #EINVAL, r0
  60. 0:
  61. /* Get internal lock. */
  62. mov #0, r3
  63. mov #1, r4
  64. #if cond_lock != 0
  65. CMPXCHG (r3, @(cond_lock,r8), r4, r2)
  66. #else
  67. CMPXCHG (r3, @r8, r4, r2)
  68. #endif
  69. bt 2f
  70. bra 1f
  71. nop
  72. #ifdef __PIC__
  73. .align 2
  74. .Lgot0:
  75. .long _GLOBAL_OFFSET_TABLE_
  76. #endif
  77. 2:
  78. /* Store the reference to the mutex. If there is already a
  79. different value in there this is a bad user bug. */
  80. mov.l @(dep_mutex,r8),r0
  81. cmp/eq #-1, r0
  82. bt 17f
  83. mov.l r9, @(dep_mutex,r8)
  84. 17:
  85. /* Unlock the mutex. */
  86. mov.l .Lmunlock1, r1
  87. mov #0, r5
  88. bsrf r1
  89. mov r9, r4
  90. .Lmunlock1b:
  91. tst r0, r0
  92. bt 0f
  93. bra 16f
  94. nop
  95. 0:
  96. mov #1, r2
  97. mov #0, r3
  98. clrt
  99. mov.l @(total_seq,r8),r0
  100. mov.l @(total_seq+4,r8),r1
  101. addc r2, r0
  102. addc r3, r1
  103. mov.l r0,@(total_seq,r8)
  104. mov.l r1,@(total_seq+4,r8)
  105. mov.l @(cond_futex,r8), r0
  106. add r2, r0
  107. mov.l r0, @(cond_futex,r8)
  108. mov #(1 << nwaiters_shift), r2
  109. mov.l @(cond_nwaiters,r8), r0
  110. add r2, r0
  111. mov.l r0, @(cond_nwaiters,r8)
  112. /* Get and store current wakeup_seq value. */
  113. mov.l @(wakeup_seq,r8), r10
  114. mov.l @(wakeup_seq+4,r8), r11
  115. mov.l @(broadcast_seq,r8), r0
  116. mov.l r0, @(4,r15)
  117. 8:
  118. /* Get current time. */
  119. #ifdef __NR_clock_gettime
  120. /* Get the clock number. */
  121. mov.l @(cond_nwaiters,r8), r4
  122. mov #((1 << nwaiters_shift) - 1), r0
  123. and r0, r4
  124. /* Only clocks 0 and 1 are allowed. Both are handled in the
  125. kernel. */
  126. mov r15, r5
  127. add #16, r5
  128. mov.w .L__NR_clock_gettime, r3
  129. trapa #0x12
  130. SYSCALL_INST_PAD
  131. # ifndef __ASSUME_POSIX_TIMERS
  132. cmp/eq #-ENOSYS, r0
  133. bt 19f
  134. # endif
  135. /* Compute relative timeout. */
  136. mov.l @r13, r2
  137. mov.l @(4,r13), r3
  138. mov.l @(16,r15), r0
  139. bra 0f
  140. mov.l @(20,r15), r1
  141. .L__NR_clock_gettime:
  142. .word __NR_clock_gettime
  143. # ifndef __ASSUME_POSIX_TIMERS
  144. 19:
  145. mov r15, r4
  146. add #16, r4
  147. mov #0, r5
  148. mov #__NR_gettimeofday, r3
  149. trapa #0x12
  150. SYSCALL_INST_PAD
  151. /* Compute relative timeout. */
  152. mov.l @(20,r15), r0
  153. mov.w .L1k, r1
  154. dmulu.l r0, r1 /* Micro seconds to nano seconds. */
  155. mov.l @r13, r2
  156. mov.l @(4,r13), r3
  157. mov.l @(16,r15), r0
  158. sts macl, r1
  159. #endif
  160. 0:
  161. #else
  162. mov r15, r4
  163. add #16, r4
  164. mov #0, r5
  165. mov #__NR_gettimeofday, r3
  166. trapa #0x12
  167. SYSCALL_INST_PAD
  168. /* Compute relative timeout. */
  169. mov.l @(20,r15), r0
  170. mov.w .L1k, r1
  171. dmulu.l r0, r1 /* Micro seconds to nano seconds. */
  172. mov.l @r13, r2
  173. mov.l @(4,r13), r3
  174. mov.l @(16,r15), r0
  175. sts macl, r1
  176. #endif
  177. sub r0, r2
  178. clrt
  179. subc r1, r3
  180. bf 12f
  181. mov.l .L1g, r1
  182. add r1, r3
  183. add #-1, r2
  184. 12:
  185. mov #-ETIMEDOUT, r1
  186. mov.l r1, @(12,r15)
  187. cmp/pz r2
  188. bf 6f /* Time is already up. */
  189. /* Store relative timeout. */
  190. mov.l r2, @(16,r15)
  191. mov.l r3, @(20,r15)
  192. mov.l @(cond_futex,r8), r1
  193. mov.l r1, @(8,r15)
  194. /* Unlock. */
  195. #if cond_lock != 0
  196. DEC (@(cond_lock,r8), r2)
  197. #else
  198. DEC (@r8, r2)
  199. #endif
  200. tst r2, r2
  201. bt 4f
  202. bra 3f
  203. nop
  204. 4:
  205. .LcleanupSTART:
  206. mov.l .Lenable1, r1
  207. bsrf r1
  208. nop
  209. .Lenable1b:
  210. mov.l r0, @r15
  211. mov r15, r7
  212. add #16, r7
  213. mov.l @(dep_mutex,r8), r0
  214. cmp/eq #-1, r0
  215. bt/s 99f
  216. mov #FUTEX_WAIT, r5
  217. #ifdef __ASSUME_PRIVATE_FUTEX
  218. mov #(FUTEX_WAIT|FUTEX_PRIVATE_FLAG), r5
  219. extu.b r5, r5
  220. #else
  221. stc gbr, r1
  222. mov.w .Lpfoff, r2
  223. add r2, r1
  224. mov.l @r1, r5
  225. mov #FUTEX_WAIT, r0
  226. or r0, r5
  227. #endif
  228. 99:
  229. mov.l @(8,r15), r6
  230. mov r8, r4
  231. add #cond_futex, r4
  232. mov #SYS_futex, r3
  233. extu.b r3, r3
  234. trapa #0x14
  235. SYSCALL_INST_PAD
  236. mov.l r0, @(12,r15)
  237. mov.l .Ldisable1, r1
  238. bsrf r1
  239. mov.l @r15, r4
  240. .Ldisable1b:
  241. .LcleanupEND:
  242. /* Lock. */
  243. mov #0, r3
  244. mov #1, r4
  245. #if cond_lock != 0
  246. CMPXCHG (r3, @(cond_lock,r8), r4, r2)
  247. #else
  248. CMPXCHG (r3, @r8, r4, r2)
  249. #endif
  250. bf 5f
  251. 6:
  252. mov.l @(broadcast_seq,r8), r0
  253. mov.l @(4,r15), r1
  254. cmp/eq r0, r1
  255. bf 23f
  256. mov.l @(woken_seq,r8), r0
  257. mov.l @(woken_seq+4,r8), r1
  258. mov.l @(wakeup_seq,r8), r2
  259. mov.l @(wakeup_seq+4,r8), r3
  260. cmp/eq r3, r11
  261. bf 7f
  262. cmp/eq r2, r10
  263. bt 15f
  264. 7:
  265. cmp/eq r1, r3
  266. bf 9f
  267. cmp/eq r0, r2
  268. bf 9f
  269. 15:
  270. mov.l @(12,r15),r0
  271. cmp/eq #-ETIMEDOUT, r0
  272. bf 8b
  273. mov #1, r2
  274. mov #0, r3
  275. clrt
  276. mov.l @(wakeup_seq,r8),r0
  277. mov.l @(wakeup_seq+4,r8),r1
  278. addc r2, r0
  279. addc r3, r1
  280. mov.l r0,@(wakeup_seq,r8)
  281. mov.l r1,@(wakeup_seq+4,r8)
  282. mov.l @(cond_futex,r8),r0
  283. add r2, r0
  284. mov.l r0,@(cond_futex,r8)
  285. mov #ETIMEDOUT, r0
  286. bra 14f
  287. mov.l r0, @(24,r15)
  288. 23:
  289. mov #0, r0
  290. bra 24f
  291. mov.l r0, @(24,r15)
  292. 9:
  293. mov #0, r0
  294. mov.l r0, @(24,r15)
  295. 14:
  296. mov #1, r2
  297. mov #0, r3
  298. clrt
  299. mov.l @(woken_seq,r8),r0
  300. mov.l @(woken_seq+4,r8),r1
  301. addc r2, r0
  302. addc r3, r1
  303. mov.l r0,@(woken_seq,r8)
  304. mov.l r1,@(woken_seq+4,r8)
  305. 24:
  306. mov #(1 << nwaiters_shift), r2
  307. mov.l @(cond_nwaiters,r8),r0
  308. sub r2, r0
  309. mov.l r0,@(cond_nwaiters,r8)
  310. /* Wake up a thread which wants to destroy the condvar object. */
  311. mov.l @(total_seq,r8),r0
  312. mov.l @(total_seq+4,r8),r1
  313. and r1, r0
  314. not r0, r0
  315. cmp/eq #0, r0
  316. bf/s 25f
  317. mov #((1 << nwaiters_shift) - 1), r1
  318. not r1, r1
  319. mov.l @(cond_nwaiters,r8),r0
  320. tst r1, r0
  321. bf 25f
  322. mov r8, r4
  323. add #cond_nwaiters, r4
  324. mov.l @(dep_mutex,r8), r0
  325. cmp/eq #-1, r0
  326. bt/s 99f
  327. mov #FUTEX_WAKE, r5
  328. #ifdef __ASSUME_PRIVATE_FUTEX
  329. mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
  330. extu.b r5, r5
  331. #else
  332. stc gbr, r1
  333. mov.w .Lpfoff, r2
  334. add r2, r1
  335. mov.l @r1, r5
  336. mov #FUTEX_WAKE, r0
  337. or r0, r5
  338. #endif
  339. 99:
  340. mov #1, r6
  341. mov #0, r7
  342. mov #SYS_futex, r3
  343. extu.b r3, r3
  344. trapa #0x14
  345. SYSCALL_INST_PAD
  346. 25:
  347. #if cond_lock != 0
  348. DEC (@(cond_lock,r8), r2)
  349. #else
  350. DEC (@r8, r2)
  351. #endif
  352. tst r2, r2
  353. bf 10f
  354. 11:
  355. mov r9, r4
  356. mov.l .Lmlocki1, r1
  357. bsrf r1
  358. nop
  359. .Lmlocki1b:
  360. /* We return the result of the mutex_lock operation if it failed. */
  361. tst r0, r0
  362. bf 18f
  363. mov.l @(24,r15), r0
  364. 18:
  365. add #64, r15
  366. lds.l @r15+, pr
  367. mov.l @r15+, r13
  368. mov.l @r15+, r12
  369. mov.l @r15+, r11
  370. mov.l @r15+, r10
  371. mov.l @r15+, r9
  372. rts
  373. mov.l @r15+, r8
  374. #ifndef __ASSUME_PRIVATE_FUTEX
  375. .Lpfoff:
  376. .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
  377. #endif
  378. .L1k:
  379. .word 1000
  380. .align 2
  381. .Lmunlock1:
  382. .long __pthread_mutex_unlock_usercnt-.Lmunlock1b
  383. .Lenable1:
  384. .long __pthread_enable_asynccancel-.Lenable1b
  385. .Ldisable1:
  386. .long __pthread_disable_asynccancel-.Ldisable1b
  387. .Lmlocki1:
  388. .long __pthread_mutex_cond_lock-.Lmlocki1b
  389. .L1g:
  390. .long 1000000000
  391. 1:
  392. /* Initial locking failed. */
  393. mov r8, r5
  394. #if cond_lock != 0
  395. add #cond_lock, r5
  396. #endif
  397. mov.l @(dep_mutex,r8), r0
  398. cmp/eq #-1, r0
  399. bf/s 99f
  400. mov #LLL_PRIVATE, r6
  401. mov #LLL_SHARED, r6
  402. 99:
  403. extu.b r6, r6
  404. mov.l .Lwait2, r1
  405. bsrf r1
  406. mov r2, r4
  407. .Lwait2b:
  408. bra 2b
  409. nop
  410. 3:
  411. /* Unlock in loop requires wakeup. */
  412. mov r8, r4
  413. #if cond_lock != 0
  414. add #cond_lock, r4
  415. #endif
  416. mov.l @(dep_mutex,r8), r0
  417. cmp/eq #-1, r0
  418. bf/s 99f
  419. mov #LLL_PRIVATE, r5
  420. mov #LLL_SHARED, r5
  421. 99:
  422. mov.l .Lmwait2, r1
  423. bsrf r1
  424. extu.b r5, r5
  425. .Lmwait2b:
  426. bra 4b
  427. nop
  428. 5:
  429. /* Locking in loop failed. */
  430. mov r8, r5
  431. #if cond_lock != 0
  432. add #cond_lock, r5
  433. #endif
  434. mov.l @(dep_mutex,r8), r0
  435. cmp/eq #-1, r0
  436. bf/s 99f
  437. mov #LLL_PRIVATE, r6
  438. mov #LLL_SHARED, r6
  439. 99:
  440. extu.b r6, r6
  441. mov.l .Lwait3, r1
  442. bsrf r1
  443. mov r2, r4
  444. .Lwait3b:
  445. bra 6b
  446. nop
  447. 10:
  448. /* Unlock after loop requires wakeup. */
  449. mov r8, r4
  450. #if cond_lock != 0
  451. add #cond_lock, r4
  452. #endif
  453. mov.l @(dep_mutex,r8), r0
  454. cmp/eq #-1, r0
  455. bf/s 99f
  456. mov #LLL_PRIVATE, r5
  457. mov #LLL_SHARED, r5
  458. 99:
  459. mov.l .Lmwait3, r1
  460. bsrf r1
  461. extu.b r5, r5
  462. .Lmwait3b:
  463. bra 11b
  464. nop
  465. 16:
  466. /* The initial unlocking of the mutex failed. */
  467. mov.l r0, @(24,r15)
  468. #if cond_lock != 0
  469. DEC (@(cond_lock,r8), r2)
  470. #else
  471. DEC (@r8, r2)
  472. #endif
  473. tst r2, r2
  474. bf 17f
  475. mov r8, r4
  476. #if cond_lock != 0
  477. add #cond_lock, r4
  478. #endif
  479. mov.l @(dep_mutex,r8), r0
  480. cmp/eq #-1, r0
  481. bf/s 99f
  482. mov #LLL_PRIVATE, r5
  483. mov #LLL_SHARED, r5
  484. 99:
  485. mov.l .Lmwait4, r1
  486. bsrf r1
  487. extu.b r5, r5
  488. .Lmwait4b:
  489. 17:
  490. bra 18b
  491. mov.l @(24,r15), r0
  492. .align 2
  493. .Lwait2:
  494. .long __lll_lock_wait-.Lwait2b
  495. .Lmwait2:
  496. .long __lll_unlock_wake-.Lmwait2b
  497. .Lwait3:
  498. .long __lll_lock_wait-.Lwait3b
  499. .Lmwait3:
  500. .long __lll_unlock_wake-.Lmwait3b
  501. .Lmwait4:
  502. .long __lll_unlock_wake-.Lmwait4b
  503. .size __pthread_cond_timedwait, .-__pthread_cond_timedwait
  504. weak_alias (__pthread_cond_timedwait, pthread_cond_timedwait)
  505. .type __condvar_tw_cleanup, @function
  506. __condvar_tw_cleanup:
  507. mov r4, r11
  508. /* Get internal lock. */
  509. mov #0, r3
  510. mov #1, r4
  511. #if cond_lock != 0
  512. CMPXCHG (r3, @(cond_lock,r8), r4, r2)
  513. #else
  514. CMPXCHG (r3, @r8, r4, r2)
  515. #endif
  516. bt 1f
  517. nop
  518. mov r8, r5
  519. #if cond_lock != 0
  520. add #cond_lock, r5
  521. #endif
  522. mov.l @(dep_mutex,r8), r0
  523. cmp/eq #-1, r0
  524. bf/s 99f
  525. mov #LLL_PRIVATE, r6
  526. mov #LLL_SHARED, r6
  527. 99:
  528. extu.b r6, r6
  529. mov.l .Lwait5, r1
  530. bsrf r1
  531. mov r2, r4
  532. .Lwait5b:
  533. 1:
  534. mov.l @(broadcast_seq,r8), r0
  535. mov.l @(4,r15), r1
  536. cmp/eq r0, r1
  537. bf 3f
  538. mov #1, r2
  539. mov #0, r3
  540. /* We increment the wakeup_seq counter only if it is lower than
  541. total_seq. If this is not the case the thread was woken and
  542. then canceled. In this case we ignore the signal. */
  543. mov.l @(total_seq+4,r8), r0
  544. mov.l @(wakeup_seq+4,r8), r1
  545. cmp/hi r1, r0
  546. bt/s 6f
  547. cmp/hi r0, r1
  548. bt 7f
  549. mov.l @(total_seq,r8), r0
  550. mov.l @(wakeup_seq,r8), r1
  551. cmp/hs r0, r1
  552. bt 7f
  553. 6:
  554. clrt
  555. mov.l @(wakeup_seq,r8),r0
  556. mov.l @(wakeup_seq+4,r8),r1
  557. addc r2, r0
  558. addc r3, r1
  559. mov.l r0,@(wakeup_seq,r8)
  560. mov.l r1,@(wakeup_seq+4,r8)
  561. mov.l @(cond_futex,r8),r0
  562. add r2, r0
  563. mov.l r0,@(cond_futex,r8)
  564. 7:
  565. clrt
  566. mov.l @(woken_seq,r8),r0
  567. mov.l @(woken_seq+4,r8),r1
  568. addc r2, r0
  569. addc r3, r1
  570. mov.l r0,@(woken_seq,r8)
  571. mov.l r1,@(woken_seq+4,r8)
  572. 3:
  573. mov #(1 << nwaiters_shift), r2
  574. mov.l @(cond_nwaiters,r8),r0
  575. sub r2, r0
  576. mov.l r0,@(cond_nwaiters,r8)
  577. /* Wake up a thread which wants to destroy the condvar object. */
  578. mov #0, r10
  579. mov.l @(total_seq,r8),r0
  580. mov.l @(total_seq+4,r8),r1
  581. and r1, r0
  582. not r0, r0
  583. cmp/eq #0, r0
  584. bf/s 4f
  585. mov #((1 << nwaiters_shift) - 1), r1
  586. not r1, r1
  587. mov.l @(cond_nwaiters,r8),r0
  588. tst r1, r0
  589. bf 4f
  590. mov r8, r4
  591. add #cond_nwaiters, r4
  592. mov #FUTEX_WAKE, r5
  593. mov #1, r6
  594. mov #0, r7
  595. mov #SYS_futex, r3
  596. extu.b r3, r3
  597. trapa #0x14
  598. SYSCALL_INST_PAD
  599. mov #1, r10
  600. 4:
  601. #if cond_lock != 0
  602. DEC (@(cond_lock,r8), r2)
  603. #else
  604. DEC (@r8, r2)
  605. #endif
  606. tst r2, r2
  607. bt 2f
  608. mov r8, r4
  609. #if cond_lock != 0
  610. add #cond_lock, r4
  611. #endif
  612. mov.l @(dep_mutex,r8), r0
  613. cmp/eq #-1, r0
  614. bf/s 99f
  615. mov #LLL_PRIVATE, r5
  616. mov #LLL_SHARED, r5
  617. 99:
  618. mov.l .Lmwait5, r1
  619. bsrf r1
  620. extu.b r5, r5
  621. .Lmwait5b:
  622. 2:
  623. /* Wake up all waiters to make sure no signal gets lost. */
  624. tst r10, r10
  625. bf/s 5f
  626. mov r8, r4
  627. add #cond_futex, r4
  628. mov #FUTEX_WAKE, r5
  629. mov #-1, r6
  630. shlr r6 /* r6 = 0x7fffffff */
  631. mov #0, r7
  632. mov #SYS_futex, r3
  633. extu.b r3, r3
  634. trapa #0x14
  635. SYSCALL_INST_PAD
  636. 5:
  637. mov.l .Lmlocki5, r1
  638. bsrf r1
  639. mov r9, r4
  640. .Lmlocki5b:
  641. .LcallUR:
  642. mov.l .Lresume, r1
  643. #ifdef __PIC__
  644. add r12, r1
  645. #endif
  646. jsr @r1
  647. mov r11, r4
  648. sleep
  649. .align 2
  650. .Lwait5:
  651. .long __lll_lock_wait-.Lwait5b
  652. .Lmwait5:
  653. .long __lll_unlock_wake-.Lmwait5b
  654. .Lmlocki5:
  655. .long __pthread_mutex_cond_lock-.Lmlocki5b
  656. .Lresume:
  657. #ifdef __PIC__
  658. .long _Unwind_Resume@GOTOFF
  659. #else
  660. .long _Unwind_Resume
  661. #endif
  662. .LENDCODE:
  663. .size __condvar_tw_cleanup, .-__condvar_tw_cleanup
  664. .section .gcc_except_table,"a",@progbits
  665. .LexceptSTART:
  666. .byte 0xff ! @LPStart format (omit)
  667. .byte 0xff ! @TType format (omit)
  668. .byte 0x0b ! call-site format
  669. ! DW_EH_PE_sdata4
  670. .uleb128 .Lcstend-.Lcstbegin
  671. .Lcstbegin:
  672. .ualong .LcleanupSTART-.LSTARTCODE
  673. .ualong .LcleanupEND-.LcleanupSTART
  674. .ualong __condvar_tw_cleanup-.LSTARTCODE
  675. .uleb128 0
  676. .ualong .LcallUR-.LSTARTCODE
  677. .ualong .LENDCODE-.LcallUR
  678. .ualong 0
  679. .uleb128 0
  680. .Lcstend:
  681. .section .eh_frame,"a",@progbits
  682. .LSTARTFRAME:
  683. .ualong .LENDCIE-.LSTARTCIE ! Length of the CIE.
  684. .LSTARTCIE:
  685. .ualong 0 ! CIE ID.
  686. .byte 1 ! Version number.
  687. #ifdef SHARED
  688. .string "zPLR" ! NUL-terminated augmentation
  689. ! string.
  690. #else
  691. .string "zPL" ! NUL-terminated augmentation
  692. ! string.
  693. #endif
  694. .uleb128 1 ! Code alignment factor.
  695. .sleb128 -4 ! Data alignment factor.
  696. .byte 0x11 ! Return address register
  697. ! column.
  698. #ifdef SHARED
  699. .uleb128 7 ! Augmentation value length.
  700. .byte 0x9b ! Personality: DW_EH_PE_pcrel
  701. ! + DW_EH_PE_sdata4
  702. ! + DW_EH_PE_indirect
  703. .ualong DW.ref.__gcc_personality_v0-.
  704. .byte 0x1b ! LSDA Encoding: DW_EH_PE_pcrel
  705. ! + DW_EH_PE_sdata4.
  706. .byte 0x1b ! FDE Encoding: DW_EH_PE_pcrel
  707. ! + DW_EH_PE_sdata4.
  708. #else
  709. .uleb128 6 ! Augmentation value length.
  710. .byte 0x0 ! Personality: absolute
  711. .ualong __gcc_personality_v0
  712. .byte 0x0 ! LSDA Encoding: absolute
  713. #endif
  714. .byte 0x0c ! DW_CFA_def_cfa
  715. .uleb128 0xf
  716. .uleb128 0
  717. .align 2
  718. .LENDCIE:
  719. .ualong .LENDFDE-.LSTARTFDE ! Length of the FDE.
  720. .LSTARTFDE:
  721. .ualong .LSTARTFDE-.LSTARTFRAME ! CIE pointer.
  722. #ifdef SHARED
  723. .ualong .LSTARTCODE-. ! PC-relative start address
  724. ! of the code.
  725. #else
  726. .ualong .LSTARTCODE ! Start address of the code.
  727. #endif
  728. .ualong .LENDCODE-.LSTARTCODE ! Length of the code.
  729. .uleb128 4 ! Augmentation size
  730. #ifdef SHARED
  731. .ualong .LexceptSTART-.
  732. #else
  733. .ualong .LexceptSTART
  734. #endif
  735. .byte 0x4
  736. .ualong .Lpush_r8-.LSTARTCODE
  737. .byte 0xe
  738. .uleb128 4
  739. .byte 0x88
  740. .uleb128 1
  741. .byte 0x4
  742. .ualong .Lpush_r9-.Lpush_r8
  743. .byte 0xe
  744. .uleb128 8
  745. .byte 0x89
  746. .uleb128 2
  747. .byte 0x4
  748. .ualong .Lpush_r10-.Lpush_r9
  749. .byte 0xe
  750. .uleb128 12
  751. .byte 0x8a
  752. .uleb128 3
  753. .byte 0x4
  754. .ualong .Lpush_r11-.Lpush_r10
  755. .byte 0xe
  756. .uleb128 16
  757. .byte 0x8b
  758. .uleb128 4
  759. .byte 0x4
  760. .ualong .Lpush_r12-.Lpush_r11
  761. .byte 0xe
  762. .uleb128 20
  763. .byte 0x8c
  764. .uleb128 5
  765. .byte 0x4
  766. .ualong .Lpush_r13-.Lpush_r12
  767. .byte 0xe
  768. .uleb128 24
  769. .byte 0x8d
  770. .uleb128 6
  771. .byte 0x4
  772. .ualong .Lpush_pr-.Lpush_r13
  773. .byte 0xe
  774. .uleb128 28
  775. .byte 0x91
  776. .uleb128 7
  777. .byte 0x4
  778. .ualong .Lalloc-.Lpush_pr
  779. .byte 0xe
  780. .uleb128 92
  781. .align 2
  782. .LENDFDE:
  783. #ifdef SHARED
  784. .hidden DW.ref.__gcc_personality_v0
  785. .weak DW.ref.__gcc_personality_v0
  786. .section .gnu.linkonce.d.DW.ref.__gcc_personality_v0,"aw",@progbits
  787. .align 4
  788. .type DW.ref.__gcc_personality_v0, @object
  789. .size DW.ref.__gcc_personality_v0, 4
  790. DW.ref.__gcc_personality_v0:
  791. .long __gcc_personality_v0
  792. #endif