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)
35 ALTENTRY(atomic_add_64_nv)
36 pushl %edi
37 pushl %ebx
38 movl 12(%esp), %edi // %edi = target address
39 movl (%edi), %eax
40 movl 4(%edi), %edx // %edx:%eax = old value
411:

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

50 movl %ecx, %edx // return new value
51 popl %ebx
52 popl %edi
53 ret
54 SET_SIZE(atomic_add_64_nv)
55 SET_SIZE(atomic_add_64)
56
57 ENTRY(atomic_or_8_nv)
58 movl 4(%esp), %edx // %edx = target address
59 movb (%edx), %al // %al = old value
601:
61 movl 8(%esp), %ecx // %ecx = delta
62 orb %al, %cl // %cl = new value
63 lock
64 cmpxchgb %cl, (%edx) // try to stick it in
65 jne 1b
66 movzbl %cl, %eax // return new value
67 ret
68 SET_SIZE(atomic_or_8_nv)
69
70 ENTRY(atomic_cas_ptr)
71 movl 4(%esp), %edx
72 movl 8(%esp), %eax
73 movl 12(%esp), %ecx
74 lock
75 cmpxchgl %ecx, (%edx)
76 ret
77 SET_SIZE(atomic_cas_ptr)
78
79 ENTRY(atomic_cas_64)
80 pushl %ebx
81 pushl %esi
82 movl 12(%esp), %esi
83 movl 16(%esp), %eax
84 movl 20(%esp), %edx
85 movl 24(%esp), %ebx
86 movl 28(%esp), %ecx
87 lock
88 cmpxchg8b (%esi)
89 popl %esi
90 popl %ebx
91 ret
92 SET_SIZE(atomic_cas_64)
93
94 ENTRY(membar_producer)
95 lock
96 xorl $0, (%esp)
97 ret
98 SET_SIZE(membar_producer)