diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu-0.14.0/Detect-and-use-GCC-atomic-builtins-for-locking.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu-0.14.0/Detect-and-use-GCC-atomic-builtins-for-locking.patch | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-0.14.0/Detect-and-use-GCC-atomic-builtins-for-locking.patch b/meta/recipes-devtools/qemu/qemu-0.14.0/Detect-and-use-GCC-atomic-builtins-for-locking.patch deleted file mode 100644 index eb107b8497..0000000000 --- a/meta/recipes-devtools/qemu/qemu-0.14.0/Detect-and-use-GCC-atomic-builtins-for-locking.patch +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | From de01f17a2cb88dc5ff53cc321342b888c33b120a Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <lool@dooz.org> | ||
3 | Date: Thu, 11 Feb 2010 17:42:33 +0100 | ||
4 | Subject: [PATCH] Detect and use GCC atomic builtins for locking | ||
5 | |||
6 | --- | ||
7 | configure | 17 +++++++++++++++++ | ||
8 | qemu-lock.h | 13 +++++++++++++ | ||
9 | 2 files changed, 30 insertions(+), 0 deletions(-) | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Index: qemu-0.14.0/configure | ||
14 | =================================================================== | ||
15 | --- qemu-0.14.0.orig/configure | ||
16 | +++ qemu-0.14.0/configure | ||
17 | @@ -2243,6 +2243,20 @@ fi | ||
18 | ########################################## | ||
19 | |||
20 | ########################################## | ||
21 | +# check if we have gcc atomic built-ins | ||
22 | +gcc_atomic_builtins=no | ||
23 | +cat > $TMPC << EOF | ||
24 | +int main(void) { | ||
25 | + int i; | ||
26 | + __sync_lock_test_and_set(&i, 1); | ||
27 | + __sync_lock_release(&i); | ||
28 | +} | ||
29 | +EOF | ||
30 | +if compile_prog "" ""; then | ||
31 | + gcc_atomic_builtins=yes | ||
32 | +fi | ||
33 | + | ||
34 | +########################################## | ||
35 | # check if we have fdatasync | ||
36 | |||
37 | fdatasync=no | ||
38 | @@ -2731,6 +2745,9 @@ fi | ||
39 | if test "$gcc_attribute_warn_unused_result" = "yes" ; then | ||
40 | echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak | ||
41 | fi | ||
42 | +if test "$gcc_atomic_builtins" = "yes" ; then | ||
43 | + echo "CONFIG_GCC_ATOMIC_BUILTINS=y" >> $config_host_mak | ||
44 | +fi | ||
45 | if test "$fdatasync" = "yes" ; then | ||
46 | echo "CONFIG_FDATASYNC=y" >> $config_host_mak | ||
47 | fi | ||
48 | Index: qemu-0.14.0/qemu-lock.h | ||
49 | =================================================================== | ||
50 | --- qemu-0.14.0.orig/qemu-lock.h | ||
51 | +++ qemu-0.14.0/qemu-lock.h | ||
52 | @@ -33,6 +33,14 @@ | ||
53 | |||
54 | #else | ||
55 | |||
56 | +#ifdef CONFIG_GCC_ATOMIC_BUILTINS | ||
57 | +typedef int spinlock_t; | ||
58 | + | ||
59 | +#define SPIN_LOCK_UNLOCKED 0 | ||
60 | + | ||
61 | +#define resetlock(p) __sync_lock_release((p)) | ||
62 | +#else /* CONFIG_GCC_ATOMIC_BUILTINS */ | ||
63 | + | ||
64 | #if defined(__hppa__) | ||
65 | |||
66 | typedef int spinlock_t[4]; | ||
67 | @@ -56,7 +64,11 @@ static inline void resetlock (spinlock_t | ||
68 | } | ||
69 | |||
70 | #endif | ||
71 | +#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */ | ||
72 | |||
73 | +#ifdef CONFIG_GCC_ATOMIC_BUILTINS | ||
74 | +#define testandset(p) __sync_lock_test_and_set((p), 1) | ||
75 | +#else /* CONFIG_GCC_ATOMIC_BUILTINS */ | ||
76 | #if defined(_ARCH_PPC) | ||
77 | static inline int testandset (int *p) | ||
78 | { | ||
79 | @@ -213,6 +225,7 @@ static inline int testandset (int *p) | ||
80 | #else | ||
81 | #error unimplemented CPU support | ||
82 | #endif | ||
83 | +#endif /* !CONFIG_GCC_ATOMIC_BUILTINS */ | ||
84 | |||
85 | #if defined(CONFIG_USER_ONLY) | ||
86 | static inline void spin_lock(spinlock_t *lock) | ||