Deleted Added
sdiff udiff text old ( 168675 ) new ( 170431 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

--- 17 unchanged lines hidden (view full) ---

26
27 .ident "%Z%%M% %I% %E% SMI"
28
29 .file "%M%"
30
31#define _ASM
32#include <sys/asm_linkage.h>
33
34 ENTRY(atomic_add_64_nv)
35 movq (%rdi), %rax
361:
37 movq %rsi, %rcx
38 addq %rax, %rcx
39 lock
40 cmpxchgq %rcx, (%rdi)
41 jne 1b
42 movq %rcx, %rax
43 ret
44 SET_SIZE(atomic_add_64_nv)
45
46 ENTRY(atomic_or_8_nv)
47 movb (%rdi), %al // %al = old value
481:
49 movb %sil, %cl
50 orb %al, %cl // %cl = new value
51 lock
52 cmpxchgb %cl, (%rdi) // try to stick it in
53 jne 1b
54 movzbl %cl, %eax // return new value
55 ret
56 SET_SIZE(atomic_or_8_nv)
57
58 ENTRY(atomic_cas_64)
59 movq %rsi, %rax
60 lock
61 cmpxchgq %rdx, (%rdi)
62 ret
63 SET_SIZE(atomic_cas_64)
64
65 ENTRY(membar_producer)
66 sfence
67 ret
68 SET_SIZE(membar_producer)