[CRIU] [PATCH 23/23] parasite-syscall.c: moved the function mmap_seized() to the file arch/x86/crtools.c
Alexander Kartashov
alekskartashov at parallels.com
Mon Jan 14 02:26:05 EST 2013
Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
arch/x86/crtools.c | 15 +++++++++++++++
arch/x86/include/asm/parasite-syscall.h | 4 ++++
parasite-syscall.c | 15 ---------------
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c
index 6015e53..605979e 100644
--- a/arch/x86/crtools.c
+++ b/arch/x86/crtools.c
@@ -410,3 +410,18 @@ int sigreturn_prep_fpu_frame(struct thread_restore_args *args, CoreEntry *core)
return 0;
}
+
+void *mmap_seized(struct parasite_ctl *ctl,
+ void *addr, size_t length, int prot,
+ int flags, int fd, off_t offset)
+{
+ unsigned long map;
+ int err;
+
+ err = syscall_seized(ctl, __NR_mmap, &map,
+ (unsigned long)addr, length, prot, flags, fd, offset);
+ if (err < 0 || map > TASK_SIZE)
+ map = 0;
+
+ return (void *)map;
+}
diff --git a/arch/x86/include/asm/parasite-syscall.h b/arch/x86/include/asm/parasite-syscall.h
index 1c3ae5d..d6481c6 100644
--- a/arch/x86/include/asm/parasite-syscall.h
+++ b/arch/x86/include/asm/parasite-syscall.h
@@ -10,4 +10,8 @@ extern const int code_syscall_size;
void parasite_setup_regs(unsigned long new_ip, user_regs_struct_t *regs);
+void *mmap_seized(struct parasite_ctl *ctl,
+ void *addr, size_t length, int prot,
+ int flags, int fd, off_t offset);
+
#endif
diff --git a/parasite-syscall.c b/parasite-syscall.c
index c1f8e82..4191b33 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -232,21 +232,6 @@ static int parasite_execute(unsigned int cmd, struct parasite_ctl *ctl)
return parasite_execute_by_pid(cmd, ctl, ctl->pid);
}
-static void *mmap_seized(struct parasite_ctl *ctl,
- void *addr, size_t length, int prot,
- int flags, int fd, off_t offset)
-{
- unsigned long map;
- int err;
-
- err = syscall_seized(ctl, __NR_mmap, &map,
- (unsigned long)addr, length, prot, flags, fd, offset);
- if (err < 0 || map > TASK_SIZE)
- map = 0;
-
- return (void *)map;
-}
-
static int munmap_seized(struct parasite_ctl *ctl, void *addr, size_t length)
{
unsigned long x;
--
1.7.10.4
More information about the CRIU
mailing list