Skip to content

Commit 4a54b99

Browse files
committed
Add native compiler and memory barriers for solaris studio.
Discussion: 20140925133459.GB9633@alap3.anarazel.de Author: Oskari Saarenmaa
1 parent db29620 commit 4a54b99

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9164,7 +9164,7 @@ fi
91649164
done
91659165

91669166

9167-
for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
9167+
for ac_header in atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
91689168
do :
91699169
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
91709170
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ AC_SUBST(UUID_LIBS)
10161016
##
10171017

10181018
dnl sys/socket.h is required by AC_FUNC_ACCEPT_ARGTYPES
1019-
AC_CHECK_HEADERS([atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
1019+
AC_CHECK_HEADERS([atomic.h crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h])
10201020

10211021
# On BSD, test for net/if.h will fail unless sys/socket.h
10221022
# is included first.

src/include/pg_config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@
340340
/* Define to 1 if `long long int' works and is 64 bits. */
341341
#undef HAVE_LONG_LONG_INT_64
342342

343+
/* Define to 1 if you have the <mbarrier.h> header file. */
344+
#undef HAVE_MBARRIER_H
345+
343346
/* Define to 1 if you have the `mbstowcs_l' function. */
344347
#undef HAVE_MBSTOWCS_L
345348

src/include/port/atomics/generic-sunpro.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@
1919

2020
#if defined(HAVE_ATOMICS)
2121

22+
#ifdef HAVE_MBARRIER_H
23+
#include <mbarrier.h>
24+
25+
#define pg_compiler_barrier_impl() __compiler_barrier()
26+
27+
#ifndef pg_memory_barrier_impl
28+
# define pg_memory_barrier_impl() __machine_rw_barrier()
29+
#endif
30+
#ifndef pg_read_barrier_impl
31+
/*
32+
* Despite the name this is actually a full barrier. Expanding to mfence and
33+
* membar #StoreStore | #LoadStore | #StoreLoad | #LoadLoad on x86/sparc
34+
* respectively.
35+
*/
36+
# define pg_read_barrier_impl() __machine_r_barrier()
37+
#endif
38+
#ifndef pg_write_barrier_impl
39+
# define pg_write_barrier_impl() __machine_w_barrier()
40+
#endif
41+
42+
#endif /* HAVE_MBARRIER_H */
43+
2244
/* Older versions of the compiler don't have atomic.h... */
2345
#ifdef HAVE_ATOMIC_H
2446

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy