summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2007-08-16 21:08:05 +0800
committerZhang Le <r0bertz@gentoo.org>2007-08-16 21:08:05 +0800
commit0c199b41338435af2546289922973856e5935476 (patch)
tree11e90d309de5371e37908b1e3f24b1df5aa672e8 /dev-libs
parentenable dbus USE flag (diff)
downloadloongson-0c199b41338435af2546289922973856e5935476.tar.gz
loongson-0c199b41338435af2546289922973856e5935476.tar.bz2
loongson-0c199b41338435af2546289922973856e5935476.zip
add fetch_and_add_full to libatomic_ops mips patch
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/libatomic_ops/Manifest16
-rw-r--r--dev-libs/libatomic_ops/files/libatomic_ops-1.2-mips.patch52
-rw-r--r--dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild3
3 files changed, 54 insertions, 17 deletions
diff --git a/dev-libs/libatomic_ops/Manifest b/dev-libs/libatomic_ops/Manifest
index 400ce3b..f7439a1 100644
--- a/dev-libs/libatomic_ops/Manifest
+++ b/dev-libs/libatomic_ops/Manifest
@@ -1,16 +1,16 @@
-AUX libatomic_ops-1.2-mips.patch 2593 RMD160 12f8a8a3300739cbcba7ddbaae676819db2e85f8 SHA1 7c239f6eb8b411c33dcc64e9600cc0776c44bcd2 SHA256 f1ad7a1acd57e20aad81efb04c79652a0b263fe53557dfe85ba83dc8a5073fe8
-MD5 d8a8956632e37d55f68dccb439137922 files/libatomic_ops-1.2-mips.patch 2593
-RMD160 12f8a8a3300739cbcba7ddbaae676819db2e85f8 files/libatomic_ops-1.2-mips.patch 2593
-SHA256 f1ad7a1acd57e20aad81efb04c79652a0b263fe53557dfe85ba83dc8a5073fe8 files/libatomic_ops-1.2-mips.patch 2593
+AUX libatomic_ops-1.2-mips.patch 3740 RMD160 271557840fc29d04292d2dc0326f8da948c7fcb4 SHA1 3b8a2ae72e37c67fec7df0dca1db921af5f28ecd SHA256 d4cf43ec9af1b48fb48d68dc5fab5f70a041d89bea45e4105e9c7becfd487760
+MD5 e4458d053abe0523831a1c8257a53c94 files/libatomic_ops-1.2-mips.patch 3740
+RMD160 271557840fc29d04292d2dc0326f8da948c7fcb4 files/libatomic_ops-1.2-mips.patch 3740
+SHA256 d4cf43ec9af1b48fb48d68dc5fab5f70a041d89bea45e4105e9c7becfd487760 files/libatomic_ops-1.2-mips.patch 3740
AUX libatomic_ops-1.2-ppc64-load_acquire.patch 1383 RMD160 d3d368915d613b8a8f4af4806ede9e9f53d3eadc SHA1 6ca477928f48f7cc1f2515eb3d8f99af7d118807 SHA256 f061cdf1e70448a193abe316d9c4b4f6b924132a99abcea9753b1440274304f1
MD5 e6121a4fa6de7c5e265ddbb4fd76e005 files/libatomic_ops-1.2-ppc64-load_acquire.patch 1383
RMD160 d3d368915d613b8a8f4af4806ede9e9f53d3eadc files/libatomic_ops-1.2-ppc64-load_acquire.patch 1383
SHA256 f061cdf1e70448a193abe316d9c4b4f6b924132a99abcea9753b1440274304f1 files/libatomic_ops-1.2-ppc64-load_acquire.patch 1383
DIST libatomic_ops-1.2.tar.gz 183780 RMD160 8c548b32033c954a61e740f9a0e76ca8f005c4f6 SHA1 8bf4134d614acb1a6234b3102e67a847ae9369b0 SHA256 a3d8768aa8fd2f6ae79be2d756b3a6b48816b3889ae906be3d5ffb2de5a5c781
-EBUILD libatomic_ops-1.2.ebuild 823 RMD160 2e8149d5d226c3e4428a0e61949740747d5857f9 SHA1 7a011f53409ea3a7489f609cea185be1d4969d83 SHA256 1a4af670623e745ae564f92a43257503ebae790b3cc113a762af9bcc68c77080
-MD5 aa2c0f25d85812892eced707505138c4 libatomic_ops-1.2.ebuild 823
-RMD160 2e8149d5d226c3e4428a0e61949740747d5857f9 libatomic_ops-1.2.ebuild 823
-SHA256 1a4af670623e745ae564f92a43257503ebae790b3cc113a762af9bcc68c77080 libatomic_ops-1.2.ebuild 823
+EBUILD libatomic_ops-1.2.ebuild 846 RMD160 2f89179dd0d459068bf4048d52a02695fd470c4a SHA1 327fac6bc81234e3fa7666b0579cc44625653ffb SHA256 33980dcab992d0c1b6d452103461b643038f6b514f424c04daa849b3c5344e56
+MD5 6e97f075782087d88ae0168ca9b77ed1 libatomic_ops-1.2.ebuild 846
+RMD160 2f89179dd0d459068bf4048d52a02695fd470c4a libatomic_ops-1.2.ebuild 846
+SHA256 33980dcab992d0c1b6d452103461b643038f6b514f424c04daa849b3c5344e56 libatomic_ops-1.2.ebuild 846
MISC ChangeLog 1370 RMD160 e3eea2515bc19d11561fb204251963e2d69fb86f SHA1 45234a2d813e2c5a62cc89ec652e92dcca652ede SHA256 de51c4491fdb01ec01b85136380dd2156ccaa28579bf1b81869a50186662659f
MD5 ae1a9a7242e7edc6d537c333e02d12ea ChangeLog 1370
RMD160 e3eea2515bc19d11561fb204251963e2d69fb86f ChangeLog 1370
diff --git a/dev-libs/libatomic_ops/files/libatomic_ops-1.2-mips.patch b/dev-libs/libatomic_ops/files/libatomic_ops-1.2-mips.patch
index e18c366..79188ce 100644
--- a/dev-libs/libatomic_ops/files/libatomic_ops-1.2-mips.patch
+++ b/dev-libs/libatomic_ops/files/libatomic_ops-1.2-mips.patch
@@ -12,14 +12,27 @@ index c23f30b..791b360 100755
#endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
#if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)
+diff --git a/src/atomic_ops/sysdeps/Makefile.am b/src/atomic_ops/sysdeps/Makefile.am
+index 74122b4..d6737c0 100644
+--- a/src/atomic_ops/sysdeps/Makefile.am
++++ b/src/atomic_ops/sysdeps/Makefile.am
+@@ -29,6 +29,7 @@ nobase_sysdep_HEADERS= generic_pthread.h \
+ gcc/powerpc.h gcc/sparc.h \
+ gcc/hppa.h gcc/m68k.h gcc/s390.h \
+ gcc/ia64.h gcc/x86_64.h gcc/cris.h \
++ gcc/mips.h \
+ \
+ icc/ia64.h \
+ \
diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h
new file mode 100644
-index 0000000..2525a7a
+index 0000000..e7f3a5d
--- /dev/null
+++ b/src/atomic_ops/sysdeps/gcc/mips.h
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005 Thiemo Seufer <ths@networkno.de>
++ * Copyright (c) 2007 Zhang Le <r0bertz@gentoo.org>
+ *
+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
@@ -42,7 +55,7 @@ index 0000000..2525a7a
+{
+ __asm__ __volatile__(
+ " .set push \n"
-+ " .set mips2 \n"
++ " .set mips3 \n"
+ " .set noreorder \n"
+ " .set nomacro \n"
+ " sync \n"
@@ -60,16 +73,16 @@ index 0000000..2525a7a
+
+ __asm__ __volatile__(
+ " .set push \n"
-+ " .set mips2 \n"
++ " .set mips3 \n"
+ " .set noreorder \n"
+ " .set nomacro \n"
+ "1: ll %0, %1 \n"
+ " bne %0, %4, 2f \n"
-+ " move %0, %3 \n"
++ " move %0, %3 \n"
+ " sc %0, %1 \n"
+ " .set pop \n"
+ " beqz %0, 1b \n"
-+ " li %2, 1 \n"
++ " li %2, 1 \n"
+ "2: "
+ : "=&r" (temp), "+R" (*addr), "+r" (was_equal)
+ : "r" (new_val), "r" (old)
@@ -79,7 +92,30 @@ index 0000000..2525a7a
+
+#define AO_HAVE_compare_and_swap
+
++AO_INLINE AO_t
++AO_fetch_and_add_full (volatile AO_t *p, AO_t incr)
++{
++ AO_t result, temp;
++ __asm__ __volatile__(
++ " .set push \n"
++ " .set mips3 \n"
++ " .set noreorder \n"
++ " .set nomacro \n"
++ "1: ll %1, %2 \n"
++ " addu %0, %1, %3 \n"
++ " sc %0, %2 \n"
++ " beqz %0, 1b \n"
++ " addu %0, %1, %3 \n"
++ " sync \n"
++ " .set pop \n"
++ : "=&r" (result), "=&r" (temp), "=m" (*p)
++ : "r" (incr), "m" (*p)
++ : "memory");
++ return result;
++}
++
++#define AO_HAVE_fetch_and_add_full
++
+/*
-+ * FIXME: We should also implement fetch_and_add and or primitives
-+ * directly.
++ * FIXME: fetch_and_add_full implemented, any others?
+ */
diff --git a/dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild b/dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild
index 047a43b..e6f6e83 100644
--- a/dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild
+++ b/dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libatomic_ops/libatomic_ops-1.2.ebuild,v 1.7 2007/06/24 23:39:57 vapier Exp $
-inherit eutils
+inherit eutils autotools
DESCRIPTION="Implementation for atomic memory update operations"
HOMEPAGE="http://www.hpl.hp.com/research/linux/atomic_ops/"
@@ -21,6 +21,7 @@ src_unpack(){
cd "${S}"
epatch "${FILESDIR}"/${P}-ppc64-load_acquire.patch
epatch "${FILESDIR}"/${P}-mips.patch
+ eautoreconf
}
src_install() {