Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177367
b: refs/heads/master
c: fa4b8f8
h: refs/heads/master
i:
  177365: ef4c6ef
  177363: 01c772b
  177359: edff3dd
v: v3
  • Loading branch information
Brian Gerst authored and H. Peter Anvin committed Dec 10, 2009
1 parent ef56987 commit 1936552
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 3bd95dfb182969dc6d2a317c150e0df7107608d3
refs/heads/master: fa4b8f84383ae197e643a46c36bf58ab8dffc95c
7 changes: 4 additions & 3 deletions trunk/arch/x86/kernel/process_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
regs.flags = X86_EFLAGS_IF;

/* Ok, create the new process.. */
return do_fork(flags | CLONE_VM | CLONE_UNTRACED, ~0UL, &regs, 0, NULL, NULL);
return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
}
EXPORT_SYMBOL(kernel_thread);

Expand Down Expand Up @@ -312,8 +312,9 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
*childregs = *regs;

childregs->ax = 0;
childregs->sp = sp;
if (sp == ~0UL)
if (user_mode(regs))
childregs->sp = sp;
else
childregs->sp = (unsigned long)childregs;

p->thread.sp = (unsigned long) childregs;
Expand Down

0 comments on commit 1936552

Please sign in to comment.