mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Define dtrace_cmpset_long in terms of atomic_cmpset_long
and not by virtue of inline assembly. Now this file compiles on all supported architectures.
This commit is contained in:
parent
e74eb12c68
commit
ad4e66a63c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226452
@ -31,49 +31,9 @@
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#if defined(__amd64__)
|
||||
static __inline int
|
||||
dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
|
||||
{
|
||||
u_char res;
|
||||
#include <machine/atomic.h>
|
||||
|
||||
__asm __volatile(
|
||||
" lock ; "
|
||||
" cmpxchgq %2,%1 ; "
|
||||
" sete %0 ; "
|
||||
"1: "
|
||||
"# dtrace_cmpset_long"
|
||||
: "=a" (res), /* 0 */
|
||||
"=m" (*dst) /* 1 */
|
||||
: "r" (src), /* 2 */
|
||||
"a" (exp), /* 3 */
|
||||
"m" (*dst) /* 4 */
|
||||
: "memory");
|
||||
|
||||
return (res);
|
||||
}
|
||||
#elif defined(__i386__)
|
||||
static __inline int
|
||||
dtrace_cmpset_long(volatile u_long *dst, u_long exp, u_long src)
|
||||
{
|
||||
u_char res;
|
||||
|
||||
__asm __volatile(
|
||||
" lock ; "
|
||||
" cmpxchgl %2,%1 ; "
|
||||
" sete %0 ; "
|
||||
"1: "
|
||||
"# dtrace_cmpset_long"
|
||||
: "=a" (res), /* 0 */
|
||||
"=m" (*dst) /* 1 */
|
||||
: "r" (src), /* 2 */
|
||||
"a" (exp), /* 3 */
|
||||
"m" (*dst) /* 4 */
|
||||
: "memory");
|
||||
|
||||
return (res);
|
||||
}
|
||||
#endif
|
||||
#define dtrace_cmpset_long atomic_cmpset_long
|
||||
|
||||
#define DTRACE_DEBUG_BUFR_SIZE (32 * 1024)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user