[CRIU] [PATCH 1/8] arm: parasite: implement arch_get_tls() in C

Alexander Kartashov alekskartashov at parallels.com
Mon Mar 10 01:51:21 PDT 2014


This patch should simplify the routine interface change
in the following patch.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/arm/include/asm/parasite.h |   25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/arch/arm/include/asm/parasite.h b/arch/arm/include/asm/parasite.h
index 01c4d58..4c4007f 100644
--- a/arch/arm/include/asm/parasite.h
+++ b/arch/arm/include/asm/parasite.h
@@ -1,28 +1,9 @@
 #ifndef __ASM_PARASITE_H__
 #define __ASM_PARASITE_H__
 
-static inline u32 arch_get_tls(void) {
-	u32 res;
-
-	asm (
-	     "adr %%r1, 1f              \n"
-	     "ldr %%r1, [%%r1]          \n"
-	     "push { %%r7, %%lr }       \n"
-	     "blx %%r1                  \n"
-	     "pop { %%r7, %%lr }        \n"
-	     "mov %0, %%r0              \n"
-	     "b   2f                    \n"
-
-	     "1:                        \n"
-	     ".word 0xffff0fe0          \n"
-
-	     "2:                        \n"
-	     :"=r"(res)
-	     :
-	     : "r0", "r1", "memory"
-	     );
-
-	return res;
+static inline u32 arch_get_tls(void)
+{
+	return ((u32 (*)())0xffff0fe0)();
 }
 
 #endif
-- 
1.7.9.5



More information about the CRIU mailing list