[CRIU] [PATCH 11/13] syscalls: Change sys_mincore, sys_mprotect, sys_arch_prctl declaration

Cyrill Gorcunov gorcunov at openvz.org
Tue Apr 17 17:55:46 EDT 2012


To follow convention as declared in kernel.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/syscall.h |   12 ++++++------
 parasite.c        |    6 +++---
 restorer.c        |   10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/syscall.h b/include/syscall.h
index 516370f..ca6ed5c 100644
--- a/include/syscall.h
+++ b/include/syscall.h
@@ -184,9 +184,9 @@ static always_inline long sys_write(unsigned long fd, const void *buf, unsigned
 	return syscall3(__NR_write, fd, (unsigned long)buf, count);
 }
 
-static always_inline long sys_mincore(unsigned long addr, unsigned long size, void *vec)
+static always_inline long sys_mincore(void *addr, unsigned long size, void *vec)
 {
-	return syscall3(__NR_mincore, addr, size, (unsigned long)vec);
+	return syscall3(__NR_mincore, (unsigned long)addr, size, (unsigned long)vec);
 }
 
 static always_inline long sys_lseek(unsigned long fd, unsigned long offset, unsigned long origin)
@@ -194,9 +194,9 @@ static always_inline long sys_lseek(unsigned long fd, unsigned long offset, unsi
 	return syscall3(__NR_lseek, fd, offset, origin);
 }
 
-static always_inline long sys_mprotect(unsigned long start, unsigned long len, unsigned long prot)
+static always_inline long sys_mprotect(void *start, unsigned long len, unsigned long prot)
 {
-	return syscall3(__NR_mprotect, start, len, prot);
+	return syscall3(__NR_mprotect, (unsigned long)start, len, prot);
 }
 
 static always_inline long sys_nanosleep(struct timespec *req, struct timespec *rem)
@@ -260,9 +260,9 @@ static always_inline long sys_get_thread_area(user_desc_t *info)
 	return syscall1(__NR_get_thread_area, (long)info);
 }
 
-static always_inline long sys_arch_prctl(int code, void *addr)
+static always_inline long sys_arch_prctl(int code, unsigned long addr)
 {
-	return syscall2(__NR_arch_prctl, code, (unsigned long)addr);
+	return syscall2(__NR_arch_prctl, code, addr);
 }
 
 static always_inline long sys_prctl(int code, unsigned long arg2, unsigned long arg3,
diff --git a/parasite.c b/parasite.c
index 7fe6558..407376a 100644
--- a/parasite.c
+++ b/parasite.c
@@ -165,7 +165,7 @@ static int dump_pages(struct parasite_dump_pages_args *args)
 	if (!(args->vma_entry.prot & PROT_READ)) {
 		prot_old = (unsigned long)args->vma_entry.prot;
 		prot_new = prot_old | PROT_READ;
-		ret = sys_mprotect((unsigned long)args->vma_entry.start,
+		ret = sys_mprotect((void *)args->vma_entry.start,
 				   (unsigned long)vma_entry_len(&args->vma_entry),
 				   prot_new);
 		if (ret) {
@@ -180,7 +180,7 @@ static int dump_pages(struct parasite_dump_pages_args *args)
 	 * so stick for mincore as a basis.
 	 */
 
-	ret = sys_mincore((unsigned long)args->vma_entry.start, length, map);
+	ret = sys_mincore((void *)args->vma_entry.start, length, map);
 	if (ret) {
 		sys_write_msg("sys_mincore failed\n");
 		SET_PARASITE_RET(st, ret);
@@ -215,7 +215,7 @@ static int dump_pages(struct parasite_dump_pages_args *args)
 	 * Don't left pages readable if they were not.
 	 */
 	if (prot_old != prot_new) {
-		ret = sys_mprotect((unsigned long)args->vma_entry.start,
+		ret = sys_mprotect((void *)args->vma_entry.start,
 				   (unsigned long)vma_entry_len(&args->vma_entry),
 				   prot_old);
 		if (ret) {
diff --git a/restorer.c b/restorer.c
index 49ba5fe..7af708d 100644
--- a/restorer.c
+++ b/restorer.c
@@ -184,7 +184,7 @@ long __export_restore_thread(struct thread_restore_args *args)
 	CPREGT1(fs);
 
 	fsgs_base = core_entry->arch.gpregs.fs_base;
-	ret = sys_arch_prctl(ARCH_SET_FS, (void *)fsgs_base);
+	ret = sys_arch_prctl(ARCH_SET_FS, fsgs_base);
 	if (ret) {
 		write_num_n(__LINE__);
 		write_num_n(ret);
@@ -192,7 +192,7 @@ long __export_restore_thread(struct thread_restore_args *args)
 	}
 
 	fsgs_base = core_entry->arch.gpregs.gs_base;
-	ret = sys_arch_prctl(ARCH_SET_GS, (void *)fsgs_base);
+	ret = sys_arch_prctl(ARCH_SET_GS, fsgs_base);
 	if (ret) {
 		write_num_n(__LINE__);
 		write_num_n(ret);
@@ -460,7 +460,7 @@ long __export_restore_task(struct task_restore_core_args *args)
 		if (vma_entry->prot & PROT_WRITE)
 			continue;
 
-		sys_mprotect(vma_entry->start,
+		sys_mprotect((void *)vma_entry->start,
 			     vma_entry_len(vma_entry),
 			     vma_entry->prot);
 	}
@@ -538,7 +538,7 @@ long __export_restore_task(struct task_restore_core_args *args)
 	CPREG1(fs);
 
 	fsgs_base = core_entry->arch.gpregs.fs_base;
-	ret = sys_arch_prctl(ARCH_SET_FS, (void *)fsgs_base);
+	ret = sys_arch_prctl(ARCH_SET_FS, fsgs_base);
 	if (ret) {
 		write_num_n(__LINE__);
 		write_num_n(ret);
@@ -546,7 +546,7 @@ long __export_restore_task(struct task_restore_core_args *args)
 	}
 
 	fsgs_base = core_entry->arch.gpregs.gs_base;
-	ret = sys_arch_prctl(ARCH_SET_GS, (void *)fsgs_base);
+	ret = sys_arch_prctl(ARCH_SET_GS, fsgs_base);
 	if (ret) {
 		write_num_n(__LINE__);
 		write_num_n(ret);
-- 
1.7.7.6



More information about the CRIU mailing list