pthread_cond_timedwait.S 15 KB

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