Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156392
b: refs/heads/master
c: 484889f
h: refs/heads/master
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Aug 3, 2009
1 parent 4c3eda0 commit a8749b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 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: 1de010a2702eb21d90883b83bf8c737d5e69d234
refs/heads/master: 484889fc85a223ef56edc31828b86751b2296b7c
5 changes: 3 additions & 2 deletions trunk/arch/mips/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long

unsigned long get_wchan(struct task_struct *p);

#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1)
#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \
THREAD_SIZE - 32 - sizeof(struct pt_regs))
#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk))
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/mips/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point

MTC0 zero, CP0_CONTEXT # clear context register
PTR_LA $28, init_thread_union
PTR_LI sp, _THREAD_SIZE - 32
/* Set the SP after an empty pt_regs. */
PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE
PTR_ADDU sp, $28
set_saved_sp sp, t0, t1
PTR_SUBU sp, 4 * SZREG # init stack pointer
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
{
struct thread_info *ti = task_thread_info(p);
struct pt_regs *childregs;
long childksp;
unsigned long childksp;
p->set_child_tid = p->clear_child_tid = NULL;

childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;
Expand All @@ -132,6 +132,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,

/* set up new TSS. */
childregs = (struct pt_regs *) childksp - 1;
/* Put the stack after the struct pt_regs. */
childksp = (unsigned long) childregs;
*childregs = *regs;
childregs->regs[7] = 0; /* Clear error flag */

Expand Down

0 comments on commit a8749b6

Please sign in to comment.