Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
6672b352
Commit
6672b352
authored
Sep 01, 2005
by
Mark Andrews
Browse files
1921. [port] aix: atomic locking for powerpc. [RT #15020]
parent
909ab894
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
6672b352
1921. [port] aix: atomic locking for powerpc. [RT #15020]
1920. [bug] Update windows socket code. [RT #14965]
1919. [bug] dig's +sigchase code overhauled. [RT #14933]
...
...
configure
View file @
6672b352
...
...
@@ -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.3
79
2005/0
8/25 06:31:45
marka Exp $
# $Id: configure,v 1.3
80
2005/0
9/01 03:36:18
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.39
0
.
# From configure.in Revision: 1.39
1
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
...
...
@@ -27581,30 +27581,7 @@ fi
arch=alpha
;;
powerpc-*)
case $host in
*-ibm-aix*)
if test "X$GCC" = "Xyes"; then
if test "$use_libtool" = yes -a "$use_threads" = yes
then
have_atomic=no
arch=noatomic
else
arch=powerpc
fi
else
have_atomic=no
arch=noatomic
fi
;;
*)
if test "X$GCC" = "Xyes"; then
arch=powerpc
else
have_atomic=no
arch=noatomic
fi
;;
esac
arch=powerpc
;;
mips-*)
arch=mips
...
...
@@ -27623,7 +27600,7 @@ if test "$have_atomic" = "yes"; then
echo $ECHO_N "checking compiler support for inline assembly code... $ECHO_C" >&6
compiler=generic
# Check whe
h
ter the compiler supports the assembly syntax we provide.
# Check whet
h
er the compiler supports the assembly syntax we provide.
if test "X$GCC" = "Xyes"; then
# GCC's ASM extension always works
compiler=gcc
...
...
@@ -27685,6 +27662,9 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
;;
powerpc-ibm-aix*)
compiler=aix
;;
esac
fi
case "$compiler" in
...
...
@@ -27694,6 +27674,8 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
osf)
ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
;;
aix)
;;
*)
# See if the generic __asm function works. If not,
# we need to disable the atomic operations.
...
...
configure.in
View file @
6672b352
...
...
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.39
0
$)
AC_REVISION($Revision: 1.39
1
$)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
...
...
@@ -1888,30 +1888,7 @@ main() {
arch=alpha
;;
powerpc-*)
case $host in
*-ibm-aix*)
if test "X$GCC" = "Xyes"; then
if test "$use_libtool" = yes -a "$use_threads" = yes
then
have_atomic=no
arch=noatomic
else
arch=powerpc
fi
else
have_atomic=no
arch=noatomic
fi
;;
*)
if test "X$GCC" = "Xyes"; then
arch=powerpc
else
have_atomic=no
arch=noatomic
fi
;;
esac
arch=powerpc
;;
mips-*)
arch=mips
...
...
@@ -1928,7 +1905,7 @@ if test "$have_atomic" = "yes"; then
AC_MSG_CHECKING([compiler support for inline assembly code])
compiler=generic
# Check whe
h
ter the compiler supports the assembly syntax we provide.
# Check whet
h
er the compiler supports the assembly syntax we provide.
if test "X$GCC" = "Xyes"; then
# GCC's ASM extension always works
compiler=gcc
...
...
@@ -1948,6 +1925,9 @@ if test "$have_atomic" = "yes"; then
return (0);],
[compiler=osf],)
;;
powerpc-ibm-aix*)
compiler=aix
;;
esac
fi
case "$compiler" in
...
...
@@ -1957,6 +1937,8 @@ if test "$have_atomic" = "yes"; then
osf)
ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
;;
aix)
;;
*)
# See if the generic __asm function works. If not,
# we need to disable the atomic operations.
...
...
lib/isc/powerpc/include/isc/atomic.h
View file @
6672b352
...
...
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: atomic.h,v 1.
2
2005/0
7
/0
9
0
6:43:57 jinmei
Exp $ */
/* $Id: atomic.h,v 1.
3
2005/0
9
/0
1
0
3:34:29 marka
Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
...
...
@@ -22,11 +22,52 @@
#include
<isc/platform.h>
#include
<isc/types.h>
#ifdef ISC_PLATFORM_USEGCCASM
/*
/*!\file
* static inline isc_int32_t
* isc_atomic_xadd(isc_int32_t *p, isc_int32_t val);
*
* This routine atomically increments the value stored in 'p' by 'val', and
* returns the previous value.
*
* static inline void
* isc_atomic_store(void *p, isc_int32_t val);
*
* This routine atomically stores the value 'val' in 'p'.
*
* static inline isc_int32_t
* isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val);
*
* This routine atomically replaces the value in 'p' with 'val', if the
* original value is equal to 'cmpval'. The original value is returned in any
* case.
*/
#if defined(_AIX)
#include
<sys/atomic_op.h>
#define isc_atomic_xadd(p, v) fetch_and_add(p, v)
#define isc_atomic_store(p, v) _clear_lock(p, v)
#ifdef __GNUC__
static
inline
int
#else
static
int
#endif
isc_atomic_cmpxchg
(
atomic_p
p
,
int
old
,
int
new
)
{
int
orig
=
old
;
#ifdef __GNUC__
asm
(
"ics"
);
#else
__isync
();
#endif
if
(
compare_and_swap
(
p
,
&
orig
,
new
))
return
(
old
);
return
(
orig
);
}
#elif ISC_PLATFORM_USEGCCASM
static
inline
isc_int32_t
isc_atomic_xadd
(
isc_int32_t
*
p
,
isc_int32_t
val
)
{
isc_int32_t
orig
;
...
...
@@ -46,9 +87,6 @@ isc_atomic_xadd(isc_int32_t *p, isc_int32_t val) {
return
(
orig
);
}
/*
* This routine atomically stores the value 'val' in 'p'.
*/
static
inline
void
isc_atomic_store
(
void
*
p
,
isc_int32_t
val
)
{
__asm__
volatile
(
...
...
@@ -63,11 +101,6 @@ isc_atomic_store(void *p, isc_int32_t val) {
);
}
/*
* This routine atomically replaces the value in 'p' with 'val', if the
* original value is equal to 'cmpval'. The original value is returned in any
* case.
*/
static
inline
isc_int32_t
isc_atomic_cmpxchg
(
isc_int32_t
*
p
,
isc_int32_t
cmpval
,
isc_int32_t
val
)
{
isc_int32_t
orig
;
...
...
@@ -90,7 +123,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_int32_t cmpval, isc_int32_t val) {
return
(
orig
);
}
#else
/* !ISC_PLATFORM_USEGCCASM */
#else
#error "unsupported compiler. disable atomic ops by --disable-atomic"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment