1 // AUTO-GENERATED by autogen.sh; DO NOT EDIT
5 #if __SIZEOF_POINTER__ == 8
10 #define PTR_MASK ((1ull<<PTR_BITS)-1)
11 #define CNT_MASK (0ull-1)
12 #if __SIZEOF_POINTER__ == 8 && (defined(__sparc__) || (defined(__sun__) && defined(__amd64__)))
18 #define PTR_MASK ((0ull-1)<<3)
21 #line 33 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
23 runtime_lfstackpush ( uint64
*head
, LFNode
*node
)
26 #line 38 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
27 if ( ( uintptr
) node
!= ( ( uintptr
) node
&PTR_MASK
) ) {
28 runtime_printf ( "p=%p\n" , node
) ;
29 runtime_throw ( "runtime_lfstackpush: invalid pointer" ) ;
31 #line 43 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
33 new = ( uint64
) ( uintptr
) node
| ( ( ( uint64
) node
->pushcnt
&CNT_MASK
) <<PTR_BITS
) ;
35 old
= runtime_atomicload64 ( head
) ;
36 node
->next
= ( LFNode
* ) ( uintptr
) ( old
&PTR_MASK
) ;
37 if ( runtime_cas64 ( head
, old
, new ) )
41 #line 53 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
43 runtime_lfstackpop ( uint64
*head
)
45 LFNode
*node
, *node2
;
47 #line 59 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
49 old
= runtime_atomicload64 ( head
) ;
52 node
= ( LFNode
* ) ( uintptr
) ( old
&PTR_MASK
) ;
53 node2
= runtime_atomicloadp ( &node
->next
) ;
56 new = ( uint64
) ( uintptr
) node2
| ( ( ( uint64
) node2
->pushcnt
&CNT_MASK
) <<PTR_BITS
) ;
57 if ( runtime_cas64 ( head
, old
, new ) )
61 void runtime_lfstackpush_go(uint64
* head
, LFNode
* node
) __asm__ (GOSYM_PREFIX
"runtime.lfstackpush_go");
62 void runtime_lfstackpush_go(uint64
* head
, LFNode
* node
)
64 #line 73 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
66 runtime_lfstackpush(head
, node
);
68 LFNode
* runtime_lfstackpop_go(uint64
* head
) __asm__ (GOSYM_PREFIX
"runtime.lfstackpop_go");
69 LFNode
* runtime_lfstackpop_go(uint64
* head
)
72 #line 77 "../../../trunk/libgo/runtime/../../../trunk/libgo/runtime/lfstack.goc"
74 node
= runtime_lfstackpop(head
);