2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

arm: parasite: implement arch_get_tls() in C

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

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Alexander Kartashov
2014-03-10 12:51:21 +04:00
committed by Pavel Emelyanov
parent a247426ca1
commit 16ebfa1656

View File

@@ -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