From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: [v13][PATCH 09/12] Implement sys_eclone for x86_64 Date: Tue, 24 Nov 2009 12:09:25 -0800 Message-ID: <20091124200925.GJ24400@us.ibm.com> References: <20091124200449.GA24400@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20091124200449.GA24400-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andrew Morton Cc: Oren Laadan , serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org, "Eric W. Biederman" , Alexey Dobriyan , Pavel Emelyanov , hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org, Nathan Lynch , haveblue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org, Matt Helsley , arnd-r2nGTMty4D4@public.gmane.org, roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Containers List-Id: linux-api@vger.kernel.org From: Sukadev Bhattiprolu Subject: [v13][PATCH 09/12] Implement sys_eclone for x86_64 Implement sys_eclone() system call for x86_64. This is based on earlier code from Dave Hansen. Modified to share code between x86 and x86_64 kernels. Signed-off-by: Sukadev Bhattiprolu --- arch/x86/include/asm/unistd_64.h | 3 +++ arch/x86/kernel/entry_64.S | 1 + arch/x86/kernel/process_64.c | 7 +++++++ 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 8d3ad0a..d2ffc89 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h @@ -661,6 +661,9 @@ __SYSCALL(__NR_pwritev, sys_pwritev) __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) #define __NR_perf_event_open 298 __SYSCALL(__NR_perf_event_open, sys_perf_event_open) +#define __NR_eclone 299 +__SYSCALL(__NR_eclone, stub_eclone) + #ifndef __NO_STUBS #define __ARCH_WANT_OLD_READDIR diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index b5c061f..6d60cd1 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -698,6 +698,7 @@ END(\label) PTREGSCALL stub_vfork, sys_vfork, %rdi PTREGSCALL stub_sigaltstack, sys_sigaltstack, %rdx PTREGSCALL stub_iopl, sys_iopl, %rsi + PTREGSCALL stub_eclone, sys_eclone, %r8 ENTRY(ptregscall_common) DEFAULT_FRAME 1 8 /* offset 8: return address */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index eb62cbc..2c306b9 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -540,6 +540,13 @@ sys_clone(unsigned long clone_flags, unsigned long newsp, return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); } +asmlinkage long +sys_eclone(unsigned int flags_low, struct clone_args * __user uca, + int args_size, pid_t * __user pids, struct pt_regs *regs) +{ + return do_eclone_common(regs, flags_low, uca, args_size, pids); +} + unsigned long get_wchan(struct task_struct *p) { unsigned long stack; -- 1.6.0.4