Commit 16ebfa16 authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

arm: parasite: implement arch_get_tls() in C

This patch should simplify the routine interface change
in the following patch.
Signed-off-by: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: 's avatarChristopher Covington <cov@codeaurora.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a247426c
#ifndef __ASM_PARASITE_H__ #ifndef __ASM_PARASITE_H__
#define __ASM_PARASITE_H__ #define __ASM_PARASITE_H__
static inline u32 arch_get_tls(void) { static inline u32 arch_get_tls(void)
u32 res; {
return ((u32 (*)())0xffff0fe0)();
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;
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment