__cpu_simple_unlock: use __insn_barrier() instead of a "memory" clobber.

This commit is contained in:
pk 2003-11-16 11:22:30 +00:00
parent fdd5b03782
commit 95ad31d40c
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.12 2003/11/09 21:04:44 pk Exp $ */
/* $NetBSD: lock.h,v 1.13 2003/11/16 11:22:30 pk Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -109,10 +109,11 @@ __cpu_simple_unlock(__cpu_simple_lock_t *alp)
{
/*
* Do `*alp = __SIMPLELOCK_UNLOCKED;' with a compiler barrier
* to prevent instruction re-ordering around the lock release.
* Insert compiler barrier to prevent instruction re-ordering
* around the lock release.
*/
__asm __volatile("st %%g0,[%0]" : : "r" (alp) : "memory");
__insn_barrier();
*alp = __SIMPLELOCK_UNLOCKED;
}
#endif /* _MACHINE_LOCK_H */