1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-14 02:32:32 +03:00
* db2/db_int.h: Change tsl_t type to u_int32_t.
	* db2/mutex/mutex.c: Allow Alpha mutex definitions.
	* db2/mutex/alpha.h: New file.
	* db2/mutex/sparc.gcc: Fix store code for v9.  Simplify clear code.
	* sysdeps/alpha/Makefile [db2]: Set CFLAGS of mutex.c to make spinlocks
	known.
	Patches by Richard Henderson.
This commit is contained in:
Ulrich Drepper
1999-08-30 21:51:29 +00:00
parent 0742e50134
commit 9a93ac006d
7 changed files with 51 additions and 11 deletions

View File

@@ -13,21 +13,19 @@
* For gcc/sparc, 0 is clear, 1 is set.
*/
#if defined(__sparcv9__)
Does the following code need membar instructions for V9 processors?
#endif
/* The stbar is needed for v8, and is implemented as membar #sync on v9,
so is functional there as well. For v7, stbar may generate an illegal
instruction and we have no way to tell what we're running on. Some
operating systems notice and skip this instruction in the fault handler. */
#define TSL_SET(tsl) ({ \
register tsl_t *__l = (tsl); \
register tsl_t __r; \
__asm__ volatile \
("ldstub [%1],%0" \
("ldstub [%1],%0; stbar" \
: "=r"( __r) : "r" (__l)); \
!__r; \
})
#define TSL_UNSET(tsl) ({ \
register tsl_t *__l = (tsl); \
__asm__ volatile ("stb %%g0,[%0]" : : "r" (__l)); \
})
#define TSL_UNSET(tsl) ((tsl) = 0)
#define TSL_INIT(tsl) TSL_UNSET(tsl)