mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
2133. [port] powerpc: Support both IBM and MacOS Power PC
assembler syntaxes. [RT #16647]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
||||
2133. [port] powerpc: Support both IBM and MacOS Power PC
|
||||
assembler syntaxes. [RT #16647]
|
||||
|
||||
2132. [bug] Missing unlock on out of memory in
|
||||
dns_dispatchmgr_setudp().
|
||||
|
||||
|
72
configure
vendored
72
configure
vendored
@@ -14,7 +14,7 @@
|
||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
# $Id: configure,v 1.413 2007/01/08 01:53:30 marka Exp $
|
||||
# $Id: configure,v 1.414 2007/02/12 00:50:01 marka Exp $
|
||||
#
|
||||
# Portions Copyright (C) 1996-2001 Nominum, Inc.
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
# From configure.in Revision: 1.425 .
|
||||
# From configure.in Revision: 1.427 .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.59.
|
||||
#
|
||||
@@ -495,7 +495,7 @@ ac_includes_default="\
|
||||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_SOCKADDR_LEN_T ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC ISC_PLATFORM_HAVEGSSAPI ISC_PLATFORM_GSSAPIHEADER USE_GSSAPI DST_GSSAPI_INC DNS_GSSAPI_LIBS DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBTOOL_ALLOW_UNDEFINED LIBTOOL_IN_MAIN LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL LWRES_PLATFORM_NEEDSTRTOUL GENRANDOMLIB ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_ISC_SPNEGO DST_EXTRA_OBJS DST_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT LWRES_PLATFORM_QUADFORMAT ISC_PLATFORM_HAVESYSUNH ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX ISC_PLATFORM_HAVEXADD ISC_PLATFORM_HAVECMPXCHG ISC_PLATFORM_HAVEATOMICSTORE ISC_PLATFORM_USEGCCASM ISC_PLATFORM_USEOSFASM ISC_PLATFORM_USESTDASM ISC_ARCH_DIR LATEX PDFLATEX W3M XSLTPROC XMLLINT DOXYGEN XSLT_DOCBOOK_STYLE_HTML XSLT_DOCBOOK_STYLE_XHTML XSLT_DOCBOOK_STYLE_MAN XSLT_DOCBOOK_CHUNK_HTML XSLT_DOCBOOK_CHUNK_XHTML XSLT_DOCBOOK_CHUNKTOC_HTML XSLT_DOCBOOK_CHUNKTOC_XHTML XSLT_DOCBOOK_MAKETOC_HTML XSLT_DOCBOOK_MAKETOC_XHTML XSLT_DB2LATEX_STYLE XSLT_DB2LATEX_ADMONITIONS IDNLIBS BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION PG_CONFIG USE_DLZ DLZ_DRIVER_INCLUDES DLZ_DRIVER_LIBS DLZ_DRIVER_SRCS DLZ_DRIVER_OBJS BUILD_CC BUILD_CFLAGS BUILD_CPPFLAGS BUILD_LDFLAGS BUILD_LIBS LIBOBJS LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_SOCKADDR_LEN_T ISC_PLATFORM_HAVELONGLONG ISC_PLATFORM_HAVELIFCONF ISC_PLATFORM_NEEDSYSSELECTH LWRES_PLATFORM_NEEDSYSSELECTH USE_OPENSSL DST_OPENSSL_INC ISC_PLATFORM_HAVEGSSAPI ISC_PLATFORM_GSSAPIHEADER USE_GSSAPI DST_GSSAPI_INC DNS_GSSAPI_LIBS DNS_CRYPTO_LIBS ALWAYS_DEFINES ISC_PLATFORM_USETHREADS ISC_THREAD_DIR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK LIBTOOL_ALLOW_UNDEFINED LIBTOOL_IN_MAIN LIBBIND ISC_PLATFORM_HAVEIPV6 LWRES_PLATFORM_HAVEIPV6 ISC_PLATFORM_NEEDNETINETIN6H LWRES_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H LWRES_PLATFORM_NEEDNETINET6IN6H ISC_PLATFORM_HAVEINADDR6 LWRES_PLATFORM_HAVEINADDR6 ISC_PLATFORM_NEEDIN6ADDRANY LWRES_PLATFORM_NEEDIN6ADDRANY ISC_PLATFORM_NEEDIN6ADDRLOOPBACK LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C LWRES_HAVE_SIN6_SCOPE_ID ISC_PLATFORM_HAVESCOPEID ISC_PLATFORM_HAVEIF_LADDRREQ ISC_PLATFORM_HAVEIF_LADDRCONF ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON ISC_PLATFORM_HAVESALEN LWRES_PLATFORM_HAVESALEN ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_NEEDADDRINFO ISC_LWRES_NEEDRRSETINFO ISC_LWRES_SETHOSTENTINT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_GETNETBYADDRINADDR ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDMEMMOVE ISC_PLATFORM_NEEDSTRTOUL LWRES_PLATFORM_NEEDSTRTOUL GENRANDOMLIB ISC_PLATFORM_NEEDSTRLCPY ISC_PLATFORM_NEEDSTRLCAT ISC_PLATFORM_NEEDSPRINTF LWRES_PLATFORM_NEEDSPRINTF ISC_PLATFORM_NEEDVSNPRINTF LWRES_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_ISC_SPNEGO DST_EXTRA_OBJS DST_EXTRA_SRCS ISC_PLATFORM_QUADFORMAT LWRES_PLATFORM_QUADFORMAT ISC_PLATFORM_HAVESYSUNH ISC_PLATFORM_RLIMITTYPE ISC_PLATFORM_USEDECLSPEC LWRES_PLATFORM_USEDECLSPEC ISC_PLATFORM_BRACEPTHREADONCEINIT ISC_PLATFORM_HAVEIFNAMETOINDEX ISC_PLATFORM_HAVEXADD ISC_PLATFORM_HAVECMPXCHG ISC_PLATFORM_HAVEATOMICSTORE ISC_PLATFORM_USEGCCASM ISC_PLATFORM_USEOSFASM ISC_PLATFORM_USESTDASM ISC_PLATFORM_USEMACASM ISC_ARCH_DIR LATEX PDFLATEX W3M XSLTPROC XMLLINT DOXYGEN XSLT_DOCBOOK_STYLE_HTML XSLT_DOCBOOK_STYLE_XHTML XSLT_DOCBOOK_STYLE_MAN XSLT_DOCBOOK_CHUNK_HTML XSLT_DOCBOOK_CHUNK_XHTML XSLT_DOCBOOK_CHUNKTOC_HTML XSLT_DOCBOOK_CHUNKTOC_XHTML XSLT_DOCBOOK_MAKETOC_HTML XSLT_DOCBOOK_MAKETOC_XHTML XSLT_DB2LATEX_STYLE XSLT_DB2LATEX_ADMONITIONS IDNLIBS BIND9_TOP_BUILDDIR BIND9_ISC_BUILDINCLUDE BIND9_ISCCC_BUILDINCLUDE BIND9_ISCCFG_BUILDINCLUDE BIND9_DNS_BUILDINCLUDE BIND9_LWRES_BUILDINCLUDE BIND9_BIND9_BUILDINCLUDE BIND9_VERSION PG_CONFIG USE_DLZ DLZ_DRIVER_INCLUDES DLZ_DRIVER_LIBS DLZ_DRIVER_SRCS DLZ_DRIVER_OBJS BUILD_CC BUILD_CFLAGS BUILD_CPPFLAGS BUILD_LDFLAGS BUILD_LIBS LIBOBJS LTLIBOBJS'
|
||||
ac_subst_files='BIND9_MAKE_INCLUDES BIND9_MAKE_RULES LIBISC_API LIBISCCC_API LIBISCCFG_API LIBDNS_API LIBBIND9_API LIBLWRES_API DLZ_DRIVER_RULES'
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@@ -28461,6 +28461,68 @@ echo $ECHO_N "checking compiler support for inline assembly code... $ECHO_C" >&6
|
||||
# We can share the same code for gcc with x86_32
|
||||
arch=x86_32
|
||||
fi
|
||||
if test $arch = "powerpc"; then
|
||||
#
|
||||
# The MacOS (and maybe others) uses "r0" for register
|
||||
# zero. Under linux/ibm it is "0" for register 0.
|
||||
# Probe to see if we have a MacOS style assembler.
|
||||
#
|
||||
echo "$as_me:$LINENO: checking Checking for MacOS style assembler syntax" >&5
|
||||
echo $ECHO_N "checking Checking for MacOS style assembler syntax... $ECHO_C" >&6
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
__asm__ volatile ("li r0, 0x0\n"::);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest.$ac_objext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
|
||||
echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6
|
||||
compiler="mac"
|
||||
ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
else
|
||||
case "$host" in
|
||||
alpha*-dec-osf*)
|
||||
@@ -28529,6 +28591,8 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
;;
|
||||
aix)
|
||||
;;
|
||||
mac)
|
||||
;;
|
||||
*)
|
||||
# See if the generic __asm function works. If not,
|
||||
# we need to disable the atomic operations.
|
||||
@@ -28608,6 +28672,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
ISC_ARCH_DIR=$arch
|
||||
|
||||
|
||||
@@ -31286,6 +31351,7 @@ s,@ISC_PLATFORM_HAVEATOMICSTORE@,$ISC_PLATFORM_HAVEATOMICSTORE,;t t
|
||||
s,@ISC_PLATFORM_USEGCCASM@,$ISC_PLATFORM_USEGCCASM,;t t
|
||||
s,@ISC_PLATFORM_USEOSFASM@,$ISC_PLATFORM_USEOSFASM,;t t
|
||||
s,@ISC_PLATFORM_USESTDASM@,$ISC_PLATFORM_USESTDASM,;t t
|
||||
s,@ISC_PLATFORM_USEMACASM@,$ISC_PLATFORM_USEMACASM,;t t
|
||||
s,@ISC_ARCH_DIR@,$ISC_ARCH_DIR,;t t
|
||||
s,@LATEX@,$LATEX,;t t
|
||||
s,@PDFLATEX@,$PDFLATEX,;t t
|
||||
|
20
configure.in
20
configure.in
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
|
||||
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
|
||||
AC_DIVERT_POP()dnl
|
||||
|
||||
AC_REVISION($Revision: 1.426 $)
|
||||
AC_REVISION($Revision: 1.427 $)
|
||||
|
||||
AC_INIT(lib/dns/name.c)
|
||||
AC_PREREQ(2.59)
|
||||
@@ -2139,6 +2139,21 @@ if test "$have_atomic" = "yes"; then
|
||||
# We can share the same code for gcc with x86_32
|
||||
arch=x86_32
|
||||
fi
|
||||
if test $arch = "powerpc"; then
|
||||
#
|
||||
# The MacOS (and maybe others) uses "r0" for register
|
||||
# zero. Under linux/ibm it is "0" for register 0.
|
||||
# Probe to see if we have a MacOS style assembler.
|
||||
#
|
||||
AC_MSG_CHECKING([Checking for MacOS style assembler syntax])
|
||||
AC_TRY_COMPILE(, [
|
||||
__asm__ volatile ("li r0, 0x0\n"::);
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
compiler="mac"
|
||||
ISC_PLATFORM_USEMACASM="#define ISC_PLATFORM_USEMACASM 1"
|
||||
], [AC_MSG_RESULT(no)])
|
||||
fi
|
||||
else
|
||||
case "$host" in
|
||||
alpha*-dec-osf*)
|
||||
@@ -2165,6 +2180,8 @@ if test "$have_atomic" = "yes"; then
|
||||
;;
|
||||
aix)
|
||||
;;
|
||||
mac)
|
||||
;;
|
||||
*)
|
||||
# See if the generic __asm function works. If not,
|
||||
# we need to disable the atomic operations.
|
||||
@@ -2199,6 +2216,7 @@ AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
|
||||
AC_SUBST(ISC_PLATFORM_USEGCCASM)
|
||||
AC_SUBST(ISC_PLATFORM_USEOSFASM)
|
||||
AC_SUBST(ISC_PLATFORM_USESTDASM)
|
||||
AC_SUBST(ISC_PLATFORM_USEMACASM)
|
||||
|
||||
ISC_ARCH_DIR=$arch
|
||||
AC_SUBST(ISC_ARCH_DIR)
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: platform.h.in,v 1.41 2006/12/05 00:13:48 marka Exp $ */
|
||||
/* $Id: platform.h.in,v 1.42 2007/02/12 00:48:47 marka Exp $ */
|
||||
|
||||
#ifndef ISC_PLATFORM_H
|
||||
#define ISC_PLATFORM_H 1
|
||||
@@ -267,6 +267,12 @@
|
||||
*** Windows dll support.
|
||||
***/
|
||||
|
||||
/*
|
||||
* Define if MacOS style of PPC assembly must be used.
|
||||
* e.g. "r6", not "6", for register six.
|
||||
*/
|
||||
@ISC_PLATFORM_USEMACASM@
|
||||
|
||||
#ifndef ISC_PLATFORM_USEDECLSPEC
|
||||
#define LIBISC_EXTERNAL_DATA
|
||||
#define LIBDNS_EXTERNAL_DATA
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: atomic.h,v 1.3 2005/09/01 03:34:29 marka Exp $ */
|
||||
/* $Id: atomic.h,v 1.4 2007/02/12 00:48:47 marka Exp $ */
|
||||
|
||||
#ifndef ISC_ATOMIC_H
|
||||
#define ISC_ATOMIC_H 1
|
||||
@@ -67,18 +67,27 @@ isc_atomic_cmpxchg(atomic_p p, int old, int new) {
|
||||
return (orig);
|
||||
}
|
||||
|
||||
#elif ISC_PLATFORM_USEGCCASM
|
||||
#elif defined(ISC_PLATFORM_USEGCCASM) || defined(ISC_PLATFORM_USEMACASM)
|
||||
static inline isc_int32_t
|
||||
isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
|
||||
isc_int32_t orig;
|
||||
|
||||
__asm__ volatile (
|
||||
#ifdef ISC_PLATFORM_USEMACASM
|
||||
"1:"
|
||||
"lwarx r6, 0, %1\n"
|
||||
"mr %0, r6\n"
|
||||
"add r6, r6, %2\n"
|
||||
"stwcx. r6, 0, %1\n"
|
||||
"bne- 1b"
|
||||
#else
|
||||
"1:"
|
||||
"lwarx 6, 0, %1\n"
|
||||
"mr %0, 6\n"
|
||||
"add 6, 6, %2\n"
|
||||
"stwcx. 6, 0, %1\n"
|
||||
"bne- 1b"
|
||||
#endif
|
||||
: "=&r"(orig)
|
||||
: "r"(p), "r"(val)
|
||||
: "r6", "memory"
|
||||
@@ -90,11 +99,19 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
|
||||
static inline void
|
||||
isc_atomic_store(void *p, isc_int32_t val) {
|
||||
__asm__ volatile (
|
||||
#ifdef ISC_PLATFORM_USEMACASM
|
||||
"1:"
|
||||
"lwarx r6, 0, %0\n"
|
||||
"lwz r6, %1\n"
|
||||
"stwcx. r6, 0, %0\n"
|
||||
"bne- 1b"
|
||||
#else
|
||||
"1:"
|
||||
"lwarx 6, 0, %0\n"
|
||||
"lwz 6, %1\n"
|
||||
"stwcx. 6, 0, %0\n"
|
||||
"bne- 1b"
|
||||
#endif
|
||||
:
|
||||
: "r"(p), "m"(val)
|
||||
: "r6", "memory"
|
||||
@@ -106,6 +123,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
|
||||
isc_int32_t orig;
|
||||
|
||||
__asm__ volatile (
|
||||
#ifdef ISC_PLATFORM_USEMACASM
|
||||
"1:"
|
||||
"lwarx r6, 0, %1\n"
|
||||
"mr %0,r6\n"
|
||||
@@ -115,6 +133,17 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
|
||||
"stwcx. r6, 0, %1\n"
|
||||
"bne- 1b\n"
|
||||
"2:"
|
||||
#else
|
||||
"1:"
|
||||
"lwarx 6, 0, %1\n"
|
||||
"mr %0,6\n"
|
||||
"cmpw 6, %2\n"
|
||||
"bne 2f\n"
|
||||
"mr 6, %3\n"
|
||||
"stwcx. 6, 0, %1\n"
|
||||
"bne- 1b\n"
|
||||
"2:"
|
||||
#endif
|
||||
: "=&r" (orig)
|
||||
: "r"(p), "r"(cmpval), "r"(val)
|
||||
: "r6", "memory"
|
||||
|
Reference in New Issue
Block a user