Commit 49834586 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://ppc.bkbits.net/for-linus-ppc

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 00121eaa d9084455
......@@ -173,8 +173,10 @@ _GLOBAL(DoSyscall)
cmpli 0,r0,NR_syscalls
bge- 66f
rlwinm r10,r1,0,0,18 /* current_thread_info() */
lwz r10,TI_FLAGS(r10)
andi. r10,r10,_TIF_SYSCALL_TRACE
lwz r11,TI_FLAGS(r10)
rlwinm r11,r11,0,~_TIF_FORCE_NOERROR
stw r11,TI_FLAGS(r10)
andi. r11,r11,_TIF_SYSCALL_TRACE
bne- syscall_dotrace
syscall_dotrace_cont:
lis r10,sys_call_table@h
......@@ -192,7 +194,11 @@ ret_from_syscall:
mr r6,r3
li r11,-_LAST_ERRNO
cmpl 0,r3,r11
rlwinm r12,r1,0,0,18 /* current_thread_info() */
blt+ 30f
lwz r11,TI_FLAGS(r12)
andi. r11,r11,_TIF_FORCE_NOERROR
bne 30f
neg r3,r3
cmpi 0,r3,ERESTARTNOHAND
bne 22f
......@@ -205,7 +211,6 @@ ret_from_syscall:
30: LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
SYNC
MTMSRD(r10)
rlwinm r12,r1,0,0,18 /* current_thread_info() */
lwz r9,TI_FLAGS(r12)
andi. r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
bne- syscall_exit_work
......
......@@ -69,8 +69,6 @@ struct task_struct init_task = INIT_TASK(init_task);
/* only used to get secondary processor up */
struct task_struct *current_set[NR_CPUS] = {&init_task, };
static void show_tsk_stack(struct task_struct *tsk, unsigned long sp);
#undef SHOW_TASK_SWITCHES
#undef CHECK_STACK
......@@ -296,7 +294,7 @@ void show_regs(struct pt_regs * regs)
break;
}
printk("\n");
show_tsk_stack(current, regs->gpr[1]);
show_stack(current, (unsigned long *) regs->gpr[1]);
}
void exit_thread(void)
......@@ -494,26 +492,29 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
return error;
}
void show_trace_task(struct task_struct *tsk)
{
show_tsk_stack(tsk, tsk->thread.ksp);
}
void dump_stack(void)
{
show_tsk_stack(current, _get_SP());
show_stack(current, NULL);
}
static void show_tsk_stack(struct task_struct *tsk, unsigned long sp)
void show_stack(struct task_struct *tsk, unsigned long *stack)
{
unsigned long stack_top, prev_sp, ret;
unsigned long sp, stack_top, prev_sp, ret;
int count = 0;
unsigned long next_exc = 0;
struct pt_regs *regs;
extern char ret_from_except, ret_from_except_full, ret_from_syscall;
sp = (unsigned long) stack;
if (tsk == NULL)
return;
tsk = current;
if (sp == 0) {
if (tsk == current)
asm("mr %0,1" : "=r" (sp));
else
sp = tsk->thread.ksp;
}
prev_sp = (unsigned long) (tsk->thread_info + 1);
stack_top = (unsigned long) tsk->thread_info + THREAD_SIZE;
while (count < 16 && sp > prev_sp && sp < stack_top && (sp & 3) == 0) {
......
......@@ -104,7 +104,5 @@ do { \
extern void synchronize_irq(unsigned int irq);
#endif /* CONFIG_SMP */
extern void show_stack(unsigned long *sp);
#endif /* __ASM_HARDIRQ_H */
#endif /* __KERNEL__ */
......@@ -49,6 +49,8 @@ struct pt_regs {
#define instruction_pointer(regs) ((regs)->nip)
#define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
#define force_successful_syscall_return() set_thread_flag(TIF_FORCE_NOERROR)
/*
* We use the least-significant bit of the trap field to indicate
* whether we have saved the full set of registers, or only a
......
......@@ -86,6 +86,8 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_FORCE_NOERROR 5 /* don't return error from current
syscall even if result < 0 */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
......@@ -93,6 +95,7 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_FORCE_NOERROR (1<<TIF_FORCE_NOERROR)
#endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment