]>
sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/winbase.h
d72bb0893ce80ca6e890efb31c24aa7c8cb1f191
1 #include_next "winbase.h"
6 extern __inline__
long ilockincr (long *m
)
9 __asm__
__volatile__ ("\n\
13 ": "=a" (__res
), "=r" (m
): "1" (m
));
16 extern __inline__
long ilockdecr (long *m
)
19 __asm__
__volatile__ ("\n\
20 movl $0xffffffff,%0\n\
23 ": "=a" (__res
), "=r" (m
): "1" (m
));
26 extern __inline__
long ilockexch (long *t
, long v
)
29 __asm__
__volatile__ ("\n\
31 1: lock cmpxchgl %3,(%1)\n\
33 ": "=a" (__res
), "=c" (t
): "1" (t
), "d" (v
));
37 #undef InterlockedIncrement
38 #define InterlockedIncrement ilockincr
39 #undef InterlockedDecrement
40 #define InterlockedDecrement ilockdecr
41 #undef InterlockedExchange
42 #define InterlockedExchange ilockexch
45 extern char * volatile *__stackbase
__asm__ ("%fs:4");
47 extern __inline__ DWORD
50 DWORD n
= ilockdecr (&tls_ix
);
51 __stackbase
[tls_ix
] = NULL
;
55 extern __inline__ BOOL
56 my_tlssetvalue (DWORD ix
, void *val
)
58 __stackbase
[ix
] = (char *) val
;
62 extern __inline__
void *
63 my_tlsgetvalue (DWORD ix
)
65 return __stackbase
[ix
];
68 extern __inline__ BOOL
76 #define TlsAlloc my_tlsalloc
78 #define TlsGetValue my_tlsgetvalue
80 #define TlsSetValue my_tlssetvalue
82 #define TlsFree my_tlsfree
83 #endif /*_WINBASE2_H*/
This page took 0.038019 seconds and 4 git commands to generate.