diff options
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/dtlb_prot.S | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/etrap.S | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/idprom.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/init_task.c | 1 | ||||
-rw-r--r-- | arch/sparc64/kernel/process.c | 153 | ||||
-rw-r--r-- | arch/sparc64/kernel/rtrap.S | 3 | ||||
-rw-r--r-- | arch/sparc64/kernel/sbus.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 10 | ||||
-rw-r--r-- | arch/sparc64/kernel/stacktrace.c | 12 | ||||
-rw-r--r-- | arch/sparc64/kernel/starfire.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/sys32.S | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/trampoline.S | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/traps.c | 12 | ||||
-rw-r--r-- | arch/sparc64/kernel/unaligned.c | 2 |
17 files changed, 178 insertions, 35 deletions
diff --git a/arch/sparc64/kernel/dtlb_prot.S b/arch/sparc64/kernel/dtlb_prot.S index e0a920162604..b2c2c5be281c 100644 --- a/arch/sparc64/kernel/dtlb_prot.S +++ b/arch/sparc64/kernel/dtlb_prot.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: dtlb_prot.S,v 1.22 2001/04/11 23:40:32 davem Exp $ | 1 | /* |
2 | * dtlb_prot.S: DTLB protection trap strategy. | 2 | * dtlb_prot.S: DTLB protection trap strategy. |
3 | * This is included directly into the trap table. | 3 | * This is included directly into the trap table. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index bc2632274840..c49d0388b793 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: ebus.c,v 1.64 2001/11/08 04:41:33 davem Exp $ | 1 | /* |
2 | * ebus.c: PCI to EBus bridge device. | 2 | * ebus.c: PCI to EBus bridge device. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) | 4 | * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) |
diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S index f25e1da3fd03..29ce489bc188 100644 --- a/arch/sparc64/kernel/etrap.S +++ b/arch/sparc64/kernel/etrap.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: etrap.S,v 1.46 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * etrap.S: Preparing for entry into the kernel on Sparc V9. | 2 | * etrap.S: Preparing for entry into the kernel on Sparc V9. |
3 | * | 3 | * |
4 | * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1996, 1997 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/idprom.c b/arch/sparc64/kernel/idprom.c index 3b6789e09a72..5b45a808c621 100644 --- a/arch/sparc64/kernel/idprom.c +++ b/arch/sparc64/kernel/idprom.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: idprom.c,v 1.3 1999/08/31 06:54:53 davem Exp $ | 1 | /* |
2 | * idprom.c: Routines to load the idprom into kernel addresses and | 2 | * idprom.c: Routines to load the idprom into kernel addresses and |
3 | * interpret the data contained within. | 3 | * interpret the data contained within. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c index 90007cf88bac..d2b312381c19 100644 --- a/arch/sparc64/kernel/init_task.c +++ b/arch/sparc64/kernel/init_task.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
11 | 11 | ||
12 | static struct fs_struct init_fs = INIT_FS; | 12 | static struct fs_struct init_fs = INIT_FS; |
13 | static struct files_struct init_files = INIT_FILES; | ||
14 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | 13 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); |
15 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | 14 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); |
16 | struct mm_struct init_mm = INIT_MM(init_mm); | 15 | struct mm_struct init_mm = INIT_MM(init_mm); |
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index 4129c0449856..2084f81a76e1 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* arch/sparc64/kernel/process.c | 1 | /* arch/sparc64/kernel/process.c |
2 | * | 2 | * |
3 | * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) | 3 | * Copyright (C) 1995, 1996, 2008 David S. Miller (davem@davemloft.net) |
4 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) | 4 | * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) |
5 | * Copyright (C) 1997, 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 5 | * Copyright (C) 1997, 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
6 | */ | 6 | */ |
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/cpu.h> | 31 | #include <linux/cpu.h> |
32 | #include <linux/elfcore.h> | 32 | #include <linux/elfcore.h> |
33 | #include <linux/sysrq.h> | ||
33 | 34 | ||
34 | #include <asm/oplib.h> | 35 | #include <asm/oplib.h> |
35 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
@@ -49,6 +50,8 @@ | |||
49 | #include <asm/sstate.h> | 50 | #include <asm/sstate.h> |
50 | #include <asm/reboot.h> | 51 | #include <asm/reboot.h> |
51 | #include <asm/syscalls.h> | 52 | #include <asm/syscalls.h> |
53 | #include <asm/irq_regs.h> | ||
54 | #include <asm/smp.h> | ||
52 | 55 | ||
53 | /* #define VERBOSE_SHOWREGS */ | 56 | /* #define VERBOSE_SHOWREGS */ |
54 | 57 | ||
@@ -298,6 +301,118 @@ void show_regs(struct pt_regs *regs) | |||
298 | #endif | 301 | #endif |
299 | } | 302 | } |
300 | 303 | ||
304 | #ifdef CONFIG_MAGIC_SYSRQ | ||
305 | struct global_reg_snapshot global_reg_snapshot[NR_CPUS]; | ||
306 | static DEFINE_SPINLOCK(global_reg_snapshot_lock); | ||
307 | |||
308 | static void __global_reg_self(struct thread_info *tp, struct pt_regs *regs, | ||
309 | int this_cpu) | ||
310 | { | ||
311 | flushw_all(); | ||
312 | |||
313 | global_reg_snapshot[this_cpu].tstate = regs->tstate; | ||
314 | global_reg_snapshot[this_cpu].tpc = regs->tpc; | ||
315 | global_reg_snapshot[this_cpu].tnpc = regs->tnpc; | ||
316 | global_reg_snapshot[this_cpu].o7 = regs->u_regs[UREG_I7]; | ||
317 | |||
318 | if (regs->tstate & TSTATE_PRIV) { | ||
319 | struct reg_window *rw; | ||
320 | |||
321 | rw = (struct reg_window *) | ||
322 | (regs->u_regs[UREG_FP] + STACK_BIAS); | ||
323 | global_reg_snapshot[this_cpu].i7 = rw->ins[6]; | ||
324 | } else | ||
325 | global_reg_snapshot[this_cpu].i7 = 0; | ||
326 | |||
327 | global_reg_snapshot[this_cpu].thread = tp; | ||
328 | } | ||
329 | |||
330 | /* In order to avoid hangs we do not try to synchronize with the | ||
331 | * global register dump client cpus. The last store they make is to | ||
332 | * the thread pointer, so do a short poll waiting for that to become | ||
333 | * non-NULL. | ||
334 | */ | ||
335 | static void __global_reg_poll(struct global_reg_snapshot *gp) | ||
336 | { | ||
337 | int limit = 0; | ||
338 | |||
339 | while (!gp->thread && ++limit < 100) { | ||
340 | barrier(); | ||
341 | udelay(1); | ||
342 | } | ||
343 | } | ||
344 | |||
345 | static void sysrq_handle_globreg(int key, struct tty_struct *tty) | ||
346 | { | ||
347 | struct thread_info *tp = current_thread_info(); | ||
348 | struct pt_regs *regs = get_irq_regs(); | ||
349 | #ifdef CONFIG_KALLSYMS | ||
350 | char buffer[KSYM_SYMBOL_LEN]; | ||
351 | #endif | ||
352 | unsigned long flags; | ||
353 | int this_cpu, cpu; | ||
354 | |||
355 | if (!regs) | ||
356 | regs = tp->kregs; | ||
357 | |||
358 | spin_lock_irqsave(&global_reg_snapshot_lock, flags); | ||
359 | |||
360 | memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot)); | ||
361 | |||
362 | this_cpu = raw_smp_processor_id(); | ||
363 | |||
364 | __global_reg_self(tp, regs, this_cpu); | ||
365 | |||
366 | smp_fetch_global_regs(); | ||
367 | |||
368 | for_each_online_cpu(cpu) { | ||
369 | struct global_reg_snapshot *gp = &global_reg_snapshot[cpu]; | ||
370 | struct thread_info *tp; | ||
371 | |||
372 | __global_reg_poll(gp); | ||
373 | |||
374 | tp = gp->thread; | ||
375 | printk("%c CPU[%3d]: TSTATE[%016lx] TPC[%016lx] TNPC[%016lx] TASK[%s:%d]\n", | ||
376 | (cpu == this_cpu ? '*' : ' '), cpu, | ||
377 | gp->tstate, gp->tpc, gp->tnpc, | ||
378 | ((tp && tp->task) ? tp->task->comm : "NULL"), | ||
379 | ((tp && tp->task) ? tp->task->pid : -1)); | ||
380 | #ifdef CONFIG_KALLSYMS | ||
381 | if (gp->tstate & TSTATE_PRIV) { | ||
382 | sprint_symbol(buffer, gp->tpc); | ||
383 | printk(" TPC[%s] ", buffer); | ||
384 | sprint_symbol(buffer, gp->o7); | ||
385 | printk("O7[%s] ", buffer); | ||
386 | sprint_symbol(buffer, gp->i7); | ||
387 | printk("I7[%s]\n", buffer); | ||
388 | } else | ||
389 | #endif | ||
390 | { | ||
391 | printk(" TPC[%lx] O7[%lx] I7[%lx]\n", | ||
392 | gp->tpc, gp->o7, gp->i7); | ||
393 | } | ||
394 | } | ||
395 | |||
396 | memset(global_reg_snapshot, 0, sizeof(global_reg_snapshot)); | ||
397 | |||
398 | spin_unlock_irqrestore(&global_reg_snapshot_lock, flags); | ||
399 | } | ||
400 | |||
401 | static struct sysrq_key_op sparc_globalreg_op = { | ||
402 | .handler = sysrq_handle_globreg, | ||
403 | .help_msg = "Globalregs", | ||
404 | .action_msg = "Show Global CPU Regs", | ||
405 | }; | ||
406 | |||
407 | static int __init sparc_globreg_init(void) | ||
408 | { | ||
409 | return register_sysrq_key('y', &sparc_globalreg_op); | ||
410 | } | ||
411 | |||
412 | core_initcall(sparc_globreg_init); | ||
413 | |||
414 | #endif | ||
415 | |||
301 | unsigned long thread_saved_pc(struct task_struct *tsk) | 416 | unsigned long thread_saved_pc(struct task_struct *tsk) |
302 | { | 417 | { |
303 | struct thread_info *ti = task_thread_info(tsk); | 418 | struct thread_info *ti = task_thread_info(tsk); |
@@ -542,20 +657,39 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
542 | struct task_struct *p, struct pt_regs *regs) | 657 | struct task_struct *p, struct pt_regs *regs) |
543 | { | 658 | { |
544 | struct thread_info *t = task_thread_info(p); | 659 | struct thread_info *t = task_thread_info(p); |
660 | struct sparc_stackf *parent_sf; | ||
661 | unsigned long child_stack_sz; | ||
545 | char *child_trap_frame; | 662 | char *child_trap_frame; |
663 | int kernel_thread; | ||
546 | 664 | ||
547 | /* Calculate offset to stack_frame & pt_regs */ | 665 | kernel_thread = (regs->tstate & TSTATE_PRIV) ? 1 : 0; |
548 | child_trap_frame = task_stack_page(p) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ)); | 666 | parent_sf = ((struct sparc_stackf *) regs) - 1; |
549 | memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); | ||
550 | 667 | ||
551 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | | 668 | /* Calculate offset to stack_frame & pt_regs */ |
669 | child_stack_sz = ((STACKFRAME_SZ + TRACEREG_SZ) + | ||
670 | (kernel_thread ? STACKFRAME_SZ : 0)); | ||
671 | child_trap_frame = (task_stack_page(p) + | ||
672 | (THREAD_SIZE - child_stack_sz)); | ||
673 | memcpy(child_trap_frame, parent_sf, child_stack_sz); | ||
674 | |||
675 | t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | | ||
676 | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | | ||
552 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); | 677 | (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); |
553 | t->new_child = 1; | 678 | t->new_child = 1; |
554 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; | 679 | t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; |
555 | t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); | 680 | t->kregs = (struct pt_regs *) (child_trap_frame + |
681 | sizeof(struct sparc_stackf)); | ||
556 | t->fpsaved[0] = 0; | 682 | t->fpsaved[0] = 0; |
557 | 683 | ||
558 | if (regs->tstate & TSTATE_PRIV) { | 684 | if (kernel_thread) { |
685 | struct sparc_stackf *child_sf = (struct sparc_stackf *) | ||
686 | (child_trap_frame + (STACKFRAME_SZ + TRACEREG_SZ)); | ||
687 | |||
688 | /* Zero terminate the stack backtrace. */ | ||
689 | child_sf->fp = NULL; | ||
690 | t->kregs->u_regs[UREG_FP] = | ||
691 | ((unsigned long) child_sf) - STACK_BIAS; | ||
692 | |||
559 | /* Special case, if we are spawning a kernel thread from | 693 | /* Special case, if we are spawning a kernel thread from |
560 | * a userspace task (via KMOD, NFS, or similar) we must | 694 | * a userspace task (via KMOD, NFS, or similar) we must |
561 | * disable performance counters in the child because the | 695 | * disable performance counters in the child because the |
@@ -566,12 +700,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
566 | t->pcr_reg = 0; | 700 | t->pcr_reg = 0; |
567 | t->flags &= ~_TIF_PERFCTR; | 701 | t->flags &= ~_TIF_PERFCTR; |
568 | } | 702 | } |
569 | t->kregs->u_regs[UREG_FP] = t->ksp; | ||
570 | t->flags |= ((long)ASI_P << TI_FLAG_CURRENT_DS_SHIFT); | 703 | t->flags |= ((long)ASI_P << TI_FLAG_CURRENT_DS_SHIFT); |
571 | flush_register_windows(); | ||
572 | memcpy((void *)(t->ksp + STACK_BIAS), | ||
573 | (void *)(regs->u_regs[UREG_FP] + STACK_BIAS), | ||
574 | sizeof(struct sparc_stackf)); | ||
575 | t->kregs->u_regs[UREG_G6] = (unsigned long) t; | 704 | t->kregs->u_regs[UREG_G6] = (unsigned long) t; |
576 | t->kregs->u_regs[UREG_G4] = (unsigned long) t->task; | 705 | t->kregs->u_regs[UREG_G4] = (unsigned long) t->task; |
577 | } else { | 706 | } else { |
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index 16689b2930db..c6fc695fe1fe 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: rtrap.S,v 1.61 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * rtrap.S: Preparing for return from trap on Sparc V9. | 2 | * rtrap.S: Preparing for return from trap on Sparc V9. |
3 | * | 3 | * |
4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | 4 | * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
@@ -363,6 +363,7 @@ kern_rtt: rdpr %canrestore, %g1 | |||
363 | brz,pn %g1, kern_rtt_fill | 363 | brz,pn %g1, kern_rtt_fill |
364 | nop | 364 | nop |
365 | kern_rtt_restore: | 365 | kern_rtt_restore: |
366 | stw %g0, [%sp + PTREGS_OFF + PT_V9_MAGIC] | ||
366 | restore | 367 | restore |
367 | retry | 368 | retry |
368 | 369 | ||
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index fa2827c4a3ad..e33a8a660e9e 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: sbus.c,v 1.19 2002/01/23 11:27:32 davem Exp $ | 1 | /* |
2 | * sbus.c: UltraSparc SBUS controller support. | 2 | * sbus.c: UltraSparc SBUS controller support. |
3 | * | 3 | * |
4 | * Copyright (C) 1999 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1999 David S. Miller (davem@redhat.com) |
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c index da5e6ee0c661..c8b03a4f68bf 100644 --- a/arch/sparc64/kernel/setup.c +++ b/arch/sparc64/kernel/setup.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: setup.c,v 1.72 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * linux/arch/sparc64/kernel/setup.c | 2 | * linux/arch/sparc64/kernel/setup.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 6e4dc67d16af..9667e96fd513 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: signal.c,v 1.60 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * arch/sparc64/kernel/signal.c | 2 | * arch/sparc64/kernel/signal.c |
3 | * | 3 | * |
4 | * Copyright (C) 1991, 1992 Linus Torvalds | 4 | * Copyright (C) 1991, 1992 Linus Torvalds |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 0d6403a630ac..fa63c68a1819 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -900,6 +900,9 @@ extern unsigned long xcall_flush_tlb_mm; | |||
900 | extern unsigned long xcall_flush_tlb_pending; | 900 | extern unsigned long xcall_flush_tlb_pending; |
901 | extern unsigned long xcall_flush_tlb_kernel_range; | 901 | extern unsigned long xcall_flush_tlb_kernel_range; |
902 | extern unsigned long xcall_report_regs; | 902 | extern unsigned long xcall_report_regs; |
903 | #ifdef CONFIG_MAGIC_SYSRQ | ||
904 | extern unsigned long xcall_fetch_glob_regs; | ||
905 | #endif | ||
903 | extern unsigned long xcall_receive_signal; | 906 | extern unsigned long xcall_receive_signal; |
904 | extern unsigned long xcall_new_mmu_context_version; | 907 | extern unsigned long xcall_new_mmu_context_version; |
905 | #ifdef CONFIG_KGDB | 908 | #ifdef CONFIG_KGDB |
@@ -1080,6 +1083,13 @@ void smp_report_regs(void) | |||
1080 | smp_cross_call(&xcall_report_regs, 0, 0, 0); | 1083 | smp_cross_call(&xcall_report_regs, 0, 0, 0); |
1081 | } | 1084 | } |
1082 | 1085 | ||
1086 | #ifdef CONFIG_MAGIC_SYSRQ | ||
1087 | void smp_fetch_global_regs(void) | ||
1088 | { | ||
1089 | smp_cross_call(&xcall_fetch_glob_regs, 0, 0, 0); | ||
1090 | } | ||
1091 | #endif | ||
1092 | |||
1083 | /* We know that the window frames of the user have been flushed | 1093 | /* We know that the window frames of the user have been flushed |
1084 | * to the stack before we get here because all callers of us | 1094 | * to the stack before we get here because all callers of us |
1085 | * are flush_tlb_*() routines, and these run after flush_cache_*() | 1095 | * are flush_tlb_*() routines, and these run after flush_cache_*() |
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c index 01b52f561af4..c73ce3f4197e 100644 --- a/arch/sparc64/kernel/stacktrace.c +++ b/arch/sparc64/kernel/stacktrace.c | |||
@@ -19,7 +19,7 @@ void save_stack_trace(struct stack_trace *trace) | |||
19 | fp = ksp + STACK_BIAS; | 19 | fp = ksp + STACK_BIAS; |
20 | thread_base = (unsigned long) tp; | 20 | thread_base = (unsigned long) tp; |
21 | do { | 21 | do { |
22 | struct reg_window *rw; | 22 | struct sparc_stackf *sf; |
23 | struct pt_regs *regs; | 23 | struct pt_regs *regs; |
24 | unsigned long pc; | 24 | unsigned long pc; |
25 | 25 | ||
@@ -28,15 +28,17 @@ void save_stack_trace(struct stack_trace *trace) | |||
28 | fp >= (thread_base + THREAD_SIZE)) | 28 | fp >= (thread_base + THREAD_SIZE)) |
29 | break; | 29 | break; |
30 | 30 | ||
31 | rw = (struct reg_window *) fp; | 31 | sf = (struct sparc_stackf *) fp; |
32 | regs = (struct pt_regs *) (rw + 1); | 32 | regs = (struct pt_regs *) (sf + 1); |
33 | 33 | ||
34 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 34 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { |
35 | if (!(regs->tstate & TSTATE_PRIV)) | ||
36 | break; | ||
35 | pc = regs->tpc; | 37 | pc = regs->tpc; |
36 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; | 38 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; |
37 | } else { | 39 | } else { |
38 | pc = rw->ins[7]; | 40 | pc = sf->callers_pc; |
39 | fp = rw->ins[6] + STACK_BIAS; | 41 | fp = (unsigned long)sf->fp + STACK_BIAS; |
40 | } | 42 | } |
41 | 43 | ||
42 | if (trace->skip > 0) | 44 | if (trace->skip > 0) |
diff --git a/arch/sparc64/kernel/starfire.c b/arch/sparc64/kernel/starfire.c index b930fee7708a..7461581b3bb9 100644 --- a/arch/sparc64/kernel/starfire.c +++ b/arch/sparc64/kernel/starfire.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: starfire.c,v 1.10 2001/04/14 21:13:45 davem Exp $ | 1 | /* |
2 | * starfire.c: Starfire/E10000 support. | 2 | * starfire.c: Starfire/E10000 support. |
3 | * | 3 | * |
4 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1998 David S. Miller (davem@redhat.com) |
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S index 010a737908ee..ade18ba0c686 100644 --- a/arch/sparc64/kernel/sys32.S +++ b/arch/sparc64/kernel/sys32.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: sys32.S,v 1.12 2000/03/24 04:17:37 davem Exp $ | 1 | /* |
2 | * sys32.S: I-cache tricks for 32-bit compatibility layer simple | 2 | * sys32.S: I-cache tricks for 32-bit compatibility layer simple |
3 | * conversions. | 3 | * conversions. |
4 | * | 4 | * |
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S index 56ff55211341..704a3afcfd06 100644 --- a/arch/sparc64/kernel/trampoline.S +++ b/arch/sparc64/kernel/trampoline.S | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: trampoline.S,v 1.26 2002/02/09 19:49:30 davem Exp $ | 1 | /* |
2 | * trampoline.S: Jump start slave processors on sparc64. | 2 | * trampoline.S: Jump start slave processors on sparc64. |
3 | * | 3 | * |
4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) |
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index d9b8d46707d1..369749262653 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -2116,7 +2116,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2116 | printk("\n"); | 2116 | printk("\n"); |
2117 | #endif | 2117 | #endif |
2118 | do { | 2118 | do { |
2119 | struct reg_window *rw; | 2119 | struct sparc_stackf *sf; |
2120 | struct pt_regs *regs; | 2120 | struct pt_regs *regs; |
2121 | unsigned long pc; | 2121 | unsigned long pc; |
2122 | 2122 | ||
@@ -2124,15 +2124,17 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp) | |||
2124 | if (fp < (thread_base + sizeof(struct thread_info)) || | 2124 | if (fp < (thread_base + sizeof(struct thread_info)) || |
2125 | fp >= (thread_base + THREAD_SIZE)) | 2125 | fp >= (thread_base + THREAD_SIZE)) |
2126 | break; | 2126 | break; |
2127 | rw = (struct reg_window *)fp; | 2127 | sf = (struct sparc_stackf *) fp; |
2128 | regs = (struct pt_regs *) (rw + 1); | 2128 | regs = (struct pt_regs *) (sf + 1); |
2129 | 2129 | ||
2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { | 2130 | if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) { |
2131 | if (!(regs->tstate & TSTATE_PRIV)) | ||
2132 | break; | ||
2131 | pc = regs->tpc; | 2133 | pc = regs->tpc; |
2132 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; | 2134 | fp = regs->u_regs[UREG_I6] + STACK_BIAS; |
2133 | } else { | 2135 | } else { |
2134 | pc = rw->ins[7]; | 2136 | pc = sf->callers_pc; |
2135 | fp = rw->ins[6] + STACK_BIAS; | 2137 | fp = (unsigned long)sf->fp + STACK_BIAS; |
2136 | } | 2138 | } |
2137 | 2139 | ||
2138 | printk(" [%016lx] ", pc); | 2140 | printk(" [%016lx] ", pc); |
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 1a511e9f0d3e..afa7fc4f5193 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: unaligned.c,v 1.24 2002/02/09 19:49:31 davem Exp $ | 1 | /* |
2 | * unaligned.c: Unaligned load/store trap handling with special | 2 | * unaligned.c: Unaligned load/store trap handling with special |
3 | * cases for the kernel to do them more quickly. | 3 | * cases for the kernel to do them more quickly. |
4 | * | 4 | * |