summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch')
-rw-r--r--meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch b/meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch
new file mode 100644
index 0000000000..dfdd29cad5
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/libatomics-ops/gentoo/sh4-atomic-ops.patch
@@ -0,0 +1,70 @@
1This patch is taken from Gentoo
2http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libatomic_ops/files/libatomic_ops-1.2-sh4.patch?revision=1.1&view=markup
3
4Upstream-Status: Pending
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: libatomic_ops-1.2/src/atomic_ops.h
8===================================================================
9--- libatomic_ops-1.2.orig/src/atomic_ops.h 2012-04-30 13:56:17.000000000 -0700
10+++ libatomic_ops-1.2/src/atomic_ops.h 2012-04-30 13:58:28.747602349 -0700
11@@ -223,6 +223,10 @@
12 # if defined(__mips__)
13 # include "atomic_ops/sysdeps/gcc/mips.h"
14 # endif
15+# if defined(__sh__) || defined(SH4)
16+# include "atomic_ops/sysdeps/gcc/sh.h"
17+# define AO_CAN_EMUL_CAS
18+# endif /* __sh__ */
19 #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
20
21 #if defined(__INTEL_COMPILER) && !defined(AO_USE_PTHREAD_DEFS)
22Index: libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am
23===================================================================
24--- libatomic_ops-1.2.orig/src/atomic_ops/sysdeps/Makefile.am 2012-04-30 10:52:18.000000000 -0700
25+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/Makefile.am 2012-04-30 14:00:11.511609965 -0700
26@@ -28,7 +28,7 @@
27 gcc/powerpc.h gcc/sparc.h \
28 gcc/hppa.h gcc/m68k.h gcc/s390.h \
29 gcc/ia64.h gcc/x86_64.h gcc/cris.h \
30- gcc/mips.h \
31+ gcc/mips.h gcc/sh.h \
32 \
33 icc/ia64.h \
34 \
35Index: libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/sh.h
36===================================================================
37--- /dev/null 1970-01-01 00:00:00.000000000 +0000
38+++ libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc/sh.h 2012-04-30 13:58:28.755602350 -0700
39@@ -0,0 +1,31 @@
40+/*
41+ * Copyright (c) 2009 by Takashi YOSHII. All rights reserved.
42+ *
43+ * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
44+ * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
45+ *
46+ * Permission is hereby granted to use or copy this program
47+ * for any purpose, provided the above notices are retained on all copies.
48+ * Permission to modify the code and to distribute modified code is granted,
49+ * provided the above notices are retained, and a notice that the code was
50+ * modified is included with the above copyright notice.
51+ */
52+
53+#include "../all_atomic_load_store.h"
54+#include "../ordered.h"
55+
56+/* sh has tas.b(byte) only */
57+#include "../test_and_set_t_is_char.h"
58+
59+AO_INLINE AO_TS_VAL_t
60+AO_test_and_set_full(volatile AO_TS_t *addr)
61+{
62+ int oldval;
63+ __asm__ __volatile__(
64+ "tas.b @%1; movt %0"
65+ : "=r" (oldval)
66+ : "r" (addr)
67+ : "t", "memory");
68+ return oldval? AO_TS_CLEAR : AO_TS_SET;
69+}
70+#define AO_HAVE_test_and_set_full