Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
glibc
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
363dd97
abilist
aout
argp
assert
bare
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
gmon
gnulib
grp
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
linuxthreads
linuxthreads_db
locale
localedata
login
mach
malloc
manual
math
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
alpha
arm
generic
gnu
hppa
i386
ia64
bits
atomic.h
byteswap.h
fenv.h
huge_vall.h
link.h
linkmap.h
xtitypes.h
elf
fpu
Dist
Implies
Makefile
Versions
_mcount.S
abort-instr.h
backtrace.c
bcopy.S
bzero.S
dl-dtprocnum.h
dl-fptr.h
dl-lookupcfg.h
dl-machine.h
dl-sysdep.h
dl-tls.h
dl-trampoline.S
gccframe.h
hp-timing.c
hp-timing.h
htonl.S
htons.S
ia64libgcc.S
ieee754.h
libc-tls.c
machine-gmon.h
memccpy.S
memchr.S
memcmp.S
memcpy.S
memmove.S
memset.S
memusage.h
softpipe.h
stackinfo.h
strcat.c
strchr.S
strcmp.S
strcpy.S
strlen.S
strncmp.S
strncpy.S
sysdep.h
ieee754
m68k
mach
mips
posix
powerpc
pthread
rs6000
s390
sh
sparc
unix
wordsize-32
wordsize-64
x86_64
linkmap.h
sysvipc
termios
time
timezone
wcsmbs
wctype
.cvsignore
BUGS
CANCEL-FCT-WAIVE
CANCEL-FILE-WAIVE
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
FAQ
FAQ.in
INSTALL
INTERFACE
LICENSES
MakeTAGS
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
NOTES
PROJECTS
README
README.libm
README.template
Rules
Versions.def
WUR-REPORT
abi-tags
aclocal.m4
config-name.in
config.h.in
config.make.in
configure
configure.in
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
o-iterator.mk
shlib-versions
test-skeleton.c
tls.make.c
version.h
Breadcrumbs
glibc
/
sysdeps
/
ia64
/
bits
/
atomic.h
Blame
Blame
Latest commit
History
History
119 lines (95 loc) · 4.12 KB
Breadcrumbs
glibc
/
sysdeps
/
ia64
/
bits
/
atomic.h
Top
File metadata and controls
Code
Blame
119 lines (95 loc) · 4.12 KB
Raw
/* Copyright (C) 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <stdint.h> #include <ia64intrin.h> typedef int8_t atomic8_t; typedef uint8_t uatomic8_t; typedef int_fast8_t atomic_fast8_t; typedef uint_fast8_t uatomic_fast8_t; typedef int16_t atomic16_t; typedef uint16_t uatomic16_t; typedef int_fast16_t atomic_fast16_t; typedef uint_fast16_t uatomic_fast16_t; typedef int32_t atomic32_t; typedef uint32_t uatomic32_t; typedef int_fast32_t atomic_fast32_t; typedef uint_fast32_t uatomic_fast32_t; typedef int64_t atomic64_t; typedef uint64_t uatomic64_t; typedef int_fast64_t atomic_fast64_t; typedef uint_fast64_t uatomic_fast64_t; typedef intptr_t atomicptr_t; typedef uintptr_t uatomicptr_t; typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval) \ (abort (), 0) #define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval) \ (abort (), 0) #define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval) \ (!__sync_bool_compare_and_swap ((mem), (int) (long) (oldval), \ (int) (long) (newval))) #define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval) \ (!__sync_bool_compare_and_swap ((mem), (long) (oldval), \ (long) (newval))) #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ __sync_val_compare_and_swap ((mem), (int) (long) (oldval), \ (int) (long) (newval)) #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ __sync_val_compare_and_swap ((mem), (long) (oldval), (long) (newval)) /* Atomically store newval and return the old value. */ #define atomic_exchange_acq(mem, value) \ __sync_lock_test_and_set (mem, value) #define atomic_exchange_rel(mem, value) \ (__sync_synchronize (), __sync_lock_test_and_set (mem, value)) #define atomic_exchange_and_add(mem, value) \ ({ __typeof (*mem) __result; \ __result = __sync_fetch_and_add ((mem), (int) (value)); \ __result; }) #define atomic_decrement_if_positive(mem) \ ({ __typeof (*mem) __oldval, __val; \ __typeof (mem) __memp = (mem); \ \ __val = (*__memp); \ do \ { \ __oldval = __val; \ if (__builtin_expect (__val <= 0, 0)) \ break; \ __val = atomic_compare_and_exchange_val_acq (__memp, __oldval - 1, \ __oldval); \ } \ while (__builtin_expect (__val != __oldval, 0)); \ __oldval; }) #define atomic_bit_test_set(mem, bit) \ ({ __typeof (*mem) __oldval, __val; \ __typeof (mem) __memp = (mem); \ __typeof (*mem) __mask = ((__typeof (*mem)) 1 << (bit)); \ \ __val = (*__memp); \ do \ { \ __oldval = __val; \ __val = atomic_compare_and_exchange_val_acq (__memp, \ __oldval | __mask, \ __oldval); \ } \ while (__builtin_expect (__val != __oldval, 0)); \ __oldval & __mask; }) #define atomic_full_barrier() __sync_synchronize ()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
You can’t perform that action at this time.