[CRIU] [PATCH 03/22] parasite-syscall.c: moved the syscall instructions into the file arch/x86/include/asm/parasite-syscall.h

Alexander Kartashov alekskartashov at parallels.com
Thu Dec 27 01:50:54 EST 2012


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

diff --git a/arch/x86/include/asm/parasite-syscall.h b/arch/x86/include/asm/parasite-syscall.h
new file mode 100644
index 0000000..6e4996c
--- /dev/null
+++ b/arch/x86/include/asm/parasite-syscall.h
@@ -0,0 +1,13 @@
+#ifndef __CR_ASM_PARASITE_SYSCALL_H__
+#define __CR_ASM_PARASITE_SYSCALL_H__
+
+/*
+ * Injected syscall instruction
+ */
+
+static const char code_syscall[] = {
+        0x0f, 0x05,                          /* syscall    */
+        0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc   /* int 3, ... */
+};
+
+#endif
diff --git a/parasite-syscall.c b/parasite-syscall.c
index 26de3ad..66031da 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -22,9 +22,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#ifdef CONFIG_X86_64
-static const char code_syscall[] = {0x0f, 0x05, 0xcc, 0xcc,
-				    0xcc, 0xcc, 0xcc, 0xcc};
+#include "asm/parasite-syscall.h"
 
 #define code_syscall_size	(round_up(sizeof(code_syscall), sizeof(long)))
 #define parasite_size		(round_up(sizeof(parasite_blob), sizeof(long)))
@@ -896,6 +894,3 @@ err_restore:
 	return NULL;
 }
 
-#else /* CONFIG_X86_64 */
-# error x86-32 is not yet implemented
-#endif /* CONFIG_X86_64 */
-- 
1.7.10.4



More information about the CRIU mailing list