61 |
|
__asm__ __volatile__("lock\n\tandl %1,%0" : "=m" (regs.spcflags) : "i" (~(m))); \ |
62 |
|
} while (0) |
63 |
|
|
64 |
< |
#elif defined(HAVE_PTHREADS) |
64 |
> |
#else |
65 |
|
|
66 |
|
#undef HAVE_HARDWARE_LOCKS |
67 |
|
|
68 |
< |
#include <pthread.h> |
69 |
< |
extern pthread_mutex_t spcflags_lock; |
68 |
> |
#include "main.h" |
69 |
> |
extern B2_mutex *spcflags_lock; |
70 |
|
|
71 |
|
#define SPCFLAGS_SET(m) do { \ |
72 |
< |
pthread_mutex_lock(&spcflags_lock); \ |
72 |
> |
B2_lock_mutex(spcflags_lock); \ |
73 |
|
regs.spcflags |= (m); \ |
74 |
< |
pthread_mutex_unlock(&spcflags_lock); \ |
74 |
> |
B2_unlock_mutex(spcflags_lock); \ |
75 |
|
} while (0) |
76 |
|
|
77 |
|
#define SPCFLAGS_CLEAR(m) do { \ |
78 |
< |
pthread_mutex_lock(&spcflags_lock); \ |
78 |
> |
B2_lock_mutex(spcflags_lock); \ |
79 |
|
regs.spcflags &= ~(m); \ |
80 |
< |
pthread_mutex_unlock(&spcflags_lock); \ |
80 |
> |
B2_unlock_mutex(spcflags_lock); \ |
81 |
|
} while (0) |
82 |
|
|
83 |
– |
#else |
84 |
– |
|
85 |
– |
#error "Can't handle spcflags atomically!" |
86 |
– |
|
83 |
|
#endif |
84 |
|
|
85 |
|
#endif /* SPCFLAGS_H */ |