gcc-4.1.3 of kubuntu has problem with proper syscall register
initialization in rt_task_shadow if TLS is enabled. But it is likely
that more compiler versions below 4.3 and more configuration variants
are affected.

This patch installs a workaround for these gcc versions which places an
optimization barrier before the register variable setup. This forces gcc
to actually load the registers.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---

 include/asm-x86/syscall_64.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/syscall_64.h b/include/asm-x86/syscall_64.h
index adaa40b..6918ac4 100644
--- a/include/asm-x86/syscall_64.h
+++ b/include/asm-x86/syscall_64.h
@@ -82,7 +82,11 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
  * in kernel space.
  */
 
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#define LOAD_ARGS_0()  asm volatile ("" ::: "memory");
+#else
 #define LOAD_ARGS_0()
+#endif
 #define LOAD_REGS_0
 #define ASM_ARGS_0
 

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to