Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 .section ".text",#alloc,#execinstr
2 .align 8
3 .skip 16
6 /*
7 ** int _STLP_atomic_exchange (void *pvalue, int value)
8 */
10 .type _STLP_atomic_exchange,#function
11 .global _STLP_atomic_exchange
12 .align 8
14 _STLP_atomic_exchange:
15 0:
16 ld [%o0], %o2 ! Set the current value
17 mov %o1, %o3 ! Set the new value
18 ! swap [%o0], %o3 ! Do the compare and swap
19 cas [%o0], %o2, %o3
20 cmp %o2, %o3 ! Check whether successful
21 bne 0b ! Retry upon failure
22 stbar
23 mov %o2, %o0 ! Set the new value
24 retl ! return
25 nop
26 .size _STLP_atomic_exchange,(.-_STLP_atomic_exchange)
28 /* int _STLP_atomic_increment (void *pvalue) */
30 .type _STLP_atomic_increment,#function
31 .global _STLP_atomic_increment
32 .align 8
33 _STLP_atomic_increment:
34 1:
35 ld [%o0], %o2 ! set the current
36 add %o2, 0x1, %o3 ! Increment and store current
37 ! swap [%o0], %o3 ! Do the compare and swap
38 cas [%o0], %o2, %o3
39 cmp %o3, %o2 ! Check whether successful
40 bne 1b ! Retry if we failed.
41 membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
42 ! returning
43 nop
44 retl ! return
45 nop
47 .size _STLP_atomic_increment,(.-_STLP_atomic_increment)
50 /* int _STLP_atomic_decrement (void *pvalue) */
51 .type _STLP_atomic_decrement,#function
52 .global _STLP_atomic_decrement
53 .align 8
55 _STLP_atomic_decrement:
56 2:
57 ld [%o0], %o2 ! set the current
58 sub %o2, 0x1, %o3 ! decrement and store current
59 ! swap [%o0], %o3 ! Do the compare and swap
60 cas [%o0], %o2, %o3
61 cmp %o3, %o2 ! Check whether successful
62 bne 2b ! Retry if we failed.
63 membar #LoadLoad | #LoadStore ! Ensure the cas finishes before
64 nop
65 ! returning
66 retl ! return
67 nop
68 .size _STLP_atomic_decrement,(.-_STLP_atomic_decrement)