atomic_*_barrier macros

Matt Turner mattst88@gmail.com
Thu Aug 6 02:34:00 GMT 2009


The Xorg Xserver currently includes a lot of custom barrier macros for
MMIO. I have doubts about the correctness of some of them, and this
type of thing seems like something that would be provided by a central
library. So I checked to see if glibc had anything.

I found the atomic_{full,read,write}_barrier macros in atomic.h, but
(1) atomic.h isn't installed, and (2) not all platforms have all the
macros. I grepped through glibc.git and glibc-ports.git and determined
that:

None of the macros are provided -
- /sysdeps/i386/i486/bits/atomic.h
- /sysdeps/x86_64/bits/atomic.h
- /sysdeps/s390/bits/atomic.h
- Port: /sysdeps/m68k/m680x0/m68020/bits/atomic.h
- Port: /sysdeps/m68k/coldfire/bits/atomic.h
- Port: /sysdeps/arm/bits/atomic.h
- Port: /sysdeps/unix/sysv/linux/hppa/bits/atomic.h
- Port: /sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h

Only atomic_full_barrier -
- /sysdeps/ia64/bits/atomic.h
- Port: /sysdeps/unix/sysv/linux/arm/nptl/bits/atomic.h
- Port: /sysdeps/mips/bits/atomic.h

All barrier macros provided -
PowerPC{32,64}
Port: Alpha
SPARCv9-32
SPARC64

The Xserver currently has barrier macros for alpha, x86, amd64, ia64,
sparc, mips, arm, and powerpc -- so these are the most important.

What's the correct thing to do here? Could we add atomic macros for
needed platforms and export atomic.h?

Suggestions wanted.

Matt Turner



More information about the Libc-help mailing list