You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
635 B
30 lines
635 B
3 years ago
|
/*
|
||
|
* @(#)alpha.gcc 11.1 (Sleepycat) 8/30/99
|
||
|
*
|
||
|
* For gcc/alpha, 0 is clear, 1 is set.
|
||
|
*/
|
||
|
#ifdef __GNUC__
|
||
|
#define MUTEX_SET(tsl) ({ \
|
||
|
register tsl_t *__l = (tsl); \
|
||
|
int __r; \
|
||
|
asm volatile( \
|
||
|
"1: ldl_l %0,%1\n" \
|
||
|
" blbs %0,2f\n" \
|
||
|
" mov 1,%0\n" \
|
||
|
" stl_c %0,%1\n" \
|
||
|
" bne %0,1b\n" \
|
||
|
" mb\n" \
|
||
|
"2:" \
|
||
|
: "=&r"(__r), "=m"(*__l) : "m"(*__l) : "memory"); \
|
||
|
__r; \
|
||
|
})
|
||
|
#endif
|
||
|
|
||
|
#ifdef __DECC
|
||
|
#include <alpha/builtins.h>
|
||
|
#define MUTEX_SET(tsl) (__LOCK_LONG_RETRY((tsl), 1) != 0)
|
||
|
#endif
|
||
|
|
||
|
#define MUTEX_UNSET(tsl) (*(tsl) = 0)
|
||
|
#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
|