Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1543357
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 09/13] ARM: mark cmpxchg and xchg __always_inline for gcc-4.3 |
| Date | 2016-12-16 12:00 +0100 |
| Message-ID | <sOYp4-2rU-15@gated-at.bofh.it> (permalink) |
| References | <sOYp3-2rU-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
With older compiler versions like gcc-4.3 and CONFIG_OPTIMIZE_INLINING,
I run into link errors:
kernel/task_work.o: In function `__cmpxchg':
task_work.c:(.text+0x8c): undefined reference to `__bad_cmpxchg'
kernel/kthread.o: In function `__xchg':
kthread.c:(.text+0x7bc): undefined reference to `__bad_xchg'
This marks the functions in question as __always_inline to force
inlining.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/include/asm/cmpxchg.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
index 12215515ba02..218ba0ae90cd 100644
--- a/arch/arm/include/asm/cmpxchg.h
+++ b/arch/arm/include/asm/cmpxchg.h
@@ -24,7 +24,8 @@
#define swp_is_buggy
#endif
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+static __always_inline unsigned long
+__xchg(unsigned long x, volatile void *ptr, int size)
{
extern void __bad_xchg(volatile void *, int);
unsigned long ret;
@@ -152,8 +153,8 @@ extern void __bad_cmpxchg(volatile void *ptr, int size);
* cmpxchg only support 32-bits operands on ARMv6.
*/
-static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
- unsigned long new, int size)
+static __always_inline unsigned long
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
{
unsigned long oldval, res;
@@ -213,9 +214,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
sizeof(*(ptr))); \
})
-static inline unsigned long __cmpxchg_local(volatile void *ptr,
- unsigned long old,
- unsigned long new, int size)
+static __always_inline unsigned long
+__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, int size)
{
unsigned long ret;
--
2.9.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 09/13] ARM: mark cmpxchg and xchg __always_inline for gcc-4.3 Arnd Bergmann <arnd@arndb.de> - 2016-12-16 12:00 +0100
csiph-web