diff options
Diffstat (limited to 'arch/sparc64/lib')
-rw-r--r-- | arch/sparc64/lib/mcount.S | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/arch/sparc64/lib/mcount.S b/arch/sparc64/lib/mcount.S index 7735a7a60533..fad90ddb3a28 100644 --- a/arch/sparc64/lib/mcount.S +++ b/arch/sparc64/lib/mcount.S | |||
@@ -48,12 +48,45 @@ mcount: | |||
48 | sub %g3, STACK_BIAS, %g3 | 48 | sub %g3, STACK_BIAS, %g3 |
49 | cmp %sp, %g3 | 49 | cmp %sp, %g3 |
50 | bg,pt %xcc, 1f | 50 | bg,pt %xcc, 1f |
51 | sethi %hi(panicstring), %g3 | 51 | nop |
52 | lduh [%g6 + TI_CPU], %g1 | ||
53 | sethi %hi(hardirq_stack), %g3 | ||
54 | or %g3, %lo(hardirq_stack), %g3 | ||
55 | sllx %g1, 3, %g1 | ||
56 | ldx [%g3 + %g1], %g7 | ||
57 | sub %g7, STACK_BIAS, %g7 | ||
58 | cmp %sp, %g7 | ||
59 | bleu,pt %xcc, 2f | ||
60 | sethi %hi(THREAD_SIZE), %g3 | ||
61 | add %g7, %g3, %g7 | ||
62 | cmp %sp, %g7 | ||
63 | blu,pn %xcc, 1f | ||
64 | 2: sethi %hi(softirq_stack), %g3 | ||
65 | or %g3, %lo(softirq_stack), %g3 | ||
66 | ldx [%g3 + %g1], %g7 | ||
67 | cmp %sp, %g7 | ||
68 | bleu,pt %xcc, 2f | ||
69 | sethi %hi(THREAD_SIZE), %g3 | ||
70 | add %g7, %g3, %g7 | ||
71 | cmp %sp, %g7 | ||
72 | blu,pn %xcc, 1f | ||
73 | nop | ||
74 | /* If we are already on ovstack, don't hop onto it | ||
75 | * again, we are already trying to output the stack overflow | ||
76 | * message. | ||
77 | */ | ||
52 | sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough | 78 | sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough |
53 | or %g7, %lo(ovstack), %g7 | 79 | or %g7, %lo(ovstack), %g7 |
54 | add %g7, OVSTACKSIZE, %g7 | 80 | add %g7, OVSTACKSIZE, %g3 |
81 | sub %g3, STACK_BIAS + 192, %g3 | ||
55 | sub %g7, STACK_BIAS, %g7 | 82 | sub %g7, STACK_BIAS, %g7 |
56 | mov %g7, %sp | 83 | cmp %sp, %g7 |
84 | blu,pn %xcc, 2f | ||
85 | cmp %sp, %g3 | ||
86 | bleu,pn %xcc, 1f | ||
87 | nop | ||
88 | 2: mov %g3, %sp | ||
89 | sethi %hi(panicstring), %g3 | ||
57 | call prom_printf | 90 | call prom_printf |
58 | or %g3, %lo(panicstring), %o0 | 91 | or %g3, %lo(panicstring), %o0 |
59 | call prom_halt | 92 | call prom_halt |