[CRIU] [PATCH 11/44] parasite: introduced the TLS area retrieval since ARM requires saving/restoring it.

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 7 10:04:40 EST 2013


Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/x86/include/asm/parasite.h |    9 +++++++++
 include/parasite.h              |    2 ++
 pie/parasite.c                  |    3 +++
 3 files changed, 14 insertions(+)
 create mode 100644 arch/x86/include/asm/parasite.h

diff --git a/arch/x86/include/asm/parasite.h b/arch/x86/include/asm/parasite.h
new file mode 100644
index 0000000..41f4a97
--- /dev/null
+++ b/arch/x86/include/asm/parasite.h
@@ -0,0 +1,9 @@
+#ifndef __ASM_PARASITE_H__
+#define __ASM_PARASITE_H__
+
+static inline u32 arch_get_tls()
+{
+	return 0;
+}
+
+#endif
diff --git a/include/parasite.h b/include/parasite.h
index f743e06..9918087 100644
--- a/include/parasite.h
+++ b/include/parasite.h
@@ -83,6 +83,7 @@ struct parasite_dump_misc {
 	u32 pid;
 	u32 sid;
 	u32 pgid;
+	u32 tls;
 };
 
 #define PARASITE_MAX_GROUPS	(PAGE_SIZE / sizeof(unsigned int))
@@ -97,6 +98,7 @@ struct parasite_dump_thread {
 	unsigned int		*tid_addr;
 	pid_t			tid;
 	k_rtsigset_t		blocked;
+	u32			tls;
 };
 
 #define PARASITE_MAX_FDS	(PAGE_SIZE / sizeof(int))
diff --git a/pie/parasite.c b/pie/parasite.c
index 6d33fa4..7cda9aa 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -12,6 +12,7 @@
 
 #include <string.h>
 
+#include "asm/parasite.h"
 
 static void *brk_start, *brk_end, *brk_tail;
 
@@ -284,6 +285,7 @@ static int dump_misc(struct parasite_dump_misc *args)
 	args->pid = sys_getpid();
 	args->sid = sys_getsid();
 	args->pgid = sys_getpgid();
+	args->tls = arch_get_tls();
 
 	return 0;
 }
@@ -369,6 +371,7 @@ static int dump_thread(struct parasite_dump_thread *args)
 
 	args->blocked = s->sig_blocked;
 	args->tid = tid;
+	args->tls = arch_get_tls();
 
 	return 0;
 }
-- 
1.7.10.4



More information about the CRIU mailing list