Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177363
b: refs/heads/master
c: f839bbc
h: refs/heads/master
i:
  177361: e60781e
  177359: edff3dd
v: v3
  • Loading branch information
Brian Gerst authored and H. Peter Anvin committed Dec 10, 2009
1 parent 0aeb00e commit 01c772b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1382f157fb1175bba008abad0907310a1e459ce
refs/heads/master: f839bbc5c81b1c92ff8e81c360e9564f7b961b2e
8 changes: 2 additions & 6 deletions trunk/arch/x86/include/asm/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ int sys_fork(struct pt_regs *);
int sys_vfork(struct pt_regs *);
long sys_execve(char __user *, char __user * __user *,
char __user * __user *, struct pt_regs *);
long sys_clone(unsigned long, unsigned long, void __user *,
void __user *, struct pt_regs *);

/* kernel/ldt.c */
asmlinkage int sys_modify_ldt(int, void __user *, unsigned long);
Expand All @@ -42,9 +44,6 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *);
/* X86_32 only */
#ifdef CONFIG_X86_32

/* kernel/process_32.c */
int sys_clone(struct pt_regs *);

/* kernel/signal.c */
asmlinkage int sys_sigsuspend(int, int, old_sigset_t);
asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
Expand Down Expand Up @@ -73,9 +72,6 @@ int sys_vm86(unsigned long, unsigned long, struct pt_regs *);

/* X86_64 only */
/* kernel/process_64.c */
asmlinkage long sys_clone(unsigned long, unsigned long,
void __user *, void __user *,
struct pt_regs *);
long sys_arch_prctl(int, unsigned long);

/* kernel/sys_x86_64.c */
Expand Down
14 changes: 13 additions & 1 deletion trunk/arch/x86/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,6 @@ ptregs_##name: \

PTREGSCALL1(iopl)
PTREGSCALL0(fork)
PTREGSCALL0(clone)
PTREGSCALL0(vfork)
PTREGSCALL3(execve)
PTREGSCALL2(sigaltstack)
Expand All @@ -769,6 +768,19 @@ PTREGSCALL0(rt_sigreturn)
PTREGSCALL2(vm86)
PTREGSCALL1(vm86old)

/* Clone is an oddball. The 4th arg is in %edi */
ALIGN;
ptregs_clone:
leal 4(%esp),%eax
pushl %eax
pushl PT_EDI(%eax)
movl PT_EDX(%eax),%ecx
movl PT_ECX(%eax),%edx
movl PT_EBX(%eax),%eax
call sys_clone
addl $8,%esp
ret

.macro FIXUP_ESPFIX_STACK
/*
* Switch back for ESPFIX stack to the normal zerobased stack
Expand Down
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ int sys_vfork(struct pt_regs *regs)
NULL, NULL);
}

long
sys_clone(unsigned long clone_flags, unsigned long newsp,
void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
{
if (!newsp)
newsp = regs->sp;
return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
}


/*
* sys_execve() executes a new program.
Expand Down
15 changes: 0 additions & 15 deletions trunk/arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
return prev_p;
}

int sys_clone(struct pt_regs *regs)
{
unsigned long clone_flags;
unsigned long newsp;
int __user *parent_tidptr, *child_tidptr;

clone_flags = regs->bx;
newsp = regs->cx;
parent_tidptr = (int __user *)regs->dx;
child_tidptr = (int __user *)regs->di;
if (!newsp)
newsp = regs->sp;
return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
}

#define top_esp (THREAD_SIZE - sizeof(unsigned long))
#define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long))

Expand Down
9 changes: 0 additions & 9 deletions trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,15 +534,6 @@ void set_personality_64bit(void)
current->personality &= ~READ_IMPLIES_EXEC;
}

asmlinkage long
sys_clone(unsigned long clone_flags, unsigned long newsp,
void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
{
if (!newsp)
newsp = regs->sp;
return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
}

unsigned long get_wchan(struct task_struct *p)
{
unsigned long stack;
Expand Down

0 comments on commit 01c772b

Please sign in to comment.