Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 963
b: refs/heads/master
c: f48d966
h: refs/heads/master
i:
  961: d5c3ada
  959: e340247
v: v3
  • Loading branch information
Alexander Nyberg authored and Linus Torvalds committed May 5, 2005
1 parent 5a2e33f commit 4833e37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 47c297529bd23d93d2a088d9620bb220763e9cb1
refs/heads/master: f48d9663f19afb88ac0e45b825da523180f1f9c0
13 changes: 7 additions & 6 deletions trunk/arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
int err;

childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
*childregs = *regs;
childregs->eax = 0;
childregs->esp = esp;

p->thread.esp = (unsigned long) childregs;
/*
* The below -8 is to reserve 8 bytes on top of the ring0 stack.
* This is necessary to guarantee that the entire "struct pt_regs"
Expand All @@ -415,7 +410,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
* "struct pt_regs" is possible, but they may contain the
* completely wrong values.
*/
p->thread.esp0 = (unsigned long) (childregs+1) - 8;
childregs = (struct pt_regs *) ((unsigned long) childregs - 8);
*childregs = *regs;
childregs->eax = 0;
childregs->esp = esp;

p->thread.esp = (unsigned long) childregs;
p->thread.esp0 = (unsigned long) (childregs+1);

p->thread.eip = (unsigned long) ret_from_fork;

Expand Down

0 comments on commit 4833e37

Please sign in to comment.